I am having an issue with a grouped UITableView not getting localized in my settings controller since opening the project in Xcode 11 GM.
I use Localizable Strings and checked that all ObjectIds are correct. It worked in Xcode 10 and iOS 12 SDK. The weird things is that the localization works everywhere else in the app. It is just that one TableView.
Someone, any ideas? I even tried removing localization and adding it again.
Update: The issue seems to be fixed in Xcode 11.2
--
This is now acknowledged as an issue in the release notes for Xcode 11.1 GM.
UITableViewCell labels in storyboards and XIB files do not use localized string values from the strings file at runtime. (52839404)
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_1_release_notes/
I faced the same issue with Xcode 11 GM. In my case, localization strings for title UILabel in static UITableViewCell are not applied.
Here is my workaround;
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAt: indexPath)
if let label = cell.textLabel, let id = label.accessibilityIdentifier, id.count > 0 {
let key = id + ".text"
let localizedString = NSLocalizedString(key, tableName: "Main", comment: "")
if key != localizedString {
label.text = localizedString
}
}
return cell
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With