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...
Open your app project in Xcode and choose File > New > Target. From the Application Extension group, select Widget Extension, and then click Next. Enter the name of your extension. If the widget provides user-configurable properties, check the Include Configuration Intent checkbox.
Go to the File menu and choose New > File, then select Strings File from the list of file types and click Next. Give this file the name “Localizable. strings”, then click Create to open it for editing.
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.
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.
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