Bug 29920 - Selecting English doesn't work if local is diffrent from en
Selecting English doesn't work if local is diffrent from en
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
Nightly (Please specify date)
PC All
: P3 minor (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-07-05 14:27 UTC by Benjamin Francisoud
Modified: 2005-09-07 01:47 UTC (History)
0 users



Attachments
ant build.xml patch (743 bytes, patch)
2005-06-13 14:05 UTC, Benjamin Francisoud
Details | Diff
ant build.xml patch (no deprecated task) (34.82 KB, patch)
2005-06-14 11:05 UTC, Benjamin Francisoud
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Francisoud 2004-07-05 14:27:35 UTC
My local is fr (it could be ge or anything else...) 
When I open JMeter, my local is automaticly selected (which is great)
But when I select English, I don't get the English translation, It seems to 
select the default local.

It seems clearer to me that when you select a language, it overrides the 
default Local...

Using jmeter sources extracted from cvs on 2nd of july.

>java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
Comment 1 Sebb 2004-07-05 14:56:53 UTC
There are some known problems with changing locale whilst JMeter is running.

A lot of the properties are not refetched on change of locale - perhaps we 
should disable the locale change menu item until this is fixed...

So long as the locale is set before JMeter starts, it should work OK.

There are also quite a few strings which have not yet been localised.
Comment 2 Masashi Takeichi 2004-07-09 11:45:49 UTC
Additionally, message_en.properties does not exist.
So when we change locale from another locale to English,
ResourceBundle can not find the message_en.properties for English.
And any GUI components aren't updated.
 #From English to another locale, 
  at least 'Edit' menu is updated according to a new locale. 

Comment 3 Benjamin Francisoud 2005-06-13 14:05:07 UTC
Created attachment 15388 [details]
ant build.xml patch

Coping messages.properties to messages_en.properties when making jmeter jar
should solve this issue.
And no extra work is needed to support _en messages.

I provide a cvs patch for this but I didn't test it. Can someone test it is
just a few minutes test.
Comment 4 Sebb 2005-06-13 15:08:16 UTC
Have you tried changing the language in jmeter.properties?

i.e. change this:
#language=de
to this
language=en
and then starting JMeter?

What happens then?

If a language property file (e.g. messages_xx.properties) is not present, then 
Java will revert to the default messages.properties file. There should be no 
need for a messages_en.properties file.

However, JMeter does not currently properly support changes of language after 
startup.
Comment 5 Benjamin Francisoud 2005-06-14 10:08:39 UTC
True, my patch doesn't solve anything! (sorry for wasting your time).

I didn't knew there was a propertie file to set default language.
It is just what I need :) 
Thanks!
Comment 6 Benjamin Francisoud 2005-06-14 11:05:19 UTC
Created attachment 15399 [details]
ant build.xml patch (no deprecated task)

Actually there are 2 bugs related to each other:
1- selecting "en" in jmeter.properties doesn't work if jvm's locale is not en.
2- selecting "en" during runtime of jmeter doesn't update anything.

Point n°1:

Actually my patch do work! (I forgot to do ant clean before testing)

When I select language=en in jmeter.properties
And there is no messages_en.properties, it seems like:
it doesn't select messages.properties but messages_(default_locale).properties

Result: I'm always "redirect" to messages_fr.properties.

2 Solutions:
- find a way to force selection of messages.properties when "en" is selected in
jmeter.properties
- provide a messages_en.properties (like my patch does)

I let you find the better solution :)

About Point n°2:
When my patch is apply, parts of jmeter are updated during runtime but not
everything (example: menus aren't updated)
Comment 7 Sebb 2005-06-19 01:42:26 UTC
[Re comment #4 - I'd not appreciated that the default Locale properties are
checked before the base properties. Explains a lot!]

1) Copying the messages.properties file works, however more properties files can
be added at any time.

I've committed a fix to CVS that checks for the language "en" - if found (and if
the language is not already "en"), it sets the default locale to "en", so that
the base property file will be found. This seems to fix the problem. It's in the
current nightly (20050618) if you want to test it.

2) Yes, there are more places that need to react to changes of Locale.

3) And some places should NOT react - for example, the name of the currently
selected test element is changed back to the (new) default when a new language
is selected. This is wrong - only the fixed title should be changed.
Comment 8 Benjamin Francisoud 2005-09-06 19:17:28 UTC
I finally got time to check with nightly build: jakarta-jmeter-2-1.20050903

Changing Locale changes main panel message at runtime 
But not the menu bar messages (File, Edit ...) stick up with previous locale :(

Just like you said (In reply to comment #7)
> 2) Yes, there are more places that need to react to changes of Locale.

and

> 3) And some places should NOT react - for example, the name of the currently
> selected test element is changed back to the (new) default when a new language
> is selected. This is wrong - only the fixed title should be changed.

It doesn't bother me much.

My main concerne was to select (and keep) english when I start jmeter.
Unfortunatly when I select english > quit jmeter > start again
My default locale is always selected (fr).

(In reply to comment #7)
> 1) Copying the messages.properties file works, however more properties files can
> be added at any time.
copying solved this... but I get used to french ;) 
So you can solve this bug if I'm the only one interested...
Comment 9 Sebb 2005-09-06 23:20:28 UTC
See comment #4 

If you edit jmeter.properties and put

language=en

does this not now work for you in JMeter 2.1?

Comment 10 Benjamin Francisoud 2005-09-07 09:47:13 UTC
Works fine thanks !