how to localize iOS 8 today extensions widget and also the widget name
Asked Answered
E

2

12

I can't understand how I can localize today extensions, I want to create the Localize.strings file like a normal xcode project that for example have this string:

.en
    "Apple" = "Apple"

.it
    "Apple" = "Mela"

and I also want to know how I can localize the iOS 8 Today Extensions widget name.

I have tried to create a Strings File in Xcode, and I have tried to insert this:

"CFBundleDisplayName" = "App Name";

but the name doesn't change...

Expeditionary answered 28/9, 2014 at 23:51 Comment(0)
R
21

Add LSHasLocalizedDisplayName = YES to Info.plist file and add your localizations to InfoPlist.strings which you have to place under the language.proj folder per languages, for example de.lproj for German versions.

Before testing: - Clean the project - Remove the application from the simulator. - Add language.proj folder references to extension's Supporting files part - to include them inside Copy bundle resources section in Build Phases of your extension target.

Rowles answered 29/9, 2014 at 9:44 Comment(6)
thanks for your answer, and where i have to insert the localized name?Expeditionary
thanks, and the file InfoPlist.strings where is? i have to create it?Expeditionary
jp.lproj, fr.lproj, it.lproj ... foldersRowles
Remove the application from simulator and clean the project before trying.Rowles
i have do all, now the name of the widget change, but the NSLocalizedString(@"Apple", @"") for example doesn't change, in the InfoPlist.strings i have add this: "Apple" = "Apple" in the .en and this for example "Apple" = "Mela" in the .it but only the CFBundleDisplayName works...any suggestion?Expeditionary
InfoPlist.strings file is only for values in Info.plist. Try Localizable.strings for othersRowles
B
2

For strings in your containing app and Today Widget can share the same localization files. You can simply select Localizable.string, and in the File inspector check your today widget target in Target Membership. Then all your NSLocalizedString in the today widget share the same one with the containing localization strings.

For the today widget application name, then just add an InfoPlist.strings file, and

"CFBundleDisplayName" = "Translated Name";
"CFBundleName" = "Translated Name";

Just run your containing app for testing.

Bodily answered 22/10, 2019 at 14:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.