Hello,
it's quite often useful to output messages to the user in the language the user understand and use in every day conversation. Developers of rexx scripts often don't think about writing for more one language and therefore write text right into the code thus making it difficult to understand for all users.
In rexx there are at least 2 ways to use translations, one is to use SysGetMessage together with a compiled message file. Another approach is to create a plain text message and parse the contents. The example provided show how to use a text file with more or less static messages.
/* Read settings from a file */
my_global_variable = 'Loading message file... One moment please!'
infile = 'MyApp_'||value( 'LANG',, 'ENVIRONMENT' )||'.nls'
do while lines( infile ) > 0
interpret linein( infile )
end
call stream infile, 'C', 'CLOSE'
MyApp_en_US.nls
file.file = '~File'
file.new = '~New'
file.open = '~Open... Ctrl+O'
file.save = '~Save F2'
file.saveas = 'Save ~as...'
file.print = '~Print'
file.exit = '~Exit'
help.help = '~Help'
help.index = 'Help ~index'
help.general = '~General help'
help.using = '~Using keys'
help.keys = '~Keys help'
help.commands = '~Commands help'
help.quickref = '~Quick reference'
help.about = '~About...'
MyApp_sv_SE.nls
file.file = '~Fil'
file.new = '~Ny'
file.open = '~Öppna... Ctrl+O'
file.save = '~Spara F2'
file.saveas = 'Spar~a som...'
file.print = 'Skriv ~ut'
file.exit = '~Avsluta'
help.help = '~Hjälp'
help.index = 'Hjälp~index'
help.general = '~Generell hjälp'
help.using = '~Använda tangenter'
help.keys = '~Tangenthjälp'
help.commands = '~Kommandohjälp'
help.quickref = 'S~nabbrereferens'
help.about = '~Om...'
Recent efforts within the community has addressed the problem for compiled GUI/PM and VIO (text mode) applications with various formats and approaches. There's no unified way to translate applications that has been widely accepted even though some solutions have been brought forward. Translators have to adjust to the various ways and approaches that may vary quite a lot.
It should be possible to overcome, if "all" text resources are fed into a database in one format first, then translated. It would then be quite easy to export text back to each application afterwards. Developers that use nls resources should then just have to download common messages and add new they want translated.
Online translation services seem to rely on what users contribute and verify correctness of each others work etc. If we'd even have a web based front end for translation that "everyone" could access it would probably mean that we'd get some more apps in more languages.
I've even showed you how to download and use Google translate to fetch words, so it should even be possible to "borrow" translations from them as they get better.
Would you then be willing to translate a sentence each time you visit e.g. OS/2 World?
Would you agree to verify the correctness of another visitors translation?