Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and cleanup package #602

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading