diff options
author | Nathan Pratta Teodosio <nathan.teodosio@canonical.com> | 2023-02-09 12:52:40 -0300 |
---|---|---|
committer | Nathan Pratta Teodosio <nathan.teodosio@canonical.com> | 2023-02-09 13:15:31 -0300 |
commit | 3f8499f2b969793d7178671a68f468df5f572f7b (patch) | |
tree | 5477c718e2fb77ace9c0375bebc6b85adc15de67 | |
parent | 81c58c5a123e8f8e86540601bdee2ad989b6f9d1 (diff) |
Add logic for locale-aware password information page translation.
-rwxr-xr-x | launcher/chromium.launcher | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/launcher/chromium.launcher b/launcher/chromium.launcher index fe69300..1c57644 100755 --- a/launcher/chromium.launcher +++ b/launcher/chromium.launcher @@ -80,7 +80,12 @@ warn_password_fixed() { printf "%s\n" "This is a placeholder file to disable password storage informational note." > "$oldpasswords" else - PASSWORD_PAGE="$SNAP/firstrun/password-en.html" + lang_code=$(locale | awk -F '[_=]' '/LANG=/{print $2}') + PASSWORD_PAGE="$SNAP/firstrun/password-$lang_code.html" + if [ ! -f "$PASSWORD_PAGE" ]; then + # No localized version, fall back to English + PASSWORD_PAGE="$SNAP/firstrun/password-en.html" + fi fi fi } |