File tree Expand file tree Collapse file tree
remove-json-keys/src/remove_json_keys/lib
translate-messages/src/translate_messages/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,13 +66,9 @@ def get_msgs(cli: sn, lang_code: str = 'en') -> sn:
6666 Path (__file__ ).parent .parent / 'data/_locales/en/messages.json' ))
6767
6868 if not lang_code .startswith ('en' ): # fetch non-English msgs from jsDelivr
69- try : # check if terminal supports non-Latin scripts
70- import non_latin_locales
71- if lang_code .split ('_' )[0 ] in non_latin_locales and not env .can_render_non_latin_scripts (): # type: ignore
72- return sn (** msgs ) # en ones
73- except Exception as err :
74- log .debug (f'Failed to fetch non-Latin locales: { err } ' )
75-
69+ import non_latin_locales
70+ if lang_code .split ('_' )[0 ] in non_latin_locales and not env .can_render_non_latin_scripts (): # type: ignore
71+ return sn (** msgs ) # EN ones cuz non-Latin not supported
7672 msg_base_url = f'{ jsdelivr .create_commit_url (cli , cli .commit_hashes .locales )} /src/remove_json_keys/data/_locales'
7773 msg_url = f'{ msg_base_url } /{ lang_code } /messages.json'
7874 for attempt in range (3 ):
Original file line number Diff line number Diff line change @@ -98,13 +98,9 @@ def get_msgs(cli: sn, lang_code: str = 'en') -> sn:
9898 Path (__file__ ).parent .parent / 'data/_locales/en/messages.json' ))
9999
100100 if not lang_code .startswith ('en' ): # fetch non-English msgs from jsDelivr
101- try : # check if terminal supports non-Latin scripts
102- import non_latin_locales
103- if lang_code .split ('_' )[0 ] in non_latin_locales and not env .can_render_non_latin_scripts (): # type: ignore
104- return sn (** msgs ) # en ones
105- except Exception as err :
106- log .debug (f'Failed to fetch non-Latin locales: { err } ' )
107-
101+ import non_latin_locales
102+ if lang_code .split ('_' )[0 ] in non_latin_locales and not env .can_render_non_latin_scripts (): # type: ignore
103+ return sn (** msgs ) # EN ones cuz non-Latin not supported
108104 msg_base_url = f'{ jsdelivr .create_commit_url (cli , cli .commit_hashes .locales )} /src/translate_messages/data/_locales'
109105 msg_url = f'{ msg_base_url } /{ lang_code } /messages.json'
110106 for attempt in range (3 ):
You can’t perform that action at this time.
0 commit comments