summaryrefslogtreecommitdiff
path: root/lang/README
blob: 9d0ec82525e5482705b7eca184dd402e6141aa70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
This is the Gitano language pack tree.  Files in here are installed into
Gitano's lang tree in the share directory.  These files form the basis of
Gitano's i18n approach and are lazily loaded into a Tongue codex.

Each language has to be parented properly.  For Gitano to do this, there must
be a file called `langname.parent` whose content is the name of the language to
act as the parent language.  If this file is absent, the following algorithm is
used:

1. If the language is called 'json' then it has no parent
2. If the language matches [^_]+_[^_+] then it is parented to the language
   of its prefix.  E.g. en_GB is parented to en.
3. Otherwise the language is assumed be parented to 'en' in order that every
   language will have translations of some kind. ('en' is the Gitano basic
   language)

This means that you only need special parenting for unusual languages such as
'en_PIRATE' which might inherit from 'en_GB' or 'en_CA' which might inherit
mostly from 'en_GB'.

Languages in this directory are then files whose names are of the form:

    langname.lua

These files are of the form:

    return {
        TOKENNAME = "expansionstring",
	ANOTHERTOKEN = "somemore strings",
    }

In addition, when loading plugins, Gitano will add (from the plugin tree)
pluginname_langname.lua to the list of files.  They should be of the same form
as the above.