From fd42689f00dac7257cf53b1f07b96671087757bd Mon Sep 17 00:00:00 2001 From: Michael Clark <5285928+MikesGlitch@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:16:17 +0000 Subject: [PATCH] Fix electron translations (#4317) * fix electron translations --- bin/package-electron | 10 ++++++++++ packages/desktop-client/src/i18n.ts | 4 ++++ upcoming-release-notes/4317.md | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 upcoming-release-notes/4317.md diff --git a/bin/package-electron b/bin/package-electron index 8203cc99df..74c0e87e29 100755 --- a/bin/package-electron +++ b/bin/package-electron @@ -36,6 +36,16 @@ fi yarn workspace loot-core build:node +# Get translations +echo "Updating translations..." +if ! [ -d packages/desktop-client/locale ]; then + git clone https://github.com/actualbudget/translations packages/desktop-client/locale +fi +pushd packages/desktop-client/locale > /dev/null +git pull +popd > /dev/null +packages/desktop-client/bin/remove-untranslated-languages + yarn workspace @actual-app/web build --mode=desktop # electron specific build yarn workspace desktop-electron update-client diff --git a/packages/desktop-client/src/i18n.ts b/packages/desktop-client/src/i18n.ts index 7372866697..5955197e5f 100644 --- a/packages/desktop-client/src/i18n.ts +++ b/packages/desktop-client/src/i18n.ts @@ -77,5 +77,9 @@ export const setI18NextLanguage = (language: string) => { return; } + if (language === i18n.language) { + return; // language is already set + } + i18n.changeLanguage(language || 'en'); }; diff --git a/upcoming-release-notes/4317.md b/upcoming-release-notes/4317.md new file mode 100644 index 0000000000..32541d97e9 --- /dev/null +++ b/upcoming-release-notes/4317.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MikesGlitch] +--- + +Fix Electron language support