Table of Contents
.strings files are used for localizing macOS and iOS apps.
Associated file extensions: .strings
i18n type: STRINGS, STRINGS_UTF8
Encoding: UTF-16, UTF-8
Transifex supports two Apple Strings parsers:
Apple Strings File (UTF-16 encoding) (.strings)
Apple Strings File (UTF-8 encoding) (.strings)
When you upload an Apple Strings file to Transifex, be sure to select the one with the desired encoding.
Sample Data
/* registration information: Username */ "username" = "Username:"; /* registration information: Password */ "password" = "Password:"; /* registration information: Email Address */ "email_address" = "Email Address:"; /* registration information: User Role */ "user_role" = "User Role"; /* registration information: Phone */ "phone" = "Phone"; /* registration information: Country */ "country" = "Country";
Each key-value pair enclosed in double quotation marks corresponds to a string entry.
Keys are on the left side of the equal sign and considered the identifiers of the strings. This information is the one that our parser takes into account in order to parse the strings as unique entries. The key of the entry is available in Transifex Web Interface under the context tab in the editor
Values are on the right side of the equal sign and handled as the translatable text. This is the text that the translator will see in the editor and translate it into other languages.
Transifex also supports developer notes that a translator can see under the context tab in the editor. Such comments are enclosed inside C-style comment delimiters (/* and */) and are placed immediately before the entry they refer to as it is shown in the sample above.
Plural Support
Below, there are some illustrative examples based on the language plural rules that CLDR standards provide:
English file:
"time_minutes##{one}" = "%@ minute"; "time_minutes##{other}" = "%@ minutes"; "result##{one}" = "%@ Result"; "result##{other}" = "%@ Results";
Arabic file:
"time_minutes##{zero}" = "%@ دقيقة"; "time_minutes##{one}" = "%@ دقيقة"; "time_minutes##{two}" = "%@ دقيقة"; "time_minutes##{few}" = "%@ دقيقة"; "time_minutes##{many}" = "%@ دقيقة"; "time_minutes##{other}" = "%@ دقيقة"; "result##{zero}" = "%@ النتائج"; "result##{one}" = "%@ النتيجة"; "result##{two}" = "%@ النتائج"; "result##{few}" = "%@ النتائج"; "result##{many}" = "%@ النتائج"; "result##{other}" = "%@ النتائج";
Note
Do you want to find out more about plurals in Transifex? Please check here.
Entries with identical keys
In case you have a .strings file where more than one entries have the same key/identifier, then:
Our parser will parse the first instance and ignore any other entries for which the same key has been provided. This means that in the editor, the translator will see only the entry that was parsed first.
After the translation process is completed and the translation file is requested, all the entries will be included in the file and the ones that were ignored during parsing will be translated accordingly upon export.
Download Options
translator:
translated, reviewed, proofread strings are returned with the corresponding translations
untranslated strings are filled in with the source text but commented out
onlytranslated:
untranslated strings are returned empty
translated, reviewed, proofread strings are returned with the corresponding translations
onlyreviewed:
reviewed and proofread strings are returned with the corresponding translations
translated and untranslated strings are returned empty
onlyproofread:
proofread strings are returned with the corresponding translations
the rest are returned empty
sourceastranslation:
translated, reviewed, proofread strings are returned with the corresponding translations
untranslated strings are returned in the source language
default:
translated, reviewed, proofread strings are returned with the corresponding translations
untranslated strings are returned in the source language
reviewed:
reviewed and proofread strings are returned with the corresponding translations
untranslated and translated strings are returned in the source language
proofread:
proofread strings are returned with the corresponding translations
reviewed, translated, and untranslated strings are returned in the source language
untranslated:
translated, reviewed, proofread strings are returned with the corresponding translations
untranslated strings are returned in the source language
Lin
Lin is a useful helper tool that offers auto-completion in XCode for NSLocalizedString
. Check out the GitHub repo.
Read more
Continue Reading