Read a quoted LANG and append LANG on its own line in omarchy-language
This commit is contained in:
1 parent
199a7f23fc
commit
b914d694f2
2 files changed
+19
-4
No files matched your search
@@ -41,10 +41,21 @@ output=$(omarchy-language en)
|
||||
[[ $output == "Log back in to switch the language." ]] || fail "English reminds in English" "$output"
|
||||
pass "switching to English generates en_US and sets LANG"
|
||||
|
||||
printf 'LC_TIME=en_DK.UTF-8\n' >"$root/etc/locale.conf"
|
||||
printf 'LC_TIME=en_DK.UTF-8' >"$root/etc/locale.conf"
|
||||
omarchy-language zh >/dev/null
|
||||
[[ $(<"$root/etc/locale.conf") == $'LC_TIME=en_DK.UTF-8\nLANG=zh_CN.UTF-8' ]] || fail "a locale.conf without LANG gains one" "$(<"$root/etc/locale.conf")"
|
||||
pass "a locale.conf without LANG gains one"
|
||||
[[ $(<"$root/etc/locale.conf") == $'LC_TIME=en_DK.UTF-8\nLANG=zh_CN.UTF-8' ]] || fail "a locale.conf without LANG or a final newline gains LANG on its own line" "$(<"$root/etc/locale.conf")"
|
||||
: >"$root/etc/locale.conf"
|
||||
omarchy-language en >/dev/null
|
||||
[[ $(<"$root/etc/locale.conf") == "LANG=en_US.UTF-8" ]] || fail "an empty locale.conf gains LANG" "$(<"$root/etc/locale.conf")"
|
||||
pass "a locale.conf without LANG gains one on its own line"
|
||||
|
||||
printf 'LANG="zh_CN.UTF-8"\n' >"$root/etc/locale.conf"
|
||||
[[ $(omarchy-language) == "zh_CN.UTF-8" ]] || fail "a double-quoted LANG reads unquoted" "$(omarchy-language)"
|
||||
printf "LANG='en_US.UTF-8'\n" >"$root/etc/locale.conf"
|
||||
[[ $(omarchy-language) == "en_US.UTF-8" ]] || fail "a single-quoted LANG reads unquoted" "$(omarchy-language)"
|
||||
printf 'LC_TIME=en_DK.UTF-8\n' >"$root/etc/locale.conf"
|
||||
[[ -z $(LANG=de_DE.UTF-8 omarchy-language) ]] || fail "a locale.conf without LANG reads empty, not the caller's LANG"
|
||||
pass "omarchy-language reads quoted values and ignores the caller's LANG"
|
||||
|
||||
before=$(<"$root/etc/locale.conf")
|
||||
if output=$(omarchy-language fr 2>&1); then
|
||||
|
||||
Reference in new issue
Block a user