Support forum of the software localization tool Sisulizer


.NET, Delphi, ... - Sisulizer Localization Tool Support 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 Page:  First Page Previous Page  1  2   
New Topic Reply Printer Friendly
captions of radiobuttons in DevExpress TcxRadioGroup not translated back - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support
AuthorPost
 Posted: Mon May 25th, 2009 03:19 pm
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
Ok, thanks a lot.

Back To Top PM Private Upload Quote Reply

 Posted: Mon May 25th, 2009 06:19 pm
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
One little question.

I found another strange thing. When loading the languages in a combobox the English language is shown as "English" and the resource dll language is shown as "Nederlands". The latter is correct because my OS is Dutch but then I suspect that the first one should be "Engels" and not "English".

What I do is the following:

procedure TfrmMain.FormCreate(Sender: TObject);
  procedure Process(locale: Integer);
  var
    str: String;
  begin
    str := GetWindowsLocaleName(locale, True);
    cbLanguage.Properties.Items.AddObject(str, TObject(locale));
  end;

var
  i, locale: Integer;
  code: String;
  languages: TStringList;
begin
  AppDir := ExtractFilePath(Application.ExeName);
  InitializeSkinList;
//  PageControl.ActivePageIndex := 0;

  // Populate the radio group to contains the possible languages

  // Original language is English
  Process(LANG_ENGLISH);

  // Add the available languages.
  // Get only those that are compatible to the current code page.
  languages := TStringList.Create;
  try
    GetAvailableResources(languages, '', True);

    for i := 0 to languages.Count - 1 do
    begin
      code := languages[i];
      locale := ExtensionToLocale(code);
      Process(locale);

      if code = LoadedResourceLocale then
        cbLanguage.ItemIndex := cbLanguage.Properties.Items.Count - 1;
    end;

    if cbLanguage.ItemIndex = -1 then
      cbLanguage.ItemIndex := 0;
  finally
    languages.Free;
  end;
end;
 


The "Process(LANG_ENGLISH)" is giving me the "English" language but I suspected "Engels".

What could be the problem here?

Back To Top PM Private Upload Quote Reply

 Posted: Mon May 25th, 2009 07:59 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
The "Process(LANG_ENGLISH)" is giving me the "English" language but I suspected "Engels".

What could be the problem here?

You suspect right. This is a feature that we forgot to implement. It is not that easy to implement because Windows gives languages names in two languages only:
1) In English (e.g. English, German, Japanese, Finnish, etc)
2) In languages own language (e.g. English, Deutch, 日本語, suomi, etc)

I implemented this feature in 284. In order to use it you have to add a string resource that contains the languages names in your original language. If the orignal language is English and you plan to localize into German, Japanese and Finnish create following RC file and add it to your Delphi project.

STRINGTABLE
BEGIN
  7  "German";
  9  "English";
  11 "Finnish";
  17 "Japanese";
END


Use the language/locale codes of the languages. You can find the codes from Windows.pas. Look for LANG_xxxxxx contants.

If you have the resource then GetWindowsLocaleName uses them if the useNative property is set to True. If there is no resource the function returns value in English (as it does now).

I also added a sample in 284 setup.

Thank you for pointing this out.

Jaakko



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

 Posted: Mon May 25th, 2009 08:07 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
<sldir>\VCL\Delphi\RuntimeChange directory contains the sample.

Jaakko



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

 Posted: Tue May 26th, 2009 03:33 am
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
Thanks :)

Back To Top PM Private Upload Quote Reply

 Posted: Wed May 27th, 2009 08:14 am
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
Jaakko.Salmenius wrote: The "Process(LANG_ENGLISH)" is giving me the "English" language but I suspected "Engels".

What could be the problem here?

You suspect right. This is a feature that we forgot to implement. It is not that easy to implement because Windows gives languages names in two languages only:
1) In English (e.g. English, German, Japanese, Finnish, etc)
2) In languages own language (e.g. English, Deutch, 日本語, suomi, etc)

I implemented this feature in 284. In order to use it you have to add a string resource that contains the languages names in your original language. If the orignal language is English and you plan to localize into German, Japanese and Finnish create following RC file and add it to your Delphi project.

STRINGTABLE
BEGIN
  7  "German";
  9  "English";
  11 "Finnish";
  17 "Japanese";
END


Use the language/locale codes of the languages. You can find the codes from Windows.pas. Look for LANG_xxxxxx contants.

If you have the resource then GetWindowsLocaleName uses them if the useNative property is set to True. If there is no resource the function returns value in English (as it does now).

I also added a sample in 284 setup.

Thank you for pointing this out.

Jaakko



Hi,

The sample you included in the build 284 works fine but I can't get it working in my program. Is it possible that you can implement it in the sample "DelphiLangChange" because I don't use LaDialog unit. I load the available resources in a combobox like the "DelphiLangChange" sample. But I still get the "English" language and not the "Engels" language and I translated it in Sisulizer using the stringtable.

procedure TfrmMain.FormCreate(Sender: TObject);
  procedure Process(locale: Integer);
  var
    str: String;
  begin
    str := GetWindowsLocaleName(locale, True);
    cbLanguage.Properties.Items.AddObject(str, TObject(locale));
  end;

var
  i, locale: Integer;
  code: String;
  languages: TStringList;
begin
  AppDir := ExtractFilePath(Application.ExeName);
  InitializeSkinList;
//  PageControl.ActivePageIndex := 0;

  // Populate the radio group to contains the possible languages

  // Original language is English
  Process(LANG_ENGLISH);

  // Add the available languages.
  // Get only those that are compatible to the current code page.
  languages := TStringList.Create;
  try
    GetAvailableResources(languages, '', True);

    for i := 0 to languages.Count - 1 do
    begin
      code := languages;
      locale := ExtensionToLocale(code);
      Process(locale);

      if code = LoadedResourceLocale then
        cbLanguage.ItemIndex := cbLanguage.Properties.Items.Count - 1;
    end;

    if cbLanguage.ItemIndex = -1 then
      cbLanguage.ItemIndex := 0;
  finally
    languages.Free;
  end;
end;

Last edited on Wed May 27th, 2009 08:22 am by ajmol

Back To Top PM Private Upload Quote Reply

 Posted: Wed May 27th, 2009 08:53 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Make sure that your EXE really contains those string resources.

Jaakko



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

 Posted: Wed May 27th, 2009 09:31 am
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
I did that and I also translated them in Sisulizer.

Languages.rc looks like:

STRINGTABLE
BEGIN
  9  "English";
  13 "Dutch";
END


Original language in Sisulizer is English and I create a dutch resource dll.

Last edited on Wed May 27th, 2009 09:34 am by ajmol

Back To Top PM Private Upload Quote Reply

 Posted: Wed May 27th, 2009 12:02 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
str := GetWindowsLocaleName(locale, True);

str := GetWindowsLocaleName(locale, False);

Jaakko



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

 Posted: Wed May 27th, 2009 07:23 pm
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
I'm confused now :?

When I do:

str := GetWindowsLocaleName(locale, False);


the languages I see, when my program starts with standard windows language (Dutch), are "Engels" and "Dutch". The first is good but the last not.

When I do:

str := GetWindowsLocaleName(locale, True);


the languages I see, when my program starts with standard windows language (Dutch), are "English" and "Nederlands". The first is false and the last is good.

So what is happening here?

Also when I change "GetWindowsLocaleName" with "GetWindowsLocaleWideName" then the outcome is:
  1. With native set to true the languages are "English" and "Nederlands"
  2. With native set to false the languages are "English" and "Dutch"
I'm lost here.

Back To Top PM Private Upload Quote Reply

 Posted: Wed May 27th, 2009 07:38 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Because your populate radio button on run time they are not automatically translate by TLaTranslator. Remember that it only translates the properties that are in the DFM file. After language change you have to translate the radio buttons.

procedure TForm1.RadioGroup1Click(Sender: TObject);
var
  i, locale: Integer;
  code: String;
begin
  locale := Integer(RadioGroup1.Items.Objects[RadioGroup1.ItemIndex]);


  // Original language is English so use empty language code with English
  if locale = LANG_ENGLISH then
    code := ''
  else
    code := LocaleToExtension(locale);


  SetNewResourceFile(code);

  // Translate the radio buttons
  for i := 0 to RadioGroup1.Items.Count - 1 do
    RadioGroup1.Items := GetWindowsLocaleName(
      Integer(RadioGroup1.Items.Objects),
      False);
end;


I have attached modified LangChange sample that shows this.

Hope this helps you.

Jaakko

Attachment: Sample.zip (Downloaded 1 time)



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

 Posted: Wed May 27th, 2009 08:19 pm
PM Private Upload Quote Reply
ajmol
Member
 

Joined: Mon May 11th, 2009
Location:  
Posts: 16
Status: 
Offline
That indeed did it :).

Thanks for the great support.

Back To Top PM Private Upload Quote Reply

Current time is 09:14 pm Page:  First Page Previous Page  1  2     
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > captions of radiobuttons in DevExpress TcxRadioGroup not translated back



WowUltra modified by Sisulizer Copyright © 2007-09 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize