[Pas2js] i18n
Ulrich, Christian
christian.ulrich at tcsag.de
Fri Oct 26 08:30:30 CEST 2018
When pas2js would generate .res files we could use lazarus tools to generate .po file
Then an separate program or pas2js itself could generate separate .js files that replace .current with an new value.
Christian Ulrich
Teamleiter Prüfmittelbau
______________________________________________________________________
TCS TürControlSysteme AG Geschwister-Scholl-Str. 7 | D-39307 Genthin
Telefon +49 3933 8799-433 | Fax +49 3933 8799-84 | Mail christian.ulrich at tcsag.de | www.tcsag.de
Vorstand: Dipl.-Ing. (FH) Otto Duffner (Vorsitzender), Florian Herth
Aufsichtsrat: Dipl. El. Ing FH/ EMBA Jörg Stocker
Sitz der Gesellschaft: Genthin | HRB 3909 AG Stendal
-----Ursprüngliche Nachricht-----
Von: Pas2js [mailto:pas2js-bounces at lists.freepascal.org] Im Auftrag von Michael Van Canneyt
Gesendet: Donnerstag, 25. Oktober 2018 16:10
An: pas2js discussions
Betreff: Re: [Pas2js] i18n
On Tue, 23 Oct 2018, Ulrich, Christian wrote:
> Hi,
>
> Is there actually already an way to translate resourcestrings ?
> How should an translation be done at the moment ?
A resourcestring is a javascript object literal with 2 members.
"org" and "current". I think the names are self-describing :)
When getting a resourcestring value, The rtl will first check the "current"
value, and if it is empty, use the "org" value. The "org" value is created by the
compiler when it creates the compiled unit.
So, to translate, create a javascript file which does the following:
pas["yourunit"].$resourcestrings.YourResourcestring.current = "The Translated Value";
Where
"yourunit" is the name of a unit and YourResourcestring is the name of the resource string.
It should not be too difficult to create a program which extracts all
resourcestrings from a program and creates such a file, which you can then
translate. I will add it to my todo list.
Michael.
_______________________________________________
Pas2js maillist - Pas2js at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
More information about the Pas2js
mailing list