Bottles
Bottles copied to clipboard
[Bug]: zh_CN/zh_HK/zh_SG/zh_TW have been removed from LINGUAS, making the Chinese translation unusable
Describe the bug
-
zh_Hans
andzh_Hant
are not language codes actually used in Linux desktop. -
zh_CN
/zh_HK
/zh_SG
/zh_TW
are the language codes actually used in Linux desktop, whereCN
/SG
useHans
, andHK
/TW
useHant
. -
I created symlinks for them and added the actual used language code to
LINGUAS
, after this PR, the Chinese translation can be actually used: https://github.com/bottlesdevs/Bottles/pull/1515 -
But unfortunately, this commit was quickly overwritten by https://github.com/bottlesdevs/Bottles/commit/b91be850ced8f47de8df1506ae41e8e3f109e0b4,
zh_CN
/zh_HK
/zh_SG
/zh_TW
was removed fromLINGUAS
, and the Chinese translation is again unavailable to actual users.
To Reproduce
-
Switch to any Chinese locale.
-
Run Bottles.
-
Bottles are not loaded with Chinese translation.
-
Run this command:
env | grep LANG
You may get one of the following codes:
LANGUAGE=zh_CN LANGUAGE=zh_HK LANGUAGE=zh_SG LANGUAGE=zh_TW
You have no chance of getting the following code:
LANGUAGE=zh_Hans LANGUAGE=zh_Hant
-
Run this command:
cat /etc/locale.gen | grep zh
You will get:
#lzh_TW UTF-8 #zh_CN.GB18030 GB18030 #zh_CN.GBK GBK #zh_CN.UTF-8 UTF-8 #zh_CN GB2312 #zh_HK.UTF-8 UTF-8 #zh_HK BIG5-HKSCS #zh_SG.UTF-8 UTF-8 #zh_SG.GBK GBK #zh_SG GB2312 #zh_TW.EUC-TW EUC-TW #zh_TW.UTF-8 UTF-8 #zh_TW BIG5
And
zh_Hans
andzh_Hant
are not among them. -
Therefore, it is meaningless to keep only
zh_Hans
andzh_Hant
inLINGUAS
for actual Chinese users, we needzh_CN
/zh_HK
/zh_SG
/zh_TW
also in it.
Package
Flatpak from Flathub
Distribution
Arch linux
Health Check
Version: 2022.6.28-brescia
Display:
X.org: true
X.org (port): :99.0
Wayland: false
Graphics:
vendors:
nvidia: &id002
vendor: nvidia
envs:
__NV_PRIME_RENDER_OFFLOAD: '1'
__GLX_VENDOR_LIBRARY_NAME: nvidia
__VK_LAYER_NV_optimus: NVIDIA_only
icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json
amd: &id001
vendor: amd
envs:
DRI_PRIME: '1'
icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/radeon_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/radeon_icd.i686.json
prime:
integrated: *id001
discrete: *id002
Kernel:
Type: Linux
Version: 5.17.9-arch1-1
Distro:
Name: GNOME
Version: '"42 (Flatpak runtime)"'
Disk:
Total: 33444196352
Free: 33444040704
RAM:
MemTotal: 62.3GiB
MemAvailable: 57.8GiB
Tools:
cabextract: true
p7zip: true
patool: true
glibc_min: '2.33'
Bottles_envs: null
Display Protocol
X11
Display Backend used by Bottles
X11
Additional context
No response
If a bot made the following changes, its behavior may need to be corrected: https://github.com/bottlesdevs/Bottles/commit/b91be850ced8f47de8df1506ae41e8e3f109e0b4
Weblate keep breaking because of this. Since those are just symlinks, we should add them at build instead. I have to figure out how to do this. Currently adding them to the LINGUAS file will break every language due to weblate not handling the locales and only supports zh_Hans and zh_Hant
Consider using a wrapper script to modify environment variables at runtime:
#!/bin/sh
replace_lang() {
lang="${1/zh_CN/zh_Hans}"
lang="${lang/zh_SG/zh_Hans}"
lang="${lang/zh_HK/zh_Hant}"
lang="${lang/zh_TW/zh_Hant}"
echo "$lang"
}
export LANGUAGE="$(replace_lang "$LANGUAGE")"
export LANG="$(replace_lang "$LANG")"
exec real-bottles "$@"
Then you can undo my changes and remove those symlinks.
If environment variable substitution in python code is applicable, that's fine too.
Should be doable
should be fixed by 9b7164ae0b3811fa8cfb026558264c149d245d6b
Nvm, the problem is still there
@mirkobrombin I took a brief look at this repo and weblate repo, it seems that somewhere on weblate side you can choose a different language format.
See the fix at https://github.com/WeblateOrg/weblate/commit/2e9c2bb84da86f40c152aa15854593d383be9c6c And the discussion at https://github.com/WeblateOrg/weblate/issues/5522
I don't see those lang codes in weblate