mapbox / mapbox/mapbox-maps-ios
Unable to Change Map Language: localizeLabels(into:forLayerIds:) Method Not Working
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Environment
- Xcode version: Version 16.2 (16C5032a)
- iOS version: 18+
- Devices affected: All
- Maps SDK Version: 11.9.0
Observed behavior and steps to reproduce
localizeLabels(into:forLayerIds:) Method Not Working
Simplest example:
import UIKit
import Combine
import MapboxMaps
class ViewController: UIViewController {
private lazy var mapView = MapView(frame: .zero)
private var cancellables: Set<AnyCancellable> = []
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(mapView)
mapView.frame = view.bounds
preconditionFailure("Set your accessToken!")
MapboxOptions.accessToken = ""
mapView.mapboxMap.onMapLoaded.observe { [weak self] _ in
/// https://docs.mapbox.com/help/troubleshooting/change-language/#mapbox-maps-sdk-for-ios
try! self!.mapView.mapboxMap.localizeLabels(into: Locale(identifier: "ar"))
/// No effect
}
.store(in: &cancellables)
}
}
Expected behavior
Based on the documentation, I expect a change in language.
https://docs.mapbox.com/help/troubleshooting/change-language/#mapbox-maps-sdk-for-ios
Additional links and references
Demo project with bug https://github.com/Savva-Shuliatev/Mapbox-localization-bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior from the ViewController example, using MapView and mapboxMap.localizeLabels(into:forLayerIds:) after onMapLoaded. Compare the result with the linked change-language documentation and demo project; done means map labels visibly change to the requested Arabic locale.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- localization, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100