MapboxGeocoder.swift
MapboxGeocoder.swift copied to clipboard
GeocodeOptions.locale loses script and country codes
GeocodeOptions only passes along the bare language code to the Geocoding API. For example, even if the system locale is Traditional Chinese (Hong Kong) and the developer sets the locale
property to Locale.current
, the language
query parameter ends up being zh
instead of zh-Hant-HK
. GeocodeOptions should pass along the entire locale identifier; it would be API’s responsibility to strip any components it doesn’t need or understand.
/cc @apendleton
Sounds good. Subtags will definitely improve results in Chinese in particular, and probably also in a couple of other languages where more than one script is used.