mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
466 stars 131 forks source link

Android 10.9.1无法设置本地化语言。 #1830

Closed yanshanshu closed 1 year ago

yanshanshu commented 1 year ago

Environment

Observed behavior and steps to reproduce

使用Java代码,无法进行中文的设置,且import发现,10.9.1的包com.mapbox.maps.extension.localization.localizeLabels是报错的,说明没有这个包。 请问需要如何做才能通过Java代码设置地图的显示语言为中文?

Expected behavior

Notes / preliminary analysis

Additional links and references

ZiZasaurus commented 1 year ago

@yanshanshu 请看下面的示例,该示例演示了如何使用本地化插件将地图客户端本地化到使用 Style#localizeLabels(locale: Locale) 的特定语言环境。

https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/localization/LocalizationActivity.kt

yanshanshu commented 1 year ago

@yanshanshu请看下面的示例,该示例演示了如何使用本地化插件将地图客户端本地化到使用 Style#localizeLabels(locale: Locale) 的特定语言环境。

https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/localization/LocalizationActivity.kt

谢谢。已经通过创建kt文件,通过kotlin语言实现地图的汉化。原本想做的是通过Java语言,但是没有找到设置的方法。