mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-11 16:24:11 +01:00
Frontend: Disable msgmerge fuzzy matching with vue3-gettext
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -74,6 +74,7 @@ testcafe:
|
||||
acceptance-local:
|
||||
npm run acceptance-local
|
||||
gettext-extract:
|
||||
# Script sets GETTEXT_MERGE=0 by default so vue-gettext skips msgmerge; scripts/gettext-merge.sh handles merging.
|
||||
npm run gettext-extract
|
||||
gettext-compile:
|
||||
npm run gettext-compile
|
||||
|
||||
@@ -31,6 +31,10 @@ const languageCodes = glob.sync(path.join(localesPath, "*.po")).map((filePath) =
|
||||
return fileName.replace(".po", "");
|
||||
});
|
||||
|
||||
// vue3-gettext merges msgstr entries via msgmerge; disable this when GETTEXT_MERGE=0|false.
|
||||
const mergeEnv = (process.env.GETTEXT_MERGE || "").toLowerCase();
|
||||
const shouldMergeLocales = mergeEnv !== "0" && mergeEnv !== "false";
|
||||
|
||||
// Generates one JSON file per locale from the gettext *.po files located in src/locales.
|
||||
module.exports = {
|
||||
input: {
|
||||
@@ -42,7 +46,7 @@ module.exports = {
|
||||
path: localesPath,
|
||||
potPath: "translations.pot",
|
||||
jsonPath: "json",
|
||||
locales: languageCodes,
|
||||
locales: shouldMergeLocales ? languageCodes : [],
|
||||
splitJson: true,
|
||||
flat: true,
|
||||
linguas: false,
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
"dep-list": "npx npm-check-updates",
|
||||
"fmt": "eslint --cache --fix src/ *.js eslint.config.mjs",
|
||||
"fmt-npm": "prettier --write package.json",
|
||||
"gettext-compile": "vue-gettext-compile",
|
||||
"gettext-extract": "vue-gettext-extract --config gettext.config.js",
|
||||
"gettext-compile": "cross-env GETTEXT_MERGE=1 vue-gettext-compile --config gettext.config.js",
|
||||
"gettext-extract": "cross-env GETTEXT_MERGE=0 vue-gettext-extract --config gettext.config.js",
|
||||
"lint": "eslint --cache src/ *.js",
|
||||
"test": "cross-env TZ=UTC BUILD_ENV=development NODE_ENV=development BABEL_ENV=test vitest run",
|
||||
"test-watch": "cross-env TZ=UTC BUILD_ENV=development NODE_ENV=development BABEL_ENV=test vitest --watch",
|
||||
|
||||
Reference in New Issue
Block a user