GPS:Return 国家名称但未翻译
GPS: Return country name but NOT translated
在我的函数中,我正在读取用户位置的数据:
public async void OnLocationChanged(Location location)
{
_currentLocation = location;
Address address = await ReverseGeocodeCurrentLocation();
Account.Instance.Locality = address.Locality;
Account.Instance.Country = address.CountryName;
Account.Instance.CountryCode = address.CountryCode;
}
但是地址和所有东西都是用德语返回的,因为我住在德国。但我需要它在全球范围内成为英语。有没有比进行 210 次字符串比较更好的方法?
谢谢:)
Geocoder geocoder = new Geocoder(Context, Locale.ENGLISH);
请参考this。
在我的函数中,我正在读取用户位置的数据:
public async void OnLocationChanged(Location location)
{
_currentLocation = location;
Address address = await ReverseGeocodeCurrentLocation();
Account.Instance.Locality = address.Locality;
Account.Instance.Country = address.CountryName;
Account.Instance.CountryCode = address.CountryCode;
}
但是地址和所有东西都是用德语返回的,因为我住在德国。但我需要它在全球范围内成为英语。有没有比进行 210 次字符串比较更好的方法?
谢谢:)
Geocoder geocoder = new Geocoder(Context, Locale.ENGLISH);
请参考this。