Skip to content

Commit

Permalink
Merge pull request #602 from nextcloud-libraries/chore/cleanup-package
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Sep 26, 2023
2 parents 5961ec5 + b2ecabb commit 8937616
Show file tree
Hide file tree
Showing 11 changed files with 9,573 additions and 11,133 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @nextcloud/password-confirmation

[![npm](https://img.shields.io/npm/v/@nextcloud/password-confirmation?style=for-the-badge)](https://www.npmjs.com/package/@nextcloud/password-confirmation)
[![Build Status](https://img.shields.io/github/actions/workflow/status/nextcloud/nextcloud-password-confirmation/node.yml?branch=master&label=Build&style=for-the-badge)](https://github.com/nextcloud/nextcloud-password-confirmation/actions?query=branch%3Amaster)
[![License](https://img.shields.io/github/license/nextcloud/nextcloud-password-confirmation?style=for-the-badge)](https://github.com/nextcloud/nextcloud-password-confirmation/blob/master/LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/nextcloud-libraries/nextcloud-password-confirmation/node.yml?branch=master&label=Build&style=for-the-badge)](https://github.com/nextcloud-libraries/nextcloud-password-confirmation/actions?query=branch%3Amaster)
[![License](https://img.shields.io/github/license/nextcloud-libraries/nextcloud-password-confirmation?style=for-the-badge)](https://github.com/nextcloud-libraries/nextcloud-password-confirmation/blob/master/LICENSE)

Promise-based password confirmation for Nextcloud.

Expand All @@ -16,7 +16,7 @@ npm add @nextcloud/password-confirmation
## Usage
```js
import { confirmPassword } from '@nextcloud/password-confirmation'
import '@nextcloud/password-confirmation/dist/style.css' // Required for dialog styles
import '@nextcloud/password-confirmation/style.css' // Required for dialog styles

const foo = async () => {
try {
Expand Down
42 changes: 26 additions & 16 deletions build/extract-l10n.mjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
import { GettextExtractor, JsExtractors } from 'gettext-extractor'
import { GettextExtractor, JsExtractors, HtmlExtractors } from 'gettext-extractor'

const extractor = new GettextExtractor()

extractor
.createJsParser([
JsExtractors.callExpression('t', {
arguments: {
text: 0,
},
}),
JsExtractors.callExpression('n', {
arguments: {
text: 0,
textPlural: 1,
},
}),
])
.parseFilesGlob('./src/**/*.@(ts|js|vue)')
const jsParser = extractor.createJsParser([
JsExtractors.callExpression('t', {
arguments: {
text: 0,
},
}),
JsExtractors.callExpression('n', {
arguments: {
text: 0,
textPlural: 1,
},
}),
])
.parseFilesGlob('./src/**/*.@(ts|js)')

extractor.createHtmlParser([
HtmlExtractors.embeddedJs('*', jsParser),
HtmlExtractors.embeddedAttributeJs(/:[a-z]+/, jsParser),
])
.parseFilesGlob('./src/**/*.vue')

// remove references to avoid conflicts
extractor.getMessages().forEach((msg) => {
msg.references = []
})

extractor.savePotFile('./l10n/messages.pot')

Expand Down
6 changes: 0 additions & 6 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@ msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"

#: src/components/Dialog.vue:81
msgid "Authentication required"
msgstr ""

#: src/components/Dialog.vue:85
msgid "Confirm"
msgstr ""

#: src/components/Dialog.vue:84
msgid "Failed to authenticate, please try again"
msgstr ""

#: src/components/Dialog.vue:83
msgid "Password"
msgstr ""

#: src/main.ts:21
msgid "Password confirmation dialog already mounted"
msgstr ""

#: src/components/Dialog.vue:82
msgid "This action requires you to confirm your password"
msgstr ""
Loading

0 comments on commit 8937616

Please sign in to comment.