Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for Eula crash if switch language in language page during OOBE stage. #192

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ubiquity/dell-bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,15 @@ def explode_sdr(self):
#if the destination is somewhere special, change the language
if dest:
self.preseed('dell-recovery/destination', dest)
if dest == 'CN':
self.preseed('debian-installer/locale', 'zh_CN.UTF-8')
self.ui.controller.translate('zh_CN.UTF-8')

# The code helps solving eula crash when switch language in OOBE.(low fail rate)
#The dict key is dest in SDR, the value is corresponding language in ubiquity languagelist.
dest_lang_map = {"CN": "zh_CN", "TW": "zh_TW", "BR": "pt_BR", "CZ": "cs_CZ", "JP": "ja_JP", "KR": "ko_KR", "EG": "ar_EG", "DK": "da_DK", \
"NL": "nl_NL", "NO": "nb_NO", "FI": "fi_FI", "FR": 'fr_FR', "DE": "de_DE", "GR": "el_GR", "IL": "he_IL", "HU": "hu_HU", "IT": "it_IT", \
"PL": "pl_PL", "PT": "pt_PT", "RO": "ro_RO", "RU": "ru_RU", "SK": "sk_SK", "SI": "sl_SI", "ES": "es_ES", "SE": "sv_SE", "TR": "tr_TR", "UA": "uk_UA"}
if dest in dest_lang_map:
self.preseed('debian-installer/locale', '{}.UTF-8'.format(dest_lang_map[dest]))
self.ui.controller.translate('{}.UTF-8'.format(dest_lang_map[dest]))

def usb_boot_preseeds(self, more_keys=None):
"""Sets/unsets preseeds that are common to a USB boot scenario.
Expand Down
Loading