[openaddresses] abbreviate states as well in OpenAddresses when full version is specified

This commit is contained in:
Al
2016-12-20 17:24:06 -05:00
parent 1cba89a99b
commit cc4098fb05
2 changed files with 15 additions and 3 deletions

View File

@@ -436,6 +436,12 @@ class OpenAddressesFormatter(object):
if address_state:
components[AddressFormatter.STATE] = address_state
state = components.get(AddressFormatter.STATE)
if state:
state = self.components.abbreviated_state(state, country, language)
if state:
components[AddressFormatter.STATE] = state
# This is expensive, so only turn on for files that don't supply their own city names
# or for which those names are flawed
osm_components = []