How hard is it to translate Lix into another language?

Started by lemming_1, January 19, 2015, 11:03:21 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Simon

Further questions before releasing:

How should a translator begin his work? To generate translations_dump.txt, the translator must select the custom language. But he cannot select it in the options unless a translate.txt exists, which he hasn't made yet. (File doesn't exist -> options dialogue forces the button back to English)

Once we know the translator's workflow, I'll write the documentation for this.

Now, I filename-escape anything except A-Z a-z 0-9. In particular, dash, space, single-quote are escaped, too. I've written a fallback for loading the user config: Try loading from escaped filename, if not exist, try loading from completely unescaped filename. Always save to the escaped filename. Reasoning: I need a fallback loader anyway for a robust upgrade, and now the escaping rule is super simple.

-- Simon

ccexplore

Quote from: Simon on April 08, 2015, 03:14:44 AMFurther questions before releasing:

How should a translator begin his work? To generate translations_dump.txt, the translator must select the custom language. But he cannot select it in the options unless a translate.txt exists, which he hasn't made yet. (File doesn't exist -> options dialogue forces the button back to English)

Once we know the translator's workflow, I'll write the documentation for this.

Just create an empty translations_dump.txt file outside of Lix (or put anything in it, it'll get overwritten).  Lix decides to write or not write to the file based solely on the file's existence.  The currently selected language determines what gets written to it.  So translations_dump.txt will end up with the English text initially if the user initially selected English as the language, for example.

It was done this way in lieu of a command line switch or similar (which would've normally been a more sensible option) as this method seems most amenable to both scripting as well as for users who cannot deal with anything other than through UI, while avoiding having to create new UI in Lix just for it.  Feel free to supplement with other methods though.

And yes, documentation was of course meant to be part of this effort as well, good reminder.

Simon

April 2015: Lix supports other languages now. Read the first post in this topic for instructions.

Touch dumpfile manually, then run Lix: It's a good approach for C++ Lix. In D Lix, I'd like to have even the builtin languages as such files, so people can copy a file and hack.

The first variable for the language name is now main_name_of_language, this is d'accord with the other "main" variable names, and I'd like to use it in D Lix later.

Dump target file: data/translate_dump.txt
Translations file: data/translate.txt

Documentation has been written to doc/transl.txt.

I've pushed to github all of these changes, and the documentation in the mentioned file. I encourage you to fetch them and examine, maybe suggest renamings/movements of files. Otherwise we're good to go. :-)

-- Simon

P.S. I didn't realize before the C++ pattern to conjure local functions with local
class { public: T operator () { ... } } functionname,
so I've learned something again. :-)