Apple iOS
Lingohub supports iOS .strings
files for translating your iOS and Mac applications.
Lingohub offers a tight coupling between Apple iOS and Android projects to speed up your multi-mobile development. You must create one of these projects and export the translated resource files to another format.
Format
- Key-value pairs are delimited with the equal character
=
and terminated by a semicolon;
.
The key and the value have to be quoted. - Newlines can be written directly in a quoted string or escaped using
\n
- Double quotes have to be escaped using the
\”
. - Single-line comments start with
//
. - Multi-line comments are surrounded by
/_ … _/
. - On export, single-line comments are exported using single-line syntax, and multi-line comments using multi-line syntax.
- Information about placeholders can be found here: String Format Specifiers
- Lingohub will assign a comment to the next key-value pair. These comments will be used as segment descriptions.
- The recommended character encoding for these files is UTF-16LE. However, Lingohub allows you to use other common encodings.
Example
Additional example files can be accessed here.
// this comment will be parsed as header comment
"In a typical strings file the key is the text of the target language"="the value holds the translated text";
// an alternative is to use generic keys
"page.main.title"="Titel der Hauptseite";
/* comments in .strings files
can be multi line,
single line */
// or combination of the two
"hello_user" = "Hello %1$s";
// keys and values can be spread to multiple lines
"welcome.message" = "Welcome back,
we have missed you";
// comments belong to the next key value pair
"visit.count" = "this is your %1$d visit to our site";
To consider
Locale information
In your Xcode project, the file does not need any locale information in the filename (a typical name is Localizable.strings
). The locale information can be found in the path.
Therefore, we always recommend using our SCM integration to synchronize your repository with Lingohub.
Otherwise, you must always specify the language in another step while importing this file.
For Xcode projects, you can use Base.lproj
in your path as locale information. If Lingohub detects this information (and no other locale is given in the path), it will associate these files with the project's source language.
Generic keys
The most common approach to using .strings files is to use the source language content as the key.
As Lingohub offers support to manage Android and iOS resources in a single project, we always recommend using the same “generic keys” in both – the .strings files and the Android resource files.
References
Updated 3 days ago