Lingua

Sheet Structure for Lingua Localization Tool

The Lingua localization tool utilizes a structured Google Sheets document to manage and store localization keys and values for various languages and platforms. Here’s a detailed guide on how to structure the sheet.

Language Sheets

For every language you wish to support, create an individual sheet within the Google Sheets document. Name the sheet using the convention LanguageCode_LanguageName. For example:

Columns Structure

The sheet will have several columns to manage different aspects of localization:

Section

Identifier for referencing a group of keys

Key

A unique identifier for referencing translation values in the code.

Description

A brief description to help understand the context and usage of the localization key.

Value columns

These columns store the translation values for different plural cases, following the Unicode CLDR language plural rules. Below are the specific columns:

Section and Key Structure

To enhance the semantic organization of the localization keys, the Lingua tool supports the use of sections. Keys within the same section are grouped together, enabling a more intuitive and structured way to manage translations.

Sheet Columns

Usage in Code

When localization files are generated, the section and key are combined to create platform-specific references:

For iOS:

The format will be Lingua.Section.Key. Using the example values mentioned:

The reference in iOS will be Lingua.Welcome.message.

For Android:

The format will be R.string.section_key. Using the example values:

The reference in Android will be R.string.welcome_message.

String Format Specifiers

The Lingua localization tool uses iOS (Apple) format specifiers as the base for managing string replacements within localization keys. During the export process, these specifiers are automatically mapped to the corresponding iOS and Android platforms.

Usage

You can add string format specifiers directly in your Google Sheets document using the standard iOS format. The tool will take care of mapping them to each platform during the export process.

Here are the common iOS format specifiers used:

Examples

In these examples, %@ is used as a placeholder for the name of the user, a string value. During the export process, the iOS format specifier will remain the same for iOS and will be replaced with the appropriate Android placeholder.