I would like the ChunkVNC to handle multiple languages. So, I wrote a script which makes it pretty simple. It reads the translated phrases from the *.lng files and places them in an associative array. Script contains a function that returns the translation for a given original phrase.
Here is an example.
1. original code:
Code: Select all
MsgBox(1,"Info","About" )
Code: Select all
MsgBox(1,_t("Info"),_t("About") )
In the case of InstantSupport situation is slightly more complicated. The script contains a FileInstall function which argument must be a literal string; it cannot be a variable or the result of a function call. So it is: argument looks like this - InstantSupport_Files\lang.lng. Before compiling InstantSupport, the Compiler reads Lang variable from InstantSupport_Files\chunkvnc.ini and it copies the right file from InstantSupport_lang directory to InstantSupport_Files\lang.lng file.
In summary:
1. there are two new files: \SRC\Aut2Exe\Include\Lang.au3 and \SRC\Aut2Exe\Include\AssocArray.au3. I'm an author of Lang.au3. AssocArray.au3 is written by David Nuttall "Nutster". I found this script on AutoIt forum,
2. ChunkViewer:
- file lang_XX.lng should be in \Bin dir
- chunkviewer.ini should contain a Lang=XX variable in [ChunkViewer] section
3. InstantSupport:
- file lang_XX.lng should be in \InstantSupport_lang
- chunkvnc.ini should contain a Lang=XX variable in [ChunkVNC] section
Archive below contains working implementation of my idea. It is based on version 3.1.
https://docs.google.com/leaf?id=0B3JFllMt1SOVMjU3MjRhYmYtYTI0OS00NmU4LWJjMmQtOTJmZmQxMjE5NjQx&hl=pl&authkey=CMWXt88L
I hope this will be useful to you.
matczar