Difference between revisions of "lexicon"
Line 61: | Line 61: | ||
</pre> | </pre> | ||
− | The item translation for each language is proposed on a single line, one | + | The item translation for each language is proposed on a single line, one per language as designated by its two letter code. |
Some languages offer multiple translations for a single item: | Some languages offer multiple translations for a single item: | ||
Line 79: | Line 79: | ||
</pre> | </pre> | ||
− | GeneWeb is also capable of handling [[Declension/fr|declensions]]as in: | + | GeneWeb is also capable of handling [[Declension/fr|declensions]] as in: |
<pre> | <pre> | ||
parents | parents | ||
Line 87: | Line 87: | ||
Translations may contain basic HTML code for text formatting. This may be necessary for high quality typography of cardinal numbering: | Translations may contain basic HTML code for text formatting. This may be necessary for high quality typography of cardinal numbering: | ||
− | (n<sup>ième</sup>/1<sup>er</sup>/2<sup>e</sup>/3<sup>e</sup>/4<sup>e</sup>/…) | + | (n<sup>ième</sup>/1<sup>er</sup>/2<sup>e</sup>/3<sup>e</sup>/4<sup>e</sup>/…): |
<pre> | <pre> | ||
nth | nth | ||
Line 95: | Line 95: | ||
== Using the lexicon== | == Using the lexicon== | ||
− | To ask for a translation, it is sufficient to include the item between brackets: {{c|[item]}}. It will be translated into the current language. If the | + | To ask for a translation, it is sufficient to include the item between brackets: {{c|[item]}}. It will be translated into the current language. If the translation is not available, the bracketed form will appear instead. |
It is possible to the "upper case" the first letter (GeneWeb will determine if this is appropriate according to the position in the sentence) by putting a {{c||*}} after the opening bracket. For instance, in french, {{c|[*3rd cousins]}} will translate into {{c|Cousins issus d’issus de germains}} | It is possible to the "upper case" the first letter (GeneWeb will determine if this is appropriate according to the position in the sentence) by putting a {{c||*}} after the opening bracket. For instance, in french, {{c|[*3rd cousins]}} will translate into {{c|Cousins issus d’issus de germains}} | ||
Line 105: | Line 105: | ||
− | [[Category: | + | [[Category:Manual]] |
Revision as of 18:03, 31 October 2015
Language: | English • français |
---|
GeneWeb performs text translations according to rules contained in a file called lex-utf8.txt
and start_utf8.txt
in the folder gw/lang
of your installation. The seconfd file contains text specific to the welcome page.
These files are encoded according to UTF-8, and it is important to maintain this encoding had you decided to edit their content.
GeneWeb versions 5 and before were using the file lexicon.txt
encoded in Latin-1.
The full lexicon can be displayed from the welcome page of your browser with the URL http://localhost:2317/mabase?m=LEX
, or a button to do so may be available as in Roglo [1].
Goodwill to expand GeneWeb translations capabilities is welcome!!
Language codes
The language of the user interface of GeneWeb is selectable from the welcome page, or can be changed at any time by adding the lang=xx
text in the URL, where xx
is the two letter code (ISO 639-1 ) of the language of your choice.
af=afrikaans bg=bulgarian br=breton ca=catalan cs=czech da=danish de=german en=english eo=espéranto es=spanish et=estonian fi=finnish fr=french he=hébrew is=islandic it=italian lv=letton nl=dutch no=norvégian oc=occitan pl=polish pt=portugeese pt-br=brasil portugeese ro=roumanian ru=russian sl=sloven sv=sueedish zh=chineese
Note that if the command lang=
appears multiple times in the URL, only the first one will be taken into account.
Description of the lexicon
The lexicon is a text file which defined translation in several languages (hopefully all the ones supported by GeneWeb, but not necessarily) for terms that appear at the head of each translation item.
item l1: item translated in language 1 l2: item translated in language 2 item 2 l1: item t2 ranslated in language 1 ...
The item translation for each language is proposed on a single line, one per language as designated by its two letter code.
Some languages offer multiple translations for a single item:
(french revolution month) fr: vendémiaire/brumaire/frimaire/nivôse/pluviôse/ventôse/germinal/floréal/prairial/messidor/thermidor/fructidor/complémentaire son/daughter/child fr: fils/fille/enfant
The items may contain variables as in:
%d years ago fr: il y a %d ans
GeneWeb is also capable of handling declensions as in:
parents eo: gepatroj:a:+n pl: rodzice:a:-ów
Translations may contain basic HTML code for text formatting. This may be necessary for high quality typography of cardinal numbering: (nième/1er/2e/3e/4e/…):
nth fr: n<sup>ième</sup>/1<sup>er</sup>/2<sup>e</sup>/3<sup>e</sup>/4<sup>e</sup>/…
Using the lexicon
To ask for a translation, it is sufficient to include the item between brackets: [item]
. It will be translated into the current language. If the translation is not available, the bracketed form will appear instead.
It is possible to the "upper case" the first letter (GeneWeb will determine if this is appropriate according to the position in the sentence) by putting a after the opening bracket. For instance, in french,
[*3rd cousins]
will translate into Cousins issus d’issus de germains
To obtain the nth element of a list, add a number after the closing backet, starting at "0". For instance, the french republican month (0 to 12) will display (with {{{1}}}
) in the following fashion:
[(french revolution month)]2
translate intofrimaire
;[*(french revolution month)]12
translate intoComplémentaire
;[(french revolution month)]13
and[(french revolution month)]0
translate intovendémiaire
: If the index exceeds the limit, the first element is selected.