From 5377a831ab07e85dca55e5c59af8f5915c373647 Mon Sep 17 00:00:00 2001 From: Al Date: Tue, 24 May 2016 19:49:08 -0400 Subject: [PATCH] [fix] use simple language code if language_script cannot be found --- scripts/geodata/address_formatting/formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/geodata/address_formatting/formatter.py b/scripts/geodata/address_formatting/formatter.py index a0093a0c..d12a56a9 100644 --- a/scripts/geodata/address_formatting/formatter.py +++ b/scripts/geodata/address_formatting/formatter.py @@ -683,7 +683,7 @@ class AddressFormatter(object): def get_template_from_config(self, config, country, language=None): template = None 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 # based on which language is being used template = config.get('{}_{}'.format(country.upper(), language.lower()), None)