mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 10:57:58 +00:00
Locales and localization refactor with Locales as a localizer object.
Removed auto-localization from search/search_address APIs (now explicit), simplified AddressLines to subclass List[AddressLine], made display_name a computed property in Results instead of field and removed result-localization circular dependencies
This commit is contained in:
@@ -102,11 +102,10 @@ def test_format_reverse_with_address(fmt):
|
||||
rank_address=10,
|
||||
distance=0.0)
|
||||
]))
|
||||
reverse.localize(napi.Locales())
|
||||
napi.Locales().localize_results([reverse])
|
||||
|
||||
raw = v1_format.format_result(napi.ReverseResults([reverse]), fmt,
|
||||
{'addressdetails': True})
|
||||
|
||||
if fmt == 'xml':
|
||||
root = ET.fromstring(raw)
|
||||
assert root.find('addressparts').find('county').text == 'Hello'
|
||||
@@ -165,7 +164,7 @@ def test_format_reverse_geocodejson_special_parts():
|
||||
distance=0.0)
|
||||
]))
|
||||
|
||||
reverse.localize(napi.Locales())
|
||||
napi.Locales().localize_results([reverse])
|
||||
|
||||
raw = v1_format.format_result(napi.ReverseResults([reverse]), 'geocodejson',
|
||||
{'addressdetails': True})
|
||||
|
||||
Reference in New Issue
Block a user