|
|||
|
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > How to find which language is compiled a localized file?
|
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| How to find which language is compiled a localized file? - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
Eugene Member
|
Hi, Once an exe file has been compiled as several exe, once for each language, how can the program know in which language it is translated ? Thank you
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Ilkka.Salmenius Administrator
|
You can see the language in two ways 1) When Sisulizer creates localized EXE file it writes each EXE into a language specific sub directory. For example if you original fiel is C:\Files\Application.exe the French EXE will be in C:\Files\fr\Application.exe 2) Each resource in EXE can have language tag. EXE's created by Visual Studio typically has a language tag. If your original EXE is in English then the language tag of each resources are most likely English (LANG_ENGLISH). When Sisulizer creates a localized EXE it replaces the resources with localized resources. In this process it also updates the language tag to match the target language. So C:\Files\fr\Application.exe will have French (LANG_FRENCH) language tags in resources. You can view the languge tags with any application that can show resources of EXE. If you have Visual Studio just open the EXE into VS and view the resources. Ilkka
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Ilkka.Salmenius Administrator
|
If your application (EXE) wants to find on runtime what is the language you have few choices 1) Read the language tag of a resource to find the language. See <sldir>\VCL\LaResource.pas for GetFormLocale fucntion. It is a function that gets the language tag from RT_RCDATA. If you use C++ you can convert that Pascal code to C++ and replace RT_RCDATA with RT_DIALOG 2) Another choice is to adda resource string and give it initial value of language code. So original English EXE would contains en. That string will apper into Sisulizer project and you can translate it to fr, es, de, ... On runtime you can read the value to find out the language. Ilkka
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Eugene Member
|
Hi, Thanks for the quick response. I Use Delphi 2007 and GetFormLocale always return 0, but your idea of testing a resource string of my own not shown anywhere is great. Thanks a lot for the tip.
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Ilkka.Salmenius Administrator
|
Eugene wrote: I Use Delphi 2007 and GetFormLocale always return 0, but your idea of testing a resource string of my own not shown anywhere is great. This is because Delphi does not set the language tag of a resource item. Because the original reosurce does not have the tag Sisulizer by default does not add it either. However you can make Sisulizer to add the language tag. See the screenshot. After that GetFormLocale will return the right language code. Ilkka Attachment: Untitled.png (Downloaded 11 times)
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Eugene Member
|
Thank you very much, it works!
|
||||||||||||||||
| |||||||||||||||||
| Current time is 09:51 pm | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > How to find which language is compiled a localized file? | |
Sisulizer software localization tool - Three simple steps to localize