Fix bug which prevents certain languages from being loaded
https://forum.manjaro.org/t/start-work-on-a-new-welcome-screen-manjaro-hello/13685/281?u=hulutimerge-requests/64/head
parent
f13331f86a
commit
37213d55f8
|
@ -5,8 +5,9 @@ rm -rf locale
|
||||||
mkdir locale
|
mkdir locale
|
||||||
cd po
|
cd po
|
||||||
for lang in $(ls *.po); do
|
for lang in $(ls *.po); do
|
||||||
mkdir -p ../locale/${lang::-3}/LC_MESSAGES
|
lang=${lang::-3}
|
||||||
msgfmt -c -o ../locale/${lang::-3}/LC_MESSAGES/manjaro-hello.mo $lang
|
mkdir -p ../locale/${lang//_/-}/LC_MESSAGES
|
||||||
|
msgfmt -c -o ../locale/${lang//_/-}/LC_MESSAGES/manjaro-hello.mo $lang.po
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
python src/manjaro_hello.py
|
python src/manjaro_hello.py
|
||||||
|
|
|
@ -126,6 +126,8 @@ class ManjaroHello():
|
||||||
:param locale: locale to use
|
:param locale: locale to use
|
||||||
:type locale: str
|
:type locale: str
|
||||||
"""
|
"""
|
||||||
|
if "_" in locale:
|
||||||
|
locale = locale.replace("_", "-")
|
||||||
try:
|
try:
|
||||||
tr = gettext.translation(self.app, self.locale_path, [locale], fallback=True)
|
tr = gettext.translation(self.app, self.locale_path, [locale], fallback=True)
|
||||||
tr.install()
|
tr.install()
|
||||||
|
|
Loading…
Reference in New Issue