Recent

Author Topic: Change language  (Read 13160 times)

diegobincoletto

  • Newbie
  • Posts: 6
Change language
« on: May 02, 2016, 11:47:42 am »
During lazarus installation I selected English but for some reason it came out in Italian, how can I change the laguage?

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Change language
« Reply #1 on: May 02, 2016, 12:24:28 pm »
During lazarus installation I selected English but for some reason it came out in Italian, how can I change the laguage?
Because that is a bug... That I reported at least twice... (for Dutch)
But you can change the language after install. Lazarus does not respect user settings under windows and screws up every time. It also does not respect the OS default language settings under windows. I gave up on reporting. It is using the wrong locale.  >:D >:D >:D
« Last Edit: May 02, 2016, 12:30:01 pm by Thaddy »
Specialize a type, not a var.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Change language
« Reply #2 on: May 02, 2016, 12:57:59 pm »
I cannot confirm this. My system language is German, and Lazarus comes up with that after installation. But when I go to "Tools" / "Options" and select "English [en]" then the language is English all the time (after a restart of Laz). And I'm on Windows. Don't use the first combo item "Automatic (or English)" - this is always German, in my case.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #3 on: May 03, 2016, 12:35:09 am »
@wp:
it's the other way around ;-)

When you _not_ to use the default whatever* for lazarus installation on your windows system then it switches automatically to whatever*. For all my installations i select English, yet it defaults to whatever*

* i have no idea what whatever means, it should be language but it isn't because all my windows are uk versions (and English selected as language) , yet in its infinite wisdom installer/lazarus detects something else and happily selects another language for me. If i use a German machine with uk windows, it selects German. if i do that on an Italian machin, it selects Italian (again uk version installed) etc, etc.

That is something similar as the forever placement of windows underneath the taskbar, because everybody in the whole wide world has that freaking thing at the bottom. And because i like my menu's presented in a natural human order (at the top, from left to right), lazarus, debugger and all not more place it at such position that you 'just' can't access it with a mouse and requires to unlock the task bar, move the window, and lock taskbar again -> to start over again when the window pops up again ... software is evil i tell yah  :P

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Change language
« Reply #4 on: May 03, 2016, 01:12:00 am »
As usual, I don't understand...

If i use a German machine with uk windows, it selects German.
"A German machine with uk windows" - what's that?

My Windows is German. I reinstalled Laz 1.6. The installer proposed German, I switched to English this time  --> The rest of the installation was in English. But this is just the installation program, and I'd expect Lazarus.exe to re-select the language. Therefore: When I start Lazarus it comes up in German because this is my system language. In the Tools menu, I switched to English, closed and restarted Lazarus --> Laz is in English, just as I'd expect. In tools, I switched to Italian --> Laz restarts in Italian.

What's wrong with it? Looks just perfect...

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #5 on: May 03, 2016, 01:48:17 am »
Ah, no not your fault wp. I was a bit unclear in my previous post. Sorry for that.

Quote
"A German machine with uk windows" - what's that?"
Meaning, that if i'm on job in Germany that i have my UK windows installed, with English language, selecting German timezone and time-format (that's it concerning localization).

When installing Lazarus, selecting English language, Lazarus defaults to (and starts in) German. Same situation for Italian, French, Dutch, etc.

It is highly inconvenient, especially if you don't have a clue what all those menu items and option menu's in such languages means (yes, if you are familiar with Lazarus, or any other program for that matter, then you'd know how to switch languages). But, i understand that nobody that uses Lazarus is f.i. visually impaired and completely relies on speech (just to name a practical example).

Quote
What's wrong with it? Looks just perfect...
If i select an option for choosing a language, then i am not doing that just for fun.

It is because that is the language that i am most comfortable with when exploring (new) software (or new options).

Besides that, not all items are translated, so when you switch language, half of them (yes, i exaggerate greatly) is still presented in the other language, until Lazarus is closed and fired up again.

Does that clarify things a bit better ?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Change language
« Reply #6 on: May 03, 2016, 02:54:57 am »
there may be 2 separate issues here.

1) AFAIK (but someone better doublecheck this) the language choice at the start of installation only affects the language during installation process.

If that is the case, patches are welcome to also set the language of the IDE.

2) By default the IDE uses the language of the system. I do not know how that detection works, but if it for some reason it gets it wrong when your locale has specific settings, then that needs to be reported with exact steps to reproduce. (that is the exact changes made to your windows settings)

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Change language
« Reply #7 on: May 03, 2016, 11:27:56 am »
I looked into the Lazarus sources, unit sysutils, initialization part, to learn how Lazarus determines the "system language" as I call it (probably not the correct term). There is a call the GetUserDefaultLCID from unit Windows which returns 1031 ($407) on my default Windows (installed from a German DVD); according to https://msdn.microsoft.com/de-de/goglobal/bb964664.aspx, this is the code for "German/Germany".

Then I went to Windows Control Panel and tried to change my "system language". There are several options, but it seem that the one of the first page of "Region and Language" is the correct one: if I select "English (UK)" in the combobox (--> screenshot) then GetUserDefaultLCID returns 2057 ($807) - this is the Locale ID of "English/UK".

Then I opened my Lazarus and selected Language "Automatic (or English)" in the Language combo of Tools/Environment/General. Restarting Lazarus --> it is in English now (it had opened in German with LCID 1031) --> correct.

Switch Laz language to Italian --> Lazarus comes up in Italian --> correct.

Switch Laz language to "Automatic" again. Change Windows language settings in control panel (first page of "Region and language") back to German, Lazarus opens in German --> correct.

So, everything looks correct. I have no idea what you are doing wrong.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #8 on: May 03, 2016, 02:57:10 pm »
@wp:
Yes, your assessment is correct.

Quote
There is a call the GetUserDefaultLCID from unit Windows which returns 1031 ($407) on my default Windows (installed from a German DVD); according to https://msdn.microsoft.com/de-de/goglobal/bb964664.aspx, this is the code for "German/Germany".
And that call is imho not correct for determining the language used by Windows/User.

Because:
Quote
Then I went to Windows Control Panel and tried to change my "system language". There are several options, but it seem that the one of the first page of "Region and Language" is the correct one: if I select "English (UK)" in the combobox (--> screenshot) then GetUserDefaultLCID returns 2057 ($807) - this is the Locale ID of "English/UK".
Pardon my tongue, but those options you mentioned do not tell shite about what language Windows uses nor what the preferred language is. Despite whatever fairytale m$ is making you believe.

Those options are there for the user to allow for custom date-time format and change current location etc. (which is exactly the issue i encounter), not to change the actual language.

Code: Pascal  [Select][+][-]
  1. program CheckLocale;
  2.  
  3. {$MODE OBJFPC}{$H+}
  4.  
  5. uses
  6.   SysUtils,
  7.   Windows;
  8.  
  9. var
  10.   LocaleID      : LCID;
  11.  
  12. begin
  13.   LocaleID := GetUserDefaultLCID;
  14.   Writeln(Format('UserDefaultID = %x', [LocaleID]));
  15.  
  16.   LocaleID := GetSystemDefaultLCID;
  17.   Writeln(Format('SystemDefaultID = %x', [LocaleID]));
  18. end.
  19.  

Which outputs for me (f.i. using Dutch settings):
Quote
UserDefaultID = 413
SystemDefaultID = 409

See:
Code: [Select]
>reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\system\controlset001\control\nls\language
    Installlanguage     REG_SZ  0409

So, however you like to put it, there goes something wrong there (beit m$ at fault or not).

Please don't try to put the blame on user being erroneous there, because the user certainly isn't at fault (or it must be you blame user for using regional settings, in order to match the rest of the country where user is currently located).

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Change language
« Reply #9 on: May 03, 2016, 03:53:57 pm »
First of all: I am not blaiming anybody here, nor the user, nor MS, nor Lazarus. I only try to understand an issue reported by you and others which I cannot reproduce.

It seems to come down to the point that Lazarus gets its language information from the GetUserDefaultLCID, not from GetSystemDefaultLCID as you propose. I don't want to argue here which one is correct, I am just interested in how the user can set up the language. And this is a problem on its own... Playing with the Windows Control Panel I see that
  • the combobox on page 1 of "Region and language" is the one which seems to determine the GetUserDefaultLCID. This combo is mainly used for changing the DefaultFormatSettings (in their fpc name). This is confusing, I agree.
  • the lower button on page 4 ("Administration") is for changing the GetSystemDefaultLCID. The Windows description in this fprm tells me that this setting is needed for non-unicode text. I relate this to code pages etc. This is confusing as well.
So in total, language selection in Windows is confusing and maybe counter-intuitive from the user point of view. There is not much that Lazarus can do against that poor user interface in Windows.

BUT: In total I still don't understand the problem: If you want Lazarus to be in English why don't you just go the Lazarus Tools / Environment / General / Language and select "English (en)" from the combobox instead of breaking your mind on where exactly the "Automatic" language comes from. Then Lazarus always will be in English whatever the Windows language is.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Change language
« Reply #10 on: May 03, 2016, 05:14:00 pm »
From reading this, and without doing any test of my own, it seems the current method is wrong. (Subject to verification, this might be reported on the bugtracker).

However I don not know if the call to SystemLocaleId is correct.

A user can install language packs http://windows.microsoft.com/en-gb/windows/language-packs
and then change the display language. So a UK Windows could be used with German text.
The question is how to detect.

Also are there examples of other Software, that have multiple language packs by default, and how they react?

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #11 on: May 03, 2016, 05:47:56 pm »
@wp:
Please, don't get me wrong there. I am also not attempting to put a blame but, the last remark that you made in your previous post seems to have suggested as things being a user error (which it is clearly not)

I agree that these settings in Windows are confusing for the user, as they don't resemble any language specific settings, rather locale specific settings.

I also agree that poor user-interface and/or api is not Lazarus responsibility.

However, being persistent in keep on using them (wrongly) can't be the right way to do things ? Or is it ?

Just for the record, i am not proposing to use GetSystemDefaultLCID instead. It was merely used to be able to show that nowhere on this system is there a Dutch language installed (so from a logical pov how is it even possible to auto-detect that it must be the user default language used for the interface ?).

Quote
If you want Lazarus to be in English why don't you just go the Lazarus Tools / Environment / General / Language and select "English (en)" from the combobox instead of breaking your mind on where exactly the "Automatic" language comes from. Then Lazarus always will be in English whatever the Windows language is.
I already put in my 2 cents on that: visually impaired. Not to mention not understanding a single computer-technical related item displayed in languages of some of the countries i travel to. Good luck finding your way through Chinese menu's ;-)

Besides that. The ever first window that Lazarus put up there, is not a menu where you can change/select language options: instead it is a project window that lets the user select to open a new or existing project.

All good and fine when you are familiar with Lazarus, but not so for newbies. Yes, you might argue that everyone is able to understand the Lazarus project window being displayed in their chosen locale settings, and be able to find their way through the menus in order to change the language settings. I simply disagree ;-)

Thank you very much for your assessment, as it clearly explains what it is that is going wrong there exactly. Ergo appreciated for the work you've put into that.

At least i'm now able to instruct new (Windows) Lazarus users to firstly check their locale settings so that their settings meet a 'language' that they are able to comprehend.

If you don't mind, i rather attempt to find out, what is the correct way of doing things. msdn also mentioned some related issues there (e.g. do not use GetUserLocaleID, but the other mentioned solution only seems available for Vista or higher).

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #12 on: May 03, 2016, 06:11:50 pm »
@Martin_fr:

I agree, there are two separate issues there, the installer and Lazarus (startup).

Indeed, it is possible to have multiple languages installed which complicates matters further (e.g. would need further investigation).

I also agree that current method is not the correct way of 'detecting' the default language for Lazarus, that much was clear to me.

I am also not sure if using a call to SystemLocaleId is the correct way to determine the current language used by Windows. Maybe we are able to get some additional input from others (that are annoyed with this issue).

I'm ploughing through msdn, but it seems i'm using wrong search terminology, as things keep being kept in the dark for me (at least not turning up a clear definitive answer) :-S

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Change language
« Reply #13 on: May 03, 2016, 06:44:02 pm »
Also are there examples of other Software, that have multiple language packs by default, and how they react?
For a test, I set GetUserLocaleID to Italian, and GetSystemLocateID to French - these are languages which are usually not selected on my PC. Then I looked through what is on my disk and noted which programs come up in Italian and which come in French; the Italian ones determine the language from GetUserLocaleID, the French ones from GetSystemLocaleID:
  • Epson Scan --> GetUserLocaleID
  • Inkscape --> GetUserLocaleID
  • Everest --> GetUserLocaleID
  • Google Earth --> GetUserLocaleID
  • RawTherapee --> GetUserLocaleID
  • Stellarium --> GetUserLocaleID
  • VLC -> GetUserLocaleID
This means that there is a vast majority of programs (all?) which handle language detection in the same way as Lazarus by calling GetUserLocaleID. But in addition, there are other programs which have an automatic language detection in their program settings which open in German - this is the language of the DVD from which my Windows was installed, i.e. the language pack - I don't know how to get that from Windows (somewhere in the Registry I guess):
  • Dropbox
  • Gimp
« Last Edit: May 03, 2016, 06:46:19 pm by wp »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Change language
« Reply #14 on: May 03, 2016, 08:26:40 pm »
Thank you very much wp.

Yes, this is also my experience. Many programs doing it wrongly (and since first windows versions appeared, i might add) ;-)

From what i was able to comprehend, this function seems the most plausible to use (but i can't check as i don't have a multi language installation).
Code: Pascal  [Select][+][-]
  1. program CheckLocale2;
  2.  
  3. {$MODE OBJFPC}{$H+}
  4.  
  5. uses
  6.   SysUtils,
  7.   jwawinnls,
  8.   Windows;
  9.  
  10. var
  11.   LocaleID      : LCID;
  12.   LanguageID    : LANGID;
  13.  
  14.  
  15. begin
  16.   LocaleID := GetUserDefaultLCID;
  17.   Writeln(Format('UserDefaultID = %x', [LocaleID]));
  18.  
  19.   LocaleID := GetSystemDefaultLCID;
  20.   Writeln(Format('SystemDefaultID = %x', [LocaleID]));
  21.  
  22.   // https://msdn.microsoft.com/en-us/library/windows/desktop/dd318137(v=vs.85).aspx
  23.   LanguageID := GetUserDefaultUILanguage;
  24.   Writeln(Format('UserDefaultUILanguage = %x', [LanguageID]));
  25. end.
  26.  

 

TinyPortal © 2005-2018