Is it possible to easily convert an english language project to Spanish?
Sign up for email news and updates!
Is it possible to easily convert an english language project to Spanish?
This depends on your definition of "easy".
If you won't make any further alterations to your project, take the project file, make a copy of it and rename the extension from am7 to txt. Then you will be able to open the file in a text editor, and see that you have structured XML document, which you can edit.
For example, if you want to change the text on buttons, look for the "Caption" tag. Labels are stored in "Body" tags, the caption of checkboxes and radiobuttons is stored in a "Text" tag, and so on. Some objects have their text stored inside the "CustomData" tags. The most easiest way would to search for a text you want to translate inside the XML, locate the corresponding instance, and replace it with the new text.
After all the alterations are done, save the file with a new name and the extension am7, and open it again in AMS. The project should now display the translated texts.
Of course the most appropriate way would be to make a language definition file for each language you want to support, read the file in runtime, and replace the texts with the appropriate translation before displaying the object on the screen. But this is something best done while still coding the project...
Ulrich
Thanks for the reply. It sounds like a re-write is in order. Do you, or anyone have a simple sample (.apz perhaps) of what the language definition file(s) would look like and how to code it with objects?Of course the most appropriate way would be to make a language definition file for each language you want to support, read the file in runtime, and replace the texts with the appropriate translation before displaying the object on the screen. But this is something best done while still coding the project...
Hello
Which is better, use a INI file or an XML file to read different languages?
What I noticed is that when loading a language, it shows the change in default status in the AMS (the text is put to make the GUI on the labels, checkbox, etc.).
Although load the translation in the event preload, to display the page note as change the text. Why?
THX
I made a sample for you, please see the attached project below.
This is a solution I came up with, it may not be the best for every case, and certainly you still may find room for improvements here, but it should be enough to give you some ideas and to get started on your own.
I used a XML file to be able to change at once the texts on labels, checkboxes, radiobuttons, WinButton (plugin), ListBox, and buttons, according to the language you selected. In my example, you are able to chose between English, German and Brazilian Portuguese for those objects, placed on three pages of this sample.
You will need to implement other handlers as necessary. I set up the XML in a way that would easy to parse, but of course this is not the only way, and looking at my example you might be able to make some further tweaks. For example, you may prefer to have a separate XML for each language, instead of a single file.
Hope this helps.
Ulrich
Last edited by Ulrich; 09-09-2008 at 05:58 PM.
Thanks for the example! I'll have a look.![]()
Updated example below. I missed a hard-coded page name in a function body.
Ulrich
upeters,
I'm unable to open the .apz file.
Strange, I downloaded the file now, and it opens just fine here. Do you get any kind of error message? Please try to download the project again.
Ulrich
I downloaded the file again. It did not open. I have attached the error mesage.
I was able to open using 7.0. Thank you! This is a big help!