PDA

View Full Version : BREW application internationalization


irimiab
09-13-2003, 06:14 AM
In a standard, menu-based application in BREW, I have the requirement to implement multiple language support. The settings menu should have a Language Select submenu which should allow the user to select another language. All the strings in the application should change as a result of that choice. The choice should also remain enabled after the user exits the application and then opens it afterwards. The solution is to have all the strings in a resource file. But what about another language ? Should I have another resource file for another language ? If the answer is Yes, then how can I change the resource file used, when the user selects another item in the language menu ?
Or the solution is to have each string in the resource file written three times, and in the application I make the selection of the string with an IF clause or something ? This ideea is not so agreable for me because the application can have many string resources loaded and the effort to select each string is quite nasty :)
Is there another way to do it ? I prefer the simpliest solution, because the application is in an advanced state and multiple changes take precious time.

Thank you very much ! ;)

ruben
09-13-2003, 06:20 PM
You can have one seperate string resource loader class, which will read the persistent data from a file about the language setting preference. Depending upon the language setting preference, the resource loader will load appropriate .bar file. By keeping three different resource file, you can keep your resource loading memory requirement low(if your bar files are big). If you have different resource file, then you can have same IDs for each menu item for each language. If you decided to use same resource file, then you can have resource ID at an offset set for each language. You can calculate appropriate offset in your resource loader class. Rest part of your code, will refer any menu item with a standard ID(irrespective of language), in your resource loader class, you will select correct ID based on the offset for selected language.

ruben

Mickey Portilla
09-14-2003, 03:15 PM
irimiab,

I am currently using an offset method like the one Ruben suggested in his post. Having different BAR files can open up a new can of worms. I dispose of allocated text buffers for resource strings as soon as I can to conserve the heap.


-Mickey Portilla

everyourgokul
09-11-2006, 12:49 AM
how can i achieve internationalization for my application....
can we have to use multiple resource files for that
if we areusing multiple resource files,how we can add it in to program dynamically