Hello! This is an "ideas exchange" rather than a question -I'm explaining "how I do it" and I would like to know if someone came with a better idea.
After switching to version 5, I have noticed that I can have "included" files with code (the ones added via the "Tools-->Components" option).
I want to take advantage of this to write my programs in several languages, externalizing the strings much like it's usually done in Java with .properties and in many Linux programs with .po files.
What I'm doing is to put a subroutine called loadLang inside an additional code file (added via "Tools --> Components"). This subroutine contains just variable assignments, like:
...and then call this subroutine from App_Start. Of course I need to previously define all the language variables inside SUB Globals.
It's not a very elegant solution, especially because it only works at compilation time (to create executables for two different languages I have to compile for language 1, remove the additional file for language 1, add the file for language 2 instead, and compile again). That's why I throw this question to the forum:
Any better idea?
Thanks in advance!
_____
|!rs
After switching to version 5, I have noticed that I can have "included" files with code (the ones added via the "Tools-->Components" option).
I want to take advantage of this to write my programs in several languages, externalizing the strings much like it's usually done in Java with .properties and in many Linux programs with .po files.
What I'm doing is to put a subroutine called loadLang inside an additional code file (added via "Tools --> Components"). This subroutine contains just variable assignments, like:
B4X:
lang_Welcome="Welcome to my program!"
lang_SureQuit="Are you sure you want to quit?"
...and then call this subroutine from App_Start. Of course I need to previously define all the language variables inside SUB Globals.
It's not a very elegant solution, especially because it only works at compilation time (to create executables for two different languages I have to compile for language 1, remove the additional file for language 1, add the file for language 2 instead, and compile again). That's why I throw this question to the forum:
Any better idea?
Thanks in advance!
_____
|!rs