Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

Lazarus doesn't set IDE language correctly

10 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I have changed my System and Gnome language settings to Afrikaans. I logged out and then back it to ensure the language change is correct. My whole Gnome desktop and GTK2 applications (gEdit, Firefox, OpenOffice etc) are now all in Afrikaans.

Unfortunately Lazarus IDE isn't. I have the language set to Automatic, but it still defaults to English. I can force it to Afrikaans, but what's the point of the Automatic setting then?

Here is some console output to confirm Afrikaans is my language, and the command line I use to startup Lazarus. This example shows me using Lazarus 0.9.30.1, but the problem also exists with the latest Trunk version of Lazarus.

-------------------------------------

$ echo $LANG
af_ZA.utf8
$ /opt/lazarus-0.9.30/lazarus --pcp=~/.lazarus-0.9.30/

-------------------------------------

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Ludo Brands
to Graeme Geldenhuys
Show quoted text 8 lines
------------------------------------- $ echo $LANG af_ZA.utf8 $ /opt/lazarus-0.9.30/lazarus --pcp=~/.lazarus-0.9.30/

Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks LC_ALL, LC_MESSAGES, LANG in that order.

Ludo

Reply by email

Felipe Monteiro de Carvalho
to Ludo Brands
Ludo Brands wrote
Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks LC_ALL, LC_MESSAGES, LANG in that order.

Is that really a good idea to check LC_MESSAGES before LANG?

http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

The LC_MESSAGES environment variable specifies the language to use in diagnostic messages.

Does not seams like a good idea to give it priority over LANG.

Also:

If the LC_ALL environment variable is set, it overrides the value of LC_CTYPE and LC_MESSAGES; otherwise, LC_CTYPE and LC_MESSAGES default to the value of the LANG environment variable. If none of these variables are set, GCC defaults to traditional C English behavior.

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: I have changed my System and Gnome language settings to Afrikaans. I logged out and then…

?

Graeme Geldenhuys hat am 31. August 2011 um 10:23 geschrieben:

Show quoted text 20 lines
Hi, I have changed my System and Gnome language settings to Afrikaans. I logged out and then back it to ensure the language change is correct. My whole Gnome desktop and GTK2 applications (gEdit, Firefox, OpenOffice etc) are now all in Afrikaans. Unfortunately Lazarus IDE isn't.? I have the language set to Automatic, but it still defaults to English. I can force it to Afrikaans, but what's the point of the Automatic setting then? Here is some console output to confirm Afrikaans is my language,? and the command line I use to startup Lazarus. This example shows me using Lazarus 0.9.30.1, but the problem also exists with the latest Trunk version of Lazarus. ------------------------------------- $ echo $LANG af_ZA.utf8?

The LCL uses the gettext GetLanguageIDs function which returns the two values 'af' and 'af_ZA.utf8', so the translator searches for file.af.po and file.af_ZA.utf8.po.
AFAIK it worked that way since many years.
?
I wonder, why has no one noticed the broken af_ZA, pt_BR, zh_CN translations under Linux yet??
?
That's why I'm not sure where to fix it:
a) Rename the Lazarus language files - might break under windows? b) or strip the utf8 - might break existing applications c) or extend the LCL translator to search additionally without '.utf8'.? ?Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110831/8670a1b7/attachment.html>

Reply by email

Ludo Brands
to Mattias Gaertner

The LCL uses the gettext GetLanguageIDs function which returns the two values 'af' and 'af_ZA.utf8', so the translator searches for file.af.po and file.af_ZA.utf8.po.

AFAIK it worked that way since many years.

I wonder, why has no one noticed the broken af_ZA, pt_BR, zh_CN translations under Linux yet?

That's why I'm not sure where to fix it:

a) Rename the Lazarus language files - might break under windows

b) or strip the utf8 - might break existing applications

c) or extend the LCL translator to search additionally without '.utf8'.

Mattias

c) appears the most logical. The format is <lang>_<territory>.<codeset>. So the search should be <lang>_<territory>.<codeset>, <lang>_<territory> and then <lang>.

Ludo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110831/da293057/attachment.html>

Reply by email

Graeme Geldenhuys
to Ludo Brands: Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks LC_ALL,…
Ludo Brands wrote
Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks LC_ALL, LC_MESSAGES, LANG in that order.

None of the others are defined, as show by the console output here.

[~]$ echo $LC_ALL

[~]$ echo $LC_MESSAGES

[~]$ echo $LANG
af_ZA.utf8

I thought Lazarus IDE compiled with LCL-GTK2 is a true / native GTK2 application, so shouldn't it work like all the other GTK2 applications on my system?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Ludo Brands: The LCL uses the gettext GetLanguageIDs function which returns the two values 'af' and…
Ludo Brands wrote 7 lines
c) or extend the LCL translator to search additionally without '.utf8'. c) appears the most logical. The format is <lang>_<territory>.<codeset>. So the search should be <lang>_<territory>.<codeset>, <lang>_<territory> and then <lang>.

That is how fpGUI Toolkit works. It seems the most logical solution for LCL too.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: None of the others are defined, as show by the console output here. [~]$ echo $LC_ALL…

?

Graeme Geldenhuys hat am 31. August 2011 um 11:23 geschrieben:

Show quoted text 18 lines
On 31/08/2011, Ludo Brands wrote: > > Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks > LC_ALL, LC_MESSAGES, LANG in that order. None of the others are defined, as show by the console output here. [~]$ echo $LC_ALL [~]$ echo $LC_MESSAGES [~]$ echo $LANG af_ZA.utf8 I thought Lazarus IDE compiled with LCL-GTK2 is a true / native GTK2 application, so shouldn't it work like all the other GTK2 applications on my system??

It does.
Set a wrong value to these variables and you will see warnings. To be more precise this is more a libc thing than a gtk2 thing.? ?
Note: gtk2 does not define the names of the po files. This is done by the LCL translation unit.?
?
?
Mattias
?

Show quoted text 16 lines
-- Regards, ? ?- Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110831/1e3eff98/attachment.html>

Reply by email

Hans-Peter Diettrich
to Felipe Monteiro de Carvalho: Is that really a good idea to check LC_MESSAGES before LANG?…
Show quoted text 5 lines
On Wed, Aug 31, 2011 at 10:54 AM, Ludo Brands wrote: > Are LC_ALL or LC_MESSAGES defined? They have higer priority. Lazarus checks > LC_ALL, LC_MESSAGES, LANG in that order. Is that really a good idea to check LC_MESSAGES before LANG?

+1

I already had the same issue (with German, on Ubuntu), where all applications switch to the selected language - except Lazarus IDE :-(

But AFAIR I had to manually change LANG for the IDE - so what's the setting used by all other applications???

DoDi

Reply by email

waldo kitty
to Graeme Geldenhuys: I have changed my System and Gnome language settings to Afrikaans. I logged out and then…
Graeme Geldenhuys wrote 10 lines
Hi, I have changed my System and Gnome language settings to Afrikaans. I logged out and then back it to ensure the language change is correct. My whole Gnome desktop and GTK2 applications (gEdit, Firefox, OpenOffice etc) are now all in Afrikaans. Unfortunately Lazarus IDE isn't. I have the language set to Automatic, but it still defaults to English. I can force it to Afrikaans, but what's the point of the Automatic setting then?

at what point in the startup is the language determined and set?

Reply by email