Support forum of the software localization tool Sisulizer


Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
Delphi resources loading on Locale - Usage - Three simple steps to localize - Technical Support (You need to be registered at the forum to write) - Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ...
AuthorPost
 Posted: Mon Oct 13th, 2008 12:10 am
PM Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 105
Status: 
Offline
Hi
For my Delphi application i am just looking at the automatic resource loading behaviour and looking to filter that against licensed languages....


I can't set a locale so that my CHT resource gets loaded (I can do a run time switch ok)  I can set Localse to PRC and get my CH resources loaded automatically.  I can understand this.

Portuguese works as expected - if I set Windows to locale Brazil VCL uses my PTB pack, setting locale to Portugal does not, it remains in default language - English.

Spanish Spain seems right, but when I set the windows locale to Spanish Spain, the ESP resources do NOT get auto loaded via VCL at start up.  Why not?


All my other packs work as expected : RU, FR, SV, (SW), TR, CS, DE, FI, HU, IT, KO, NL, PO

Back To Top PM Quote Reply

 Posted: Mon Oct 13th, 2008 05:08 am
PM Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 105
Status: 
Offline
Furthermore...

How can I get a description such as Spanish (Spain) from  _es_ES  ?

In this context I can't know that I'm trying to use my ESP resources, I can advise the user to switch to Spanish at run time  (And then the registry will get ESP and next time I start I get the 1034 language and all goes well)

                                  Locale   Registry
                                  Spanish  Spanish
                                  Spain    Spain
GetActiveLangId                   0        1034
GetActiveResourceLocale           ""       ESP
LocaleToIso639(GetActiveLangId)   es       es_ES
GetLocaleExtension                _es_ES   _es_ES
IsResourceFileLoaded              FALSE    TRUE
GetCurrentDefaultLocaleReg        ""       ESP
GetActiveCodePage                 0        1252
Available Ext                     ESP      ESP

Back To Top PM Quote Reply

 Posted: Sat Oct 18th, 2008 01:10 am
PM Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Tokyo, Japan
Posts: 1641
Status: 
Online
VCL loads the resource DLL according the following rules

1) It looks from registry under following key if the application's locale has been set.
- HKEY_CURRENT_USER\Software\CodeGear\Locales
- HKEY_LOCAL_MACHINE\Software\CodeGear\Locales
- HKEY_CURRENT_USER\Software\Borland\Locales
- HKEY_CURRENT_USER\Software\Borland\Delphi\Locales

The above order is for Delphi 2009. Older Delphi may not load from CodeGear key.

If the registry key contains locale for current application VCL will use it. For example HKEY_CURRENT_USER\Software\CodeGear\Locales key might contains the following value:

D:\Features\Runtime\Delphi2009\Project1.exe     DE

It instructs VCL to load Project1.DE

2) If there is not value in the registry or the resource DLL that was give there does not exist the VCL tries to load DLL matching to the system locale. This means if you have system locale German (Germany) = de_DE, VCL will seach for .DEU.

3) If the exact match does not exists then VCL tries to load country neutral resource DLL (e.g. DE instead of DEU).

4) Otherwise VCL does not load DLL but uses the resources of EXE

In your case .CHT is only loaded if you set your system locale to Chinese (Taiwan). If you system locale is some other Chinese VCL does not load it automatically. However you can override it by setting the locale value (CHT) in the HKEY_CURRENT_USER\Software\CodeGear\Locales registry.

Your .PTB is only loaded if system locale is Portuguese (Brazil). it does not get loaded if localize is Portuguese (Portugal). In order to use Portuguese in both locales the DLL extension must be .PT. Either rename the DLL from .PTB to .PT or change the column in the SL project to contains country neutral Portuguese instead of Brazilian Portuguese.

You can find the above logic from VCL source code. Look for <delphi>\Source\Win32\rtl\sys\System.pas and look for LoadResourceModule functions. It performs the loading.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Sun Oct 19th, 2008 11:05 pm
PM Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 105
Status: 
Offline
Yes, I follow this, and I read the help and all works well and as expected, as I said.

But my post description is Problem with Spanish.

Spanish does not.  I have tried all these languages and VCL loads in the language selected.  (Excepting that CH is Chinese Simplified in Sisulizer, not PRC,  and CHT is Chinese Traditional, not Taiwan which is confusing...)

With Spanish you can see from my second post that the locale has been detected, _es_ES, but no localised resources have been loaded.  Those resources do exist and they do load if I set the registry key to ESP (the extension of the resource file created by Sisulizer).

Would you expect spanish resources to load with the locale set to Spanish (Spain) when the resource was generated in Sisulizer from the Spanish (Spain) language? I am expecting that to work.


Back To Top PM Quote Reply

 Posted: Sun Oct 19th, 2008 11:53 pm
PM Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Tokyo, Japan
Posts: 1641
Status: 
Online
There are two Spanish (Spain) variants: traditional and international (modern) sorts. ESP is for traditional sort. ESN is for international. The computer that is trying to run .ESP might have international sort turned on so it tries to load .ESN instead.

You can change the sorting order from control panel's international settings. See screen shot. It is for Vista. In XP it is little bit different.

I recommend using country neutral Spanish so SL will create .ES that will load not matter what Spanish locale the computer has.

Jaakko

Attachment: Untitled.png (Downloaded 20 times)



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Mon Oct 20th, 2008 04:06 am
PM Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Tokyo, Japan
Posts: 1641
Status: 
Online
Starting from build 273 the language language contains two Spanish (Spain) values:

1) Spanish (Spain, Traditional Sort)
code: es-ES
ext: ESP

2) Spanish (Spain, International Sort)
code: es-ES-MOD
ext: ESN

Jaakko

Attachment: Untitled.png (Downloaded 18 times)



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

 Posted: Wed Oct 22nd, 2008 02:08 am
PM Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 105
Status: 
Offline
Yes, this works now.  My existing project spits out ESN rather than ESP now, and when the PC is set to Spanish Spain, these resources are loaded.  Thanks.

One thing, I won't have both, but when I do have both ESP and ESN on my machine, the list of available languages, shown by the LaDialog for example, shows both as Spanish Spain.


Back To Top PM Quote Reply

 Posted: Wed Oct 22nd, 2008 11:24 am
PM Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Tokyo, Japan
Posts: 1641
Status: 
Online
bikemike wrote: One thing, I won't have both, but when I do have both ESP and ESN on my machine, the list of available languages, shown by the LaDialog for example, shows both as Spanish Spain.

I fixed this in 274.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Quote Reply

Current time is 11:59 pm  
Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Delphi resources loading on Locale



WowUltra 1.11 Copyright © 2007 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize