Choose your operating system:
Windows
macOS
Linux
There may be situations where you want to deploy your iOS project with different languages. If you are localizing your iOS project, you must identify and translate any strings in your code. This is a requirement for submitting your iOS app. In this How-To, you will learn how to create files that translate strings in your code.
Steps
-
Create a folder for each language in the
{UEProjectDir}/Build/IOS/Resources/Localization/
directory. Name each folder{LanguageCode}.lproj
. For example,EN.lproj
, whereEN
is the language code for English;FR.lproj
, whereFR
is the language code for French;JA.lproj
, whereJA
is the language code for Japanese, and so on.The language codes used here are the two character codes used in the ISO 639-2 standard .
-
In each language folder, create a text file named
InfoPlist.strings
. TheInfoPlist.strings
file translates all strings in theinfo.plist
file of your iOS project. -
In each language folder, create a text file named
Localizable.strings
. TheLocalizable.strings
file translates all strings in all the code files of your iOS project.
For example, for an application named "Lovely Game" your object-c code contains the following lines:
NSString* allRightText = NSLocalizedString(@"All right", @"All right");
NSString* cancelText = NSLocalizedString(@"Cancel", @"Cancel");
The following table shows some examples of how you modify the
InfoPlist.strings
file and
Localizable.strings
file for various languages.
Language |
InfoPlist.strings File Code |
Localizable.strings File Code |
---|---|---|
English |
|
|
Chinese |
|
|
French |
|
|
End Result
The
[UEProjectDir]/Build/IOS/Resources/Localization/
folder, created using this How-To, is copied when the Unreal Engine packages your project to create an
.IPA
file. Your packaged iOS project will have all strings translated, and so your iOS project will be ready to submit to Apple.