[fix] use simple language code if language_script cannot be found
This commit is contained in:
@@ -683,7 +683,7 @@ class AddressFormatter(object):
|
|||||||
def get_template_from_config(self, config, country, language=None):
|
def get_template_from_config(self, config, country, language=None):
|
||||||
template = None
|
template = None
|
||||||
if language:
|
if language:
|
||||||
language = self.language_code_replacements.get(language, language)
|
language = self.language_code_replacements.get(language, language.split('_')[0])
|
||||||
# For countries like China and Japan where the country format varies
|
# For countries like China and Japan where the country format varies
|
||||||
# based on which language is being used
|
# based on which language is being used
|
||||||
template = config.get('{}_{}'.format(country.upper(), language.lower()), None)
|
template = config.get('{}_{}'.format(country.upper(), language.lower()), None)
|
||||||
|
|||||||
Reference in New Issue
Block a user