Lines Matching refs:locale
26 def get_locale_parts(locale): argument
28 parts = locale.split('_')
111 def pack_to_uint32(locale): argument
113 lang, _, region = get_locale_parts(locale)
133 for locale in sorted(likely_script_dict.keys()):
134 script = likely_script_dict[locale]
136 pack_to_uint32(locale),
138 locale.replace('_', '-'),
143 def pack_to_uint64(locale): argument
145 _, script, _ = get_locale_parts(locale)
146 return ((pack_to_uint32(locale) << 32) |
157 for locale in sorted(representative_locales):
159 pack_to_uint64(locale),
160 locale)
188 locale = os.path.splitext(os.path.basename(data_file))[0]
193 if locale in parent_dict:
195 assert parent_dict[locale] == parent
197 parent_dict[locale] = parent
198 elif locale.startswith('ar_') and 'default{"latn"}' in line:
203 parent_dict[locale] = 'ar_015'
207 def get_likely_script(locale, likely_script_dict): argument
210 if locale.count('_') == 2:
212 return locale.split('_')[1]
213 elif locale in likely_script_dict:
214 return likely_script_dict[locale]
216 language = locale.split('_')[0]
228 for locale in sorted(parent_dict.keys()):
229 parent = parent_dict[locale]
231 pack_to_uint32(locale),
233 locale.replace('_', '-'),
252 for locale, _ in parent_dict.items():
254 while locale in parent_dict:
255 locale = parent_dict[locale]
267 for locale in parent_dict:
268 parent = parent_dict[locale]
271 script = get_likely_script(locale, likely_script_dict)
272 script_organized_dict[script][locale] = parent_dict[locale]