From 3693674fc94dedc501a12f291d6caa07fd8715be Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 23 Apr 2023 02:55:36 -0400 Subject: [PATCH] Fix Fluent localization for non-English locales All declared Fluent files need to exist for a locale to be used (in a window?). Since Mozilla code tries to load Fluent files, we need to copy non-English Mozilla .ftl files to their default effective path (just in the app omni.ja instead of the toolkit omni.ja). Fixes #3094 --- app/build.sh | 16 +++++++++++----- chrome/content/scaffold/scaffold.xhtml | 3 +-- chrome/content/zotero/editMenuOverlay.js | 2 +- chrome/content/zotero/elements/noteEditor.js | 2 +- chrome/content/zotero/reader.xhtml | 3 +-- .../content/zotero/standalone/basicViewer.xhtml | 3 +-- chrome/content/zotero/zoteroPane.xhtml | 3 +-- scripts/locale/merge_mozilla_files | 9 +++------ 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/app/build.sh b/app/build.sh index 7e0f8eb218..7f3293133a 100755 --- a/app/build.sh +++ b/app/build.sh @@ -282,14 +282,20 @@ echo "Version: $VERSION" rm -rf META-INF # Copy branding -#cp -R "$CALLDIR/assets/branding/content" chrome/branding/content cp -R "$CALLDIR"/assets/branding/locale/brand.{dtd,properties} chrome/en-US/locale/branding/ -cp "$CALLDIR/assets/branding/locale/brand.ftl" localization/en-US/branding/brand.ftl -# Copy localization .ftl files +# Copy browser localization .ftl files for locale in `ls chrome/locale/`; do - mkdir -p localization/$locale/mozilla - cp chrome/locale/$locale/zotero/mozilla/*.ftl localization/$locale/mozilla/ + mkdir -p localization/$locale/branding + cp "$CALLDIR/assets/branding/locale/brand.ftl" localization/$locale/branding/brand.ftl + + mkdir -p localization/$locale/toolkit/global + cp chrome/locale/$locale/zotero/mozilla/textActions.ftl localization/$locale/toolkit/global + cp chrome/locale/$locale/zotero/mozilla/wizard.ftl localization/$locale/toolkit/global + + mkdir -p localization/$locale/browser + cp chrome/locale/$locale/zotero/mozilla/menubar.ftl localization/$locale/browser + # TEMP: Until we've created zotero.ftl in all locales touch chrome/locale/$locale/zotero/zotero.ftl cp chrome/locale/$locale/zotero/*.ftl localization/$locale/ diff --git a/chrome/content/scaffold/scaffold.xhtml b/chrome/content/scaffold/scaffold.xhtml index bb39039c3a..9243b78ff1 100644 --- a/chrome/content/scaffold/scaffold.xhtml +++ b/chrome/content/scaffold/scaffold.xhtml @@ -45,8 +45,7 @@ xmlns:html="http://www.w3.org/1999/xhtml" style="display: flex;"> - - +