Translating source code

From Pigmeo Development Wiki

Jump to: navigation, search

These are the instructions to translate Pigmeo to languages other than English.

Note: we call language string to a string (a sequence of characters) written in a given natural language (English, Spanish, French...), identified by an ID, which varies based on the current configured language for the running application.


Contents

Language files

First of all, get the latest sources.

Go to trunk/i18n and you'll see a bunch of files. Those with extension .lang are language files. They are named as AppName.Language.lang. AppName is the name of the application using those strings. Language is the two-letter code which identifies a language.

For example Spanish strings for Pigmeo compiler are stored within pigmeo-compiler.es.lang.

Each line represents a language string. It begins with an ID, followed by a white space, and the rest of the line is parsed as a language string.

i.e:

SomeID This is the text for the first ID
another_id some other language string
76534 IDs are one-word strings (without white spaces). You should only use ASCII alphanumeric characters (''abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_.,;:1234567890'').
ID56 You can also write language strings using any character supported by UTF-8, for example: áéèíóüñÑç
ID57  NOTE: some language strings begin with white spaces. Always keep the same amount of spaces as the original language (English)
ID58 Some {0} contains {1} formatting tokens. These tokens are replaced by a word, number, code or anything else. Try to understand what the sentence means and place those tokens wherever they should be placed, but '''don't miss anyone'''.


Getting a list of strings not translated yet

You can get a list of language strings not translated yet to you system language by running from the command line:

$> pigmeo --not-translated

You can also get a list of language strings not translated yet to any other language by running pigmeo using other language:

$> LC_ALL="es" pigmeo --not-translated

You'll get a list formatted as LangID: LangText.


Guidelines

  • Always use english as origin language
  • Keep the same order as the origin language
  • You must load and save .lang files as UTF-8.
  • You should only translate to a language you speak properly.


Translating

Personal tools