Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change language to pl_PL #2229

Closed
asfimport opened this issue Apr 30, 2009 · 4 comments
Closed

Unable to change language to pl_PL #2229

asfimport opened this issue Apr 30, 2009 · 4 comments

Comments

@asfimport
Copy link
Collaborator

kamil (Bug 47127):
Hi!

I received an error while trying to run JMeter:
An error occurred: Unable to change language to pl_PL

The cause was in line 325 in class JMeterUtils:

resBund.getLocale().equals(loc)

resBund.getLocale()
 (java.util.Locale) pl
loc
 (java.util.Locale) pl_PL

I've modified it to have JMeter run in my language:

from: resBund.getLocale().equals(loc)
to: resBund.getLocale().getLanguage().equals(loc.getLanguage())

resBund.getLocale().getLanguage()
(java.lang.String) pl

loc.getLanguage()
(java.lang.String) pl

Now it's equal, no exception is thrown, and I'm happy to see JMeter on my screen. I don't know if it's the best solution of such problem. Maybe some other way of comparing should be used? Something from java.util.Locale? Maybe you'll have a better idea, something more elegant?

Severity: minor
OS: Windows XP

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Why are you setting the Locale to pl_PL and not just pl?

Is that what your JVM is set to or have you defined the JMeter "language" property?

Using "pl" works fine in the nightly builds.

@asfimport
Copy link
Collaborator Author

kamil (migrated from Bugzilla):
Hi Sebb,

I'm selecting current locale in Start > Control Panel > Regional Settings > first tab: Regional Options (and Advanced). I'm not passing JVM options -Duser.language=pl -Duser.region=PL to alter default (polish) locale, which I've set in

What variable isDefault actually stores is information 'isEnglish' (check line #308). That may puzzle a bit.

I've checked three computers (two Windows XP PL and one Windows 2000 Server PL) and Locale.getDefault() returns: Default locale: pl_PL.

Cordially,
Kamil

................................
// Code used to check for default locale
import java.util.Locale;

public class PrintLoc {
public static void main(String[] args) {
System.out.println("Default locale: " + Locale.getDefault());
}
}

@asfimport
Copy link
Collaborator Author

kamil (migrated from Bugzilla):
I have this trouble only in Eclipse. When I've downloaded package from your website and saved polish property file in proper place, it works fine.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
OK, I see.

What I have done is to add a further check.

If the Locales don't match exactly, then check if they match when getLanguage()
is used. If so, log a warning (because the requested Locale was not available)
but continue.

This corresponds better with the behaviour of Resource.getBundle().

See:

URL: http://svn.apache.org/viewvc?rev=770174&view=rev
Log:
#2229 - Unable to change language to pl_PL

This will be in the nightlies from version r770174.

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant