.lang files format

Francesco Lodolo edited this page May 12, 2017 · 6 revisions

Meta data

## active ## 

(optional) Valid only at the beginning of the file, it's used on Bedrock to determine if a localized page should be displayed or not.

## tag_name ##

(optional) Tags are used in conditional cycles on Bedrock to display content only when strings are ready. Tag actually used in the code will be tag_name, without hash characters.

## NOTE: file description

(optional) This is a file description. It's usually used to point localizers to a demo page or reference content.

Multiple file descriptions are allowed.

## URL: link to demo server

(optional) Link to a demo server. %LOCALE% can be used in the URL and will be replaced by the actual locale code.

Only one URL is allowed.

Strings

;String in English
Translated string

Reference string starts with a semicolon, and it's followed by the translated string. If translation needs to start with the # character, for example for Twitter messages, add a leading space before (it will be trimmed internally): #sometext.

A localizer can mark a string as translated, even if identical to English, by adding {ok} to the translation. Example:

;Browser
Browser {ok}

Note: checks are case insensitive, therefore these strings are equivalent, even if lowercase is preferable.

Browser {ok}
Browser {OK}
Browser{ok}
Browser{OK}

String meta data

A string can be preceded by meta data associated to the string.

## TAG: promo_test

This is a tag binding: it means that the following string it's associated to a specific tag. It's used to determine if a file is missing a tag (i.e. all associated strings are translated) or not.

Only one tag binding is allowed for each string.

## MAX_LENGTH: XXX

This is used to specify a maximum length for the string. Strings longer than the specified limit will be reported as error in views and JSON files.

The string's length will be determined stripping HTML tags. It's typically used for snippets, where the limit is 180 characters for desktop, 100 for mobile.

Only one meta data is allowed for each string.

# comment

Comment are used to give localizers context or explaining markup.

Multiple comments are allowed for each string.

Other

  • Line endings: UNIX style (LF) is preferred, but Windows (CRLF) is accepted.
  • Encoding: file must use UTF-8 encoding.
  • Standard line spacing between strings is 2 empty lines.

Example .lang file format:

## active ##
## promo_test ##
## NOTE: this is a test file


## TAG: promo_test
# just a test
;String in English
Translated string


;Another string
Another translated string


You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.