Discussion:
Lazarus doesn't set IDE language correctly
Graeme Geldenhuys
2011-08-31 08:23:18 UTC
Permalink
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

--
Ludo Brands
2011-08-31 08:54:14 UTC
Permalink
Post by Graeme Geldenhuys
-------------------------------------
$ 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


--
Felipe Monteiro de Carvalho
2011-08-31 08:59:12 UTC
Permalink
Post by Ludo Brands
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

--
Hans-Peter Diettrich
2011-08-31 10:38:48 UTC
Permalink
Post by Felipe Monteiro de Carvalho
Post by Ludo Brands
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


--
Graeme Geldenhuys
2011-08-31 09:23:35 UTC
Permalink
Post by Ludo Brands
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

--
Mattias Gaertner
2011-08-31 09:43:10 UTC
Permalink
 
Post by Graeme Geldenhuys
Post by Ludo Brands
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
 
Post by Graeme Geldenhuys
--
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
Mattias Gaertner
2011-08-31 09:01:23 UTC
Permalink
 
Post by 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 
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
 
Ludo Brands
2011-08-31 09:22:08 UTC
Permalink
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
Graeme Geldenhuys
2011-08-31 09:27:38 UTC
Permalink
Post by Mattias Gaertner
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

--
waldo kitty
2011-08-31 13:51:17 UTC
Permalink
Post by 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?
at what point in the startup is the language determined and set?


--

Continue reading on narkive:
Search results for 'Lazarus doesn't set IDE language correctly' (Questions and Answers)
568
replies
DONALD TRUMP building A WALL to keep out ILLEGALS. GOOD IDEA OR NOT?
started 2017-01-28 16:47:51 UTC
law & ethics
Loading...