Skip to content

Commit

Permalink
This workaround is purpose for potential eula crash if switch languag…
Browse files Browse the repository at this point in the history
…e in language page during OOBE stage.

    The language page only show one language and flash quickly to EULA page.
    In addition, another script will put os-post directory, which will delete other language based on locale.
  • Loading branch information
langtaibai committed Apr 24, 2024
1 parent 4e15a3e commit 7da9b81
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit 7da9b81

Please sign in to comment.