Welcome! Log In Create A New Profile

Advanced

[WD20] Retrive caption of control in multilingual applications

Posted by BG- 
Hello all,
I have a multilingual application, I want to retrieve control.caption with out changing Nation setting.
eg.
edt.Date..Caption="Enter Date" // in English
edt.Date..Caption="Introduce la fecha" // in Spanish
all the caption is set in 7-Tab of the control.

Systems default language is in English,
Is there is anyway to ritrive "Spanish caption" without change the default language setting (English ) of that particular edt_date control?

Anybody can help in this matter.
TIA
Biju
Hi, the problem with these things is always that PCS wants to sell their WDMSG and doesn't want you to look too deep into their system ... definitely, there are missing functions in Wx

1 - If you're using SCM, it might be of some help to look at [help.windev.com]

2 - See [repository.windev.com]
Looks promising but there's no source code published! I'm interested in that too and I really would like to see how to extract the strings.
Guenter,

about option 2. Afaik it's just a replacement of WDMSG and does not do the extraction itself. Not 100% sure though.
Hi Arie,

yes, it looks like it does need the .wdm file which is made by WDMSG ... finito l'amore ...

I plan to convert one of our projects to "self-translation" which means that the users should be able to do the translation themselves, store it and run the program in their language. Each year, we have requests from all over the world, whether this program could be supplied in their language, but translation of a program which deals with a certain line of business is expensive and most times is in parts incorrect. It's not urgent, maybe I'll do that next year.

Imho, there are two ways to achieve the desired result. 1 - to hack a running multilingual WD-program and look for the Z-strings in storage. But, I know, it's illegal and not so clean and prone to changes. 2 - to keep the program unilingual and put all of the text into a resource file and load the text items after opening a window. (it's a shame having a programming language at hands which can handle multilinguality but one can't use it!)
Hi Günter,

Couldn't agree more...
PCSoft has foreseen a lot of stuff out of the box concerning multilingual applications or line of business translations (the so called custom language codes) but it is near to useless because of the carcan it is forced into (also concerning upgrades and WDInt retranslations of the framework). Any modern language works with resource files in an open format (xml, text) but PCSoft's file structure remains as closed as it possibly could be forcing somebody to use WDMSG which isn't even a great tool in my experience and a rip-off pricewise for what it is (buy+upgrades) .

I'm sure that if PCSoft would open up their file formats (like M$ and any other major vendor did over the last decade) they could find a community that helps them in building nice add-ons and valuable tools giving even more momentum to selling their product lines.

The lack of easy translation integration via resource files is probably also due to the homogene French vision on culture and language (Similar to the US one). In a country like mine where we have three official languages (Dutch, French, German) and often English as a common denominator for cross-border stuff, multilinguality is like a second nature and a basic requirement.

PCSoft could certainly do better in this area...

Hoping for PCSoft to open up their file formats as soon as possible like M$ did more than a decade ago...
The community could give the WX products additional (sales) momentum in filling up the gaps that PCSoft left.
I'm certainly willing to contribute on that!

Peter Holemans
Guenter,

in one of my application I have a translation option already. Using a shortkey a translation window is opened. Then the user can move the mouse over controls in all the windows of the application and point to controls. The caption is then displayed in the translationwindow and can be tranlated there. Or the already translated text is shown.

Nice thing is that all translations go into a file useable by WDMSG. In fact the file is first generated by WDMSG. If you use the FIC extension in this tool you wil get a Hyperfile-file (the old txt option is stil there btw). For each control there is a record. You will see the windowname and controlname together with the original caption. And the option to add over 200 other languages/translations.

Then you can use this file when opening a window and search for translated text for that specific window. And show the translated texts yourself.
You can also use this file every now and then in WDMSG to integrate the translations in the executable. In the end this is better, because your windows will open faster.

This way the translator (could be an end-user as well) can do the translation with the advantage of seeing all text in the right context. Much better than translating a list of words or text. End-users can also correct translations afterwards.
Hi Arie, thank you! It's interesting. So, one needs to use WDMSG for any translation job? At least as a start if I understand you correctly.
That's right, you need WDMSG to extract all strings and captions.

Changing control captions on the fly is easy. The name of the window+control is also listed in the translation file. A simple search will give you all translations of a particular window. Then use indirection to change your controls accordingly.

Changing hardcoded text/messages is different. The name of the variable/message/string/constant (or anything that can be a text) is not listed in the translationfile as such.
So you have to do a search in the translation file for the complete original text (which is also there) to find the right record. And pick up the translation from there. I do not use this at the moment because it is too slow. Maybe an index will help. Or maybe reading these messages into an array once is an option. I did not try that further.

Just give it a shot and use WDMSG to generate a file. Open it with wdmap or hfcc and then you see the possibilities.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: