summaryrefslogtreecommitdiff
diff options
authorNathan Pratta Teodosio <nathan.teodosio@canonical.com>2023-02-09 12:52:40 -0300
committerNathan Pratta Teodosio <nathan.teodosio@canonical.com>2023-02-09 13:20:45 -0300
commit52aeb3c0bdb2d41b59cfde504f6ba2eb299c915e (patch)
tree2498e20afcde561865599180e07e1d1a06d9edc0
parenta7236c329e0883f46e9ead66e440bd0bce7dac08 (diff)
Add logic for locale-aware password information page translation.
-rwxr-xr-xlauncher/chromium.launcher7
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
}