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

chore: replace easygettext with scripts from vue3 gettext #10389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions gettext.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
input: {
path: './src',
include: ['**/*.js', '**/*.ts', '**/*.vue']
},
output: {
locales: ['bg', 'cs', 'de', 'en', 'es', 'fr', 'it', 'nl', 'ko', 'sq', 'sv', 'tr', 'zh'],
path: './l10n/locale',
potPath: '../template.pot',
flat: false,
linguas: false
}
}
2 changes: 1 addition & 1 deletion packages/design-system/docs/i18n.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Writing translations

For translations we are using combination of [vue-gettext](https://github.com/Polyconseil/vue-gettext) and [easygettext](https://github.com/polyconseil/easygettext).
For translations we are using [Vue 3 Gettext](https://jshmrtn.github.io/vue3-gettext/).

### Escaping

Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:design-system]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-admin-settings/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:admin-settings]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-draw-io/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:draw-io]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-external/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:external]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:files]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-importer/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:importer]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-ocm/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:ocm]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-pdf-viewer/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:pdf-viewer]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-preview/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:preview]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-search/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:search]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-text-editor/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:text-editor]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-webfinger/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:webfinger]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:client]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-pkg/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:pkg]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/l10n/.tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
host = https://www.transifex.com

[o:owncloud-org:p:owncloud-web:r:core]
file_filter = locale/<lang>/LC_MESSAGES/app.po
file_filter = locale/<lang>/app.po
minimum_perc = 0
source_file = template.pot
source_lang = en
Expand Down
5 changes: 2 additions & 3 deletions packages/web-runtime/l10n/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ $(TEMPLATE_FILE):
export OUT_DIR=$$app/l10n; \
fi; \
mkdir -p $$OUT_DIR; \
export GETTEXT_APP_SOURCES=`find $$app/src -name '*.vue' -o -name '*.js' -o -name '*.ts'`; \
node $(NODE_MODULES)/easygettext/src/extract-cli.js --attribute v-translate --output $$OUT_DIR/template.pot $$GETTEXT_APP_SOURCES; \
(cd $$app && pnpm exec vue-gettext-extract --config ../../gettext.config.cjs); \
done;

.PHONY: translations
Expand All @@ -66,7 +65,7 @@ $(OUTPUT_DIR)/translations.json:
export OUT_DIR=$$app/l10n; \
fi; \
mkdir -p $$OUT_DIR; \
gettext-compile --output $$OUT_DIR/translations.json $(patsubst %,$$OUT_DIR/locale/%/LC_MESSAGES/app.po,$(LOCALES)); \
(cd $$app && pnpm exec vue-gettext-compile && mv ./l10n/locale/translations.json ./l10n/translations.json); \
done; \

.PHONY: push
Expand Down
1 change: 0 additions & 1 deletion packages/web-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@vueuse/head": "2.0.0",
"axios": "1.6.5",
"design-system": "workspace:@ownclouders/design-system@*",
"easygettext": "https://github.com/owncloud/easygettext/archive/refs/tags/v2.18.2-oc.tar.gz",
"filesize": "^9.0.11",
"focus-trap": "7.2.0",
"focus-trap-vue": "^4.0.1",
Expand Down