Choose your operating system:
Windows
macOS
Linux
Localization files can be added to Unreal Engine to identify and translate strings in an iOS projects code.
This document describes how to set up string translation through the creation of localization files and folders.
Developers are required to add localization files for at least one language prior to submitting their iOS project.
Steps
-
Create a Localizations folder in the Unreal Engine project directory (if one does not already exist) under the following path:
{UEProjectDir}/Build/IOS/Resources/Localizations/
. -
Navigate to the
Localizations
folder and create one folder per language. These folders must be named according to the following format:{LanguageCode}.lproj
. For example, an English language localization folder should be namedEN.lproj
, whereEN
is the language code for English.Localization folders must be named using the language's two-character code as listed in the ISO 639-2 standard .
-
In each language folder create a text file named
InfoPlist.strings
. This file is used to translate strings listed in theinfo.plist
file of your iOS project. -
In each language folder create a text file named
Localizable.strings
. This file is used to translate strings from all the code files of your iOS project.
For example, for an application named "Lovely Game", your Objective-C code could contain 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 newly-created Localizations folder will be copied any time Unreal Engine packages your iOS project.
Once packaged, your iOS project will have all of its strings translated and will be ready to submit to Apple.