diff --git a/scripts/geodata/openaddresses/formatter.py b/scripts/geodata/openaddresses/formatter.py index 763731e5..f69aac50 100644 --- a/scripts/geodata/openaddresses/formatter.py +++ b/scripts/geodata/openaddresses/formatter.py @@ -375,6 +375,11 @@ class OpenAddressesFormatter(object): components.pop(AddressFormatter.UNIT) unit = None + # CLDR country name + country_name = self.cldr_country_name(country, language, configs) + if country_name: + components[AddressFormatter.COUNTRY] = country_name + for component_key in AddressFormatter.BOUNDARY_COMPONENTS: component = components.get(component_key, None) if component is not None: @@ -382,11 +387,6 @@ class OpenAddressesFormatter(object): abbreviate_prob=abbreviate_toponym_prob) components[component_key] = component - # CLDR country name - country_name = self.cldr_country_name(country, language, configs) - if country_name: - components[AddressFormatter.COUNTRY] = country_name - # Any components specified to be added by the config (usually state) if add_components: for k, v in six.iteritems(add_components):