Changing language of Bazaar Explorer is not working

6 views
Skip to first unread message

Dedeco

unread,
Mar 6, 2012, 7:14:55 AM3/6/12
to QBzr
Hello,

today I was doing some tests when I tried to change the language of
Bazaar Explorer. I was trying to change from Portuguese (BR) to English.
When I clicked on the "English" option I got the usual message box
saying to restart bazaar. But after I close and reopen it, the PT-BR
language is still applied. I have tried this several times, as well as
switching to other languages as well. PT-BR is the standard on my system.

How can I get some more information on this issue?

Alexander Belchenko

unread,
Mar 6, 2012, 7:41:26 AM3/6/12
to qb...@googlegroups.com
Dedeco пишет:

Check bazaar.conf for language setting. Has it set to correct language
code (en)?

Also, if you look at explorer/lib/i18n.py you may find the following code:

def get_current_locale():
if not os.environ.get('LANGUAGE'):
from bzrlib import config
lang = config.GlobalConfig().get_user_option('language')
if lang:
os.environ['LANGUAGE'] = lang
return lang
if sys.platform == 'win32':
_check_win32_locale()
for i in ('LANGUAGE','LC_ALL','LC_MESSAGES','LANG'):
lang = os.environ.get(i)
if lang:
return lang
return None

It seems like we force specific language from bazaar.conf only if user
does not have LANGUAGE environment variable set. Do you have this
environment variable set? Is it normal behavior for your OS?

Maybe we need to omit the check for presence of LANGUAGE, and always use
the settings from bazaar.conf. If so then please file a bug report
against bzr-explorer.

--
All the dude wanted was his rug back

Dedeco

unread,
Mar 7, 2012, 10:14:12 AM3/7/12
to qb...@googlegroups.com
I have sent this message yesterday, but somehow it didn't appear on the list, even after two tries. And today another message didn't ever appear, so I am trying from a different config. :/




Yes, ~/.bazaar/bazaar.conf has language changed to whatever I set.

But as we can see in the source code, bzr-explorer will prefer the enviroment variable.

I use Ubuntu, and it normally has this enviroment variable set. I can guess that many other *nix will have it too. However, multi-language programs must not be locked by this.


Maybe we need to omit the check for presence of LANGUAGE, and always use the settings from bazaar.conf. If so then please file a bug report against bzr-explorer.
I have a question: if I never changed the language setting in bzr-explorer, would it write "language = ..." on bazaar.conf (and other language configuration files)? In the first run or absence of it, for example?

In my opinion, this may be better for get_current_locale:

(assuming that bazaar.conf: language may be unset)

1- if language is set in bazaar.conf, use it

2- else, get it from enviroment variable

3- or otherwise get it from the system

4- do not set bazaar.conf: language if it wasn't set (and bazaar absorbs when user changes his system's locale; but if he changed it before to something different, he probably may not complain about bazaar being different)

I can change the code to prefer the user settings from the env. var., but this will let us with the small issue (?) for step 4 above.

I will file the bug.

Dedeco

unread,
Mar 6, 2012, 12:25:48 PM3/6/12
to qb...@googlegroups.com
Yes, ~/.bazaar/bazaar.conf has language changed to whatever I set.

But as we can see in the source code, bzr-explorer will prefer the enviroment variable.

I use Ubuntu, and it normally has this enviroment variable set. I can guess that many other *nix will have it too. However, multi-language programs must not be locked by this.

Maybe we need to omit the check for presence of LANGUAGE, and always use the settings from bazaar.conf. If so then please file a bug report against bzr-explorer.
I have a question: if I never changed the language setting in bzr-explorer, would it write "language = ..." on bazaar.conf (and other language configuration files)? In the first run or absence of it, for example?

In my opinion, this may be better:


(assuming that bazaar.conf: language may be unset)

1- if language is set in bazaar.conf, use it

2- else, get it from enviroment variable

3- or otherwise get it from the system

4- do not set bazaar.conf: language if it wasn't set (and bazaar absorbs when user changes his system's locale; but if he changed it before to something different, he probably may not complain about bazaar being different)

I can change the code to prefer the user settings from the env. var., but this will let us with the small issue (?) for step 4 above. 4 does not apply to get_current_locale function.


I will file the bug.



Em 06-03-2012 09:41, Alexander Belchenko escreveu:

Dedeco

unread,
Mar 6, 2012, 10:09:55 AM3/6/12
to qb...@googlegroups.com
Yes, ~/.bazaar/bazaar.conf has language changed to whatever I set.

But as we can see in the source code, bzr-explorer will prefer the enviroment variable.

I use Ubuntu, and it normally has this enviroment variable set. I can guess that many other *nix will have it too. However, multi-language programs must not be locked by this.

Maybe we need to omit the check for presence of LANGUAGE, and always use the settings from bazaar.conf. If so then please file a bug report against bzr-explorer.
I have a question: if I never changed the language setting in bzr-explorer, would it write "language = ..." on bazaar.conf (and other language configuration files)? In the first run or absence of it, for example?

In my opinion, this may be better for get_current_locale:


(assuming that bazaar.conf: language may be unset)

1- if language is set in bazaar.conf, use it

2- else, get it from enviroment variable

3- or otherwise get it from the system

4- do not set bazaar.conf: language if it wasn't set (and bazaar absorbs when user changes his system's locale; but if he changed it before to something different, he probably may not complain about bazaar being different)

I can change the code to prefer the user settings from the env. var., but this will let us with the small issue (?) for step 4 above.

I will file the bug.



Em 06-03-2012 09:41, Alexander Belchenko escreveu:

Alexander Belchenko

unread,
Mar 15, 2012, 6:23:36 AM3/15/12
to qb...@googlegroups.com
Dedeco пишет:
> Yes, /~/.bazaar/bazaar.conf/ has /language/ changed to whatever I set.

>
> But as we can see in the source code, bzr-explorer will prefer the
> enviroment variable.
>
> I use Ubuntu, and it normally has this enviroment variable set. I can
> guess that many other *nix will have it too. However, multi-language
> programs must not be locked by this.
>
>> Maybe we need to omit the check for presence of LANGUAGE, and always
>> use the settings from bazaar.conf. If so then please file a bug report
>> against bzr-explorer.
> I have a question: if I never changed the language setting in
> bzr-explorer, would it write "language = ..." on bazaar.conf (and other
> language configuration files)? In the first run or absence of it, for
> example?

No, never.

> In my opinion, this may be better for get_current_locale:
>

> (assuming that /bazaar.conf: language/ may be unset)


>
> 1- if language is set in bazaar.conf, use it
>
> 2- else, get it from enviroment variable
>
> 3- or otherwise get it from the system

OK, that's almost how it works now.

> 4- do not set /bazaar.conf: language/ if it wasn't set (and bazaar

> absorbs when user changes his system's locale; but if he changed it
> before to something different, he probably may not complain about bazaar
> being different)

I don't understand this.

> I can change the code to prefer the user settings from the env. var.,
> but this will let us with the small issue (?) for step 4 above.
>
> I will file the bug.

OK, we have already had your patch merged. I still don't understand your
comment about 4.

Dedeco

unread,
Mar 15, 2012, 9:08:24 AM3/15/12
to qb...@googlegroups.com

Maybe we need to omit the check for presence of LANGUAGE, and always use the settings from bazaar.conf. If so then please file a bug report against bzr-explorer.
I have a question: if I never changed the language setting in bzr-explorer, would it write "language = ..." on bazaar.conf (and other language configuration files)? In the first run or absence of it, for example?
No, never.

4- do not set /bazaar.conf: language/ if it wasn't set (and bazaar absorbs when user changes his system's locale; but if he changed it before to something different, he probably may not complain about bazaar being different)

I don't understand this.

I can change the code to prefer the user settings from the env. var., but this will let us with the small issue (?) for step 4 above.

I will file the bug.

OK, we have already had your patch merged. I still don't understand your comment about 4.


Alexander, you said that bazaar only writes the configuration line "languague=..." when user changes the language. This is what 4 is about (but then there is no issue).

A fresh installation does not have any "language=..." in bazaar configuration. So, if the user changes his system's localization, bazaar will reflect the changes.

On the other hand, bazaar won't reflect changes in system localization if the used changed language configuration before. The user will have "language=..." in his bazaar configuration files that overrides the system language.


Alexander Belchenko

unread,
Mar 15, 2012, 9:17:09 AM3/15/12
to qb...@googlegroups.com
Dedeco пишет:

>
>>>> Maybe we need to omit the check for presence of LANGUAGE, and always
>>>> use the settings from bazaar.conf. If so then please file a bug
>>>> report against bzr-explorer.
>>> I have a question: if I never changed the language setting in
>>> bzr-explorer, would it write "language = ..." on bazaar.conf (and
>>> other language configuration files)? In the first run or absence of
>>> it, for example?
>> No, never.
>
>>> 4- do not set /bazaar.conf: language/ if it wasn't set (and bazaar
>>> absorbs when user changes his system's locale; but if he changed it
>>> before to something different, he probably may not complain about
>>> bazaar being different)
>>
>> I don't understand this.
>>
>>> I can change the code to prefer the user settings from the env. var.,
>>> but this will let us with the small issue (?) for step 4 above.
>>>
>>> I will file the bug.
>>
>> OK, we have already had your patch merged. I still don't understand
>> your comment about 4.
>
> Alexander, you said that bazaar only writes the configuration line
> "languague=..." when user changes the language. This is what 4 is about
> (but then there is no issue).
>
> A fresh installation does not have any "language=..." in bazaar
> configuration. So, if the user changes his system's localization, bazaar
> will reflect the changes.

Yes, bzr-explorer will use system settings, unless we have language set
in bazaar.conf. This is intended behavior. If I want to force explorer
to use some specific language for testing or if I want to learn new
language :-) then explorer should follow my wish. If I change the system
settings explorer won't notice this, because it doesn't remember what
did you have before.

> On the other hand, bazaar won't reflect changes in system localization
> if the used changed language configuration before. The user will have
> "language=..." in his bazaar configuration files that overrides the
> system language.

Yes, that's correct. Once you have selected language, there is no way to
come back, you have to delete this option (manually).

Reply all
Reply to author
Forward
0 new messages