Apple iOS Localization

Lingohub supports iOS .strings files for translation of 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 in the other 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 either written directly in a quoted string or escaped by using “\n”.

  • Double quotes have to be escaped using “\””.

  • 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 translations descriptions and may include qualitychecks information.

  • The recommended character encoding for these files is UTF-16LE. But 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 to have any locale information in the filename (a typical name is Localizable.strings). The locale information can be found in the path. For that reason we always recommend to use our SCM integration to synchronize your repository with Lingohub. Otherwise, you always have to specify the language in an additional 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 source language of the project.

Generic keys

The most seen approach how .strings files are used is to have your source language content as key. As Lingohub offers support to manage Android and iOS resources in a single project, we always recommend to use the same “generic keys” in both – the .strings files and the Android resource files.

References

Last updated