SVN HEAD and non-English system locales

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.x.x package for your distribution or compile Audacity from the source code.
Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

SVN HEAD and non-English system locales

Post by Gale Andrews » Sun Nov 14, 2010 2:46 pm

I have SVN HEAD built on Ubuntu 10.10 and installed with default ./configure and wanted to test Audacity with a non-English system language. I tried this first the "easy" way going to the Ubuntu Language Preferences, installing German, dragging it to the top in the "Language for Menus and Windows" dialogue, clicking the button to use this for log-in and startup, then rebooting. After starting Audacity with initialised .cfg (so it should be using the system language), Audacity is still in English (Preferences correctly shows "System", and languages change properly if chosen in Preferences). Most inbuilt programs that come with Ubuntu are now in German. Is this because they are actually part of the distribution?

Anyway I think what I need is for the LANG environment variable to change in order for Audacity to take notice. It's still on en_GB.utf8 and no advice I've found like editing etc/default/locale or using setlocale in the terminal actually changes LANG (setlocale is "not found" although apropos locale claims it to exist).

Any thoughts on this?


Thanks


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Tue Nov 16, 2010 12:54 pm

In ancient times, at least on Debian, does system variables could be set in /etc/environment and it would take effect globally for all users (after login).

Nowadays I'm not so sure if that chain is still respected. I think /etc/environment has been deprecated. I'll try to have a look at it later. I think my system is set to portuguese so I should be able to test that without changing anything. I'll let you know what I found.

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Fri Dec 03, 2010 2:25 am

Sorry Gale I completely forgot about this topic... Do you still need me to do some testing on this matter?
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: SVN HEAD and non-English system locales

Post by Gale Andrews » Mon Dec 06, 2010 1:39 am

bgravato wrote:Sorry Gale I completely forgot about this topic... Do you still need me to do some testing on this matter?
Hi Bruno,

Yes I would appreciate your testing. Unfortunately Ubuntu documentation is very poor here ("maybe", "not recommended"...) and Ubuntu Forum questions about this are unanswered or the solutions given don't work.

Anyway, it seems having installed Ubuntu 10.10 in English, the GDM_LANG variable which is set to en_GB always over-rides any setting of LANG (at least at login).

The LANGUAGE variable in /etc/environment is affected if I change language at System > Administration, but setting LANG there has no effect, nor does it in ~/.profile, even after reboot.

I can set LANG in my shell session to what I like by unset GDM_LANG then LANG=, but Audacity does not respect LANG in that situation. So until I can figure how to get round GDM_LANG at login it seems impossible to really test Audacity with LANG.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Mon Dec 06, 2010 2:07 am

OK I did some testing in Debian. I tested in Debian's official pre-compiled 1.3.12 version.
If I set audacity language to System, it will show the interface in the language set in LANG. Whatever I put in GDM_LANG doesn't affect audacity.
In my case I have both LANG and GDM_LANG set to "pt_PT.UTF-8", so Audacity will start with the interface in portuguese.
I started Audacity with LANG set to "es_ES.UTF-8" and it started in spanish.
I set GDM_LANG to "es_ES.UTF-8" (with LANG set to "pt_PT.UTF-8") and it started in portuguese.

I was then going to test with my own compiled 1.3.13-alpha-Nov 8 2010 (Unicode). I already had this compiled here, so I was going to use it, but it seems my compiled version of audacity only has english support, not sure why, but on Preferences->Interface the only two options I have are System and English. So I couldn't do any real testing in this version, because it would always start in english, since this was the only language available...
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Mon Dec 06, 2010 12:26 pm

I updated to the latest svn and compiled again... I'm still only getting System and English options on Preferences... What am I missing here?
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: SVN HEAD and non-English system locales

Post by Gale Andrews » Tue Dec 07, 2010 12:21 am

bgravato wrote:OK I did some testing in Debian. I tested in Debian's official pre-compiled 1.3.12 version.
If I set audacity language to System, it will show the interface in the language set in LANG. Whatever I put in GDM_LANG doesn't affect audacity.
In my case I have both LANG and GDM_LANG set to "pt_PT.UTF-8", so Audacity will start with the interface in portuguese.
I started Audacity with LANG set to "es_ES.UTF-8" and it started in spanish.
I set GDM_LANG to "es_ES.UTF-8" (with LANG set to "pt_PT.UTF-8") and it started in portuguese.
Thanks Bruno, I don't have Ubuntu's Audacity 1.3.12 installed, so perhaps I should test that. But clearly lang is being respected by Debian's Audacity here, even when (I presume) changing LANG several times in the same OS session.
bgravato wrote:I updated to the latest svn and compiled again... I'm still only getting System and English options on Preferences... What am I missing here?
I think you may be being bitten by a bug that has not been properly fixed, or by other ways that cause Auadacity not to display its languages in Preferences.

The "bug" was discussed here:
http://forum.audacityteam.org/viewtopic ... age#p83208

In summary, it was found that If Audacity is configured with a --program-suffix option you only get "System" and "English" in Preferences unless you have a second version of Audacity installed with the same --prefix (i.e. in the same directory) and without a --program-suffix option (i.e. it's just called "audacity").

Richard then committed a change in April 2010:
http://code.google.com/p/audacity/source/detail?r=10429

"Correct handling of builds where the name of the Audacity binary is not "audacity", via the --program-prefix and --program-suffix options to configure".

Steve came across this originally when he had "audacity" installed in /usr/ and "audacity-SVN" installed in /usr/local/. He could only get "System" and "English" until he installed "audacity-SVN" in /usr/. Steve, is it possible you can retest that or a similar scenario, and Bruno, can you tell me 1) how you configured SVN HEAD and 2) if you are installing it, where to?

When I tested after that commit I configured Audacity to build with -SVN suffix, then installed that "audacity-SVN" executable into usr/local/bin (i.e. no other versions of Audacity installed). I only got "System" and "English" when I ran that "audacity-SVN" executable from the install directory. That suggests to me there is still a bug.

Also running an "audacity" executable from the build directory doesn't give anything other than "System" and "English in Interface preferences on an initialised .cfg, (i.e. even on configure without a suffix). As far as I recall, it's always been like that. I'm figuring that may be "expected" but I don't know if I would call it "optimal".



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Tue Dec 07, 2010 12:43 am

I did not install the svn version into anywhere I was running it from the building directory. Do I need to do a make install so it detects other languages?

The only version I have (properly) installed is debian's precompiled 1.3.12.

To test the effect of the env. variables I run audacity from the command line like this:

Code: Select all

LANG=de_DE.UTF-8 audacity
In this case it correctly starts audacity in german.

If I type something like:

Code: Select all

LANG=es_ES.UTF-8 GDM_LANG=de_DE.UTF-8 audacity
It will start audacity in spanish

If I type:

Code: Select all

LANG="" GDM_LANG=de_DE.UTF-8 audacity
It will start in english.

Note: this calls audacity from the path which is debian's version 1.3.12
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: SVN HEAD and non-English system locales

Post by Gale Andrews » Tue Dec 07, 2010 1:54 am

bgravato wrote:I did not install the svn version into anywhere I was running it from the building directory. Do I need to do a make install so it detects other languages?
I believe so, as per above.
bgravato wrote:The only version I have (properly) installed is debian's precompiled 1.3.12.

To test the effect of the env. variables I run audacity from the command line like this:

Code: Select all

LANG=de_DE.UTF-8 audacity
In this case it correctly starts audacity in german.

If I type something like:

Code: Select all

LANG=es_ES.UTF-8 GDM_LANG=de_DE.UTF-8 audacity
It will start audacity in spanish

If I type:

Code: Select all

LANG="" GDM_LANG=de_DE.UTF-8 audacity
It will start in english.

Note: this calls audacity from the path which is debian's version 1.3.12
Ah, OK. That largely works for me with SVN HEAD. I was setting LANG in the terminal (confirming it had worked with env) and then launching Audacity from the Applications menu. Would I expect Audacity to ignore lang in that case?

It only "largely" works as it seems a LANG that is not installed in System Preferences (e.g. Spanish in my case - I have English, French and German installed) gives an error:

Code: Select all

LANG=es_ES.UTF-8 GDM_LANG=de_DE.UTF-8 audacity
or

Code: Select all

LANG=es_ES.UTF-8 audacity
--> "Audacity error - locale " can not be set". The language has changed properly though.

Anyway I can test what I wanted to now, thanks. If you or Steve can test installing Audacity with a suffix that would still be good.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

bgravato
Posts: 2098
Joined: Wed Jan 13, 2010 8:56 pm
Operating System: Linux Debian

Re: SVN HEAD and non-English system locales

Post by bgravato » Tue Dec 07, 2010 2:04 am

Gale Andrews wrote:Ah, OK. That largely works for me with SVN HEAD. I was setting LANG in the terminal (confirming it had worked with env) and then launching Audacity from the Applications menu. Would I expect Audacity to ignore lang in that case?
That will most certainly not work :)

The environment variables are loaded on login. When you set a variable in a terminal window it will only affect that terminal window. If you change it in ~/.profile or ~/.bashrc or similar it will only take effect when you login again. You would have to terminate your x session and start a new one for it to reload the .bashrc or wherever you set it.

Opening a new terminal window can have one of two possible outcomes depending on the configuration of your terminal console app. It can either behave like a new login or inherit the environment variables from the current login session (the login session from which X is running).

To check what a variable is set to you can type:

Code: Select all

echo $LANG
in a terminal window, but that will reflect only the value of the variable on that terminal session.
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).

Locked