If you read NSLocalizedString in the Custom keyboard, they won't read the .string file.

Asked 2 years ago, Updated 2 years ago, 105 views

I have called NSLocalizedString in my custom keyboard code as follows, but they didn't read the appropriate Localized.string and I'm always having trouble with English.

data.append(NSLocalizedString("Notes", comment:"Event notes"))

It does not read the .string file in English, it simply appears to display the string of the NSLocalizedString argument ("Notes" as mentioned above).

We have added Base, English, and Japanese to Localized.string.

Localized.string Display
Localized.string
Localized.string options

Project Configuration Screen
Project settings

In addition, primaryLanguage in info.plist is set to mul, and the simulator and actual device languages are set to Japanese, and the region is set to Japanese.

Could you please advise me where I should check further?
Thank you for your cooperation.

ios localization i18n

2022-09-30 20:21

1 Answers

Self-solving.
You named it Localized.string, but if you don't name it Localizable.string, NSLocalizedString will have to specify a filename every time.


2022-09-30 20:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.