Click here to return to the 'Set the language for a single application' hint |
Base.lproj
and other language-specific folders with the .lproj
extension. The prefix for the language folders is the language ID, as described in Language and Locale IDs.Base.lproj
folder contains all the .storyboard
or .xib
files in the development language. The folders for languages that you add to your project contain a strings file for each .storyboard
or .xib
file in your project. The development language folder doesn’t contain strings files for the .storyboard
and .xib
files because they don’t require translation in the development language. All the language folders contain a InfoPlist.strings
file used to localize bundle properties, such as the app name. Any other localized resources—such as strings files that you generate and use from your code—appear in these language folders.Base.lproj
folder contains Main_iPad.storyboard
and Main.iPhone.storyboard
, and the en.lproj
folder contains InfoPlist.strings
. If you add the German language, Xcode creates a de.lproj
folder containing a InfoPlist.strings
, Main_iPad.strings
, and Main_iPhone.strings
file. The files in the de.lproj
folder contain placeholder text that needs to be translated to German.NSLocalizedString
macros, as described in Separating User-Facing Text from Your Code, you can create and localize the corresponding strings files.genstrings
script to create the development language version of the Localizable.strings
file. cd [Project folder]
find . -name *.m | xargs genstrings -o .
NSLocalizedString
macro in the source files, the script adds the comment followed by the key-value pair (using placeholder text for the value) to the Localizable.strings
file, as in:NSLocalizedString
macro in your code, the value for the key defaults to the key. If you want different behavior, use one of the other NSLocalizedString
macros that take more parameters, described in Foundation Functions Reference.Localizable.strings
file to all the language folders.Localizable.strings
to the Base localization when the dialog appears.Localizable.strings
file appears to be Unicode (UtF-16), you can convert it to Unicode (UTF-8) using the File inspector. To convert a file to UTF-8, select the file in the project navigator and open the File inspector. In the Text Settings section, choose Unicode (UTF-8) from the Text Encoding pop-up menu. In the dialog that appears, click Convert.Localizable.strings
file in each language folder. en.lproj/Localizable.strings
file, enter the English translation for the RunningDistance
key:ja.lproj/Localizable.strings
file, enter the Japanese translation for the RunningDistance
key:.storyboard
or .xib
file to the corresponding strings file. Xcode inserts a comment before each key-value pair that identifies the view that displays the text. For example, in this fragment of a strings file, the column header Location
and the text field labels Address:
and for:
require translation. Lame encoder mixxx.genstrings
script also searches your code for user-facing text and adds it to a strings file, as described in Separating User-Facing Text from Your Code. The file format is the same except your code provides the comment for translators. To localize a strings file, instruct translators to replace the placeholder text—that appears to the right of the equal sign below the comment—with localized text.AppleGlot.dmg
file and double-click AppleGlot.pkg
.mkdir [MyAppleGlotEnvironment]
cd [MyAppleGlotEnvironment]
appleglot -w create .
appleglot -w setlangs [base_language_id] [target_langauge_id]
en
for the base_language_id
and ru
for target_langauge_id
._NewBase
folder.[target_language_id].lproj
, into the _NewBase
folder, and change the name of the folder to [base_language_id].lproj
. For example, paste ru.lproj
into _NewBase
, and change the name to en.lproj
.[base_language_id].lproj
folder should contain all the strings files that you want translated into the target language. .lg
extension) into the _LanguageGlossaries
folder._NewLoc
folder.appleglot -w populate
Best free protection software for mac..ad
file in the _ApplicationDictionaries
folder with previously translated strings and a .wg
file in the _WorkGlossary
folder that contains all the strings in your project with as much of the translations from your Language Glossaries as possible.ad
and wg
extensions using a third-party localization tool that supports these file formats.appleglot -w update
appleglot -w finalize
_NewLoc/[base_language_id].lproj
folder into your [target_language_id].lproj
folder in the Xcode project folder. For example, paste the contents of the _NewLoc/en.lproj
folder into the ru.lproj
folder if the target language is Russian.AppleGlot.dmg
file..storyboard
or .xib
files, use the ibtool
command to generate new strings files. Use another tool—for example, FileMerge—to identify the changes and merge them into the existing strings files for each language you support. Xcode doesn’t automatically update the corresponding strings files when you edit a .storyboard
or .xib
file. Base.lproj
folder, and run this command to generate a strings file for an xib file:ibtool [MyNib].xib --generate-strings-file [MyNib_new.strings]
lproj
folder. To launch FileMerge from Xcode, choose Xcode > Open Developer Tool > FileMerge.ibtool
command to merge translations back into a nib file and perform other incremental localization updates, as described in the ibtool
man page. Or use the appleglot
command to manage changes to the strings files, as described in Importing Localizations.