Skip to content

Commit d3e2e0e

Browse files
author
Tong Li
committed
Fix 'an unknown error has occurred' issue when selecting languages using non-latin characters
Now when kdump_anaconda_addon is enabled and languages which use non-latin characters are selected in anaconda, e.g. Chinese and Japanese, it will raise an error and unable to continue to finish the installation process. This is because 'gettext.ldgettext' will return a byte object when translation includes non-latin character, while anaconda's core code requires a string. To fix this, we apply the mothod used by pyanaconda, which is invoking gettext after getting a translation instance. This can make sure that a str object will be returned.
1 parent 3562114 commit d3e2e0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

com_redhat_kdump/i18n.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323

2424
import gettext
2525

26-
_ = lambda x: gettext.ldgettext("kdump-anaconda-addon", x)
26+
_ = lambda x: gettext.translation("kdump-anaconda-addon", fallback=True).gettext(x) if x != "" else ""
2727
N_ = lambda x: x

0 commit comments

Comments
 (0)