jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Project Info Reports Plugin
  • MPIR-79

Add explicit resource bundle for English

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0.1
  • Fix Version/s: 2.1
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

The lookup strategy performed by ResourceBundle.getBundle() to find a bundle for a requested locale will prefer the bundle for the JVM's default locale over the base bundle of a family. For this reason, one MUST always provide an empty bundle for the language that is provided by the base bundle. See Sun Bug 6606475 for a prominent example of this bug.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    i18n-en.patch
    08/Jan/08 4:00 AM
    2 kB
    Benjamin Bentmann
  2. Hide
    Zip Archive
    MPIR-79.zip
    15/Jan/08 3:26 PM
    11 kB
    Benjamin Bentmann
    1. XML File
      MPIR-79\pom.xml 0.9 kB
    2. Java Source File
      MPIR-79\src\main\java\HelloWorld.java 0.8 kB
    3. File
      MPIR-79\src\main\resources\project-info-report.properties 25 kB
    4. File
      MPIR-79\src\main\resources\project-info-report_de.properties 26 kB
    Download Zip
    Show
    Zip Archive
    MPIR-79.zip
    15/Jan/08 3:26 PM
    11 kB
    Benjamin Bentmann
  3. Hide
    Zip Archive
    MPIR-79.zip
    15/Jan/08 3:05 PM
    12 kB
    Dennis Lundberg
    1. XML File
      MPIR-79/pom.xml 0.9 kB
    2. Java Source File
      MPIR-79/src/main/java/HelloWorld.java 0.8 kB
    3. File
      MPIR-79/.../project-info-report.properties 25 kB
    4. File
      MPIR-79/.../project-info-report_de.properties 26 kB
    Download Zip
    Show
    Zip Archive
    MPIR-79.zip
    15/Jan/08 3:05 PM
    12 kB
    Dennis Lundberg

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. PLX-257 [i18n] Default base bundle not handle correctly

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Benjamin Bentmann added a comment - 08/Jan/08 4:35 AM

If you want to exploit this bug, just run

mvn site -Dlocales=de,en

Note that "de" is placed first to denote the default locale.

Show
Benjamin Bentmann added a comment - 08/Jan/08 4:35 AM If you want to exploit this bug, just run
mvn site -Dlocales=de,en
Note that "de" is placed first to denote the default locale.
Hide
Permalink
Dennis Lundberg added a comment - 14/Jan/08 4:07 PM

It's not clear to me what you are expecting when you run the command above.

Setting the default locale to "de" should render the reports in German, right? Or am I missing something?

I've seen your patches for this in several plugin, and I'm willing to apply them. I just want to understand the problem they are solving

Show
Dennis Lundberg added a comment - 14/Jan/08 4:07 PM It's not clear to me what you are expecting when you run the command above. Setting the default locale to "de" should render the reports in German, right? Or am I missing something? I've seen your patches for this in several plugin, and I'm willing to apply them. I just want to understand the problem they are solving
Hide
Permalink
Benjamin Bentmann added a comment - 14/Jan/08 4:52 PM

The illustrated command should produce the site output in two different locales, namely German and English (see also Site Guide, Internationalization). Now, when a report plugin does not contain a dedicated bundle for English, the second site output will be using German again instead of English. German being the default locale does not mean that I want all sites in German

I really suggest you go and call Maven as illustrated. Then just browse the two generated sites. German (as being default) should hang around just unter target/site, while the English site lies under target/site/en. Once you see the "English" site yourself, it will all get clear... or not, depending on your knowledge about German

Show
Benjamin Bentmann added a comment - 14/Jan/08 4:52 PM The illustrated command should produce the site output in two different locales, namely German and English (see also Site Guide, Internationalization). Now, when a report plugin does not contain a dedicated bundle for English, the second site output will be using German again instead of English. German being the default locale does not mean that I want all sites in German I really suggest you go and call Maven as illustrated. Then just browse the two generated sites. German (as being default) should hang around just unter target/site, while the English site lies under target/site/en. Once you see the "English" site yourself, it will all get clear... or not, depending on your knowledge about German
Hide
Permalink
Vincent Siveton added a comment - 14/Jan/08 10:06 PM

Dennis,
I think also that Benjamin is right. See the related issue.

Show
Vincent Siveton added a comment - 14/Jan/08 10:06 PM Dennis, I think also that Benjamin is right. See the related issue.
Hide
Permalink
Lukas Theussl added a comment - 15/Jan/08 2:28 AM

I also agree. I was about to apply some of Benjamin's patches but got halted by the encoding question, see MPMD-71 and MSITE-287, can someone clarify this?

Show
Lukas Theussl added a comment - 15/Jan/08 2:28 AM I also agree. I was about to apply some of Benjamin's patches but got halted by the encoding question, see MPMD-71 and MSITE-287, can someone clarify this?
Hide
Permalink
Dennis Lundberg added a comment - 15/Jan/08 3:05 PM

Here's a very small project that borrows the resource files from MPIR.

It sets the default locale to the first command line parameter. Then it retrieves a resouce bundle for the English locale. Finally it gets a string from the resouce bundle and prints it.

Run it using these commands:

mvn package
java -jar target\MPIR-79-1.0-SNAPSHOT.jar <defaultLocale>

I have not been able to get it to output anything else that the English text "About", no matter what I throw at it as the default locale. There must be something that I simply do not understand.

Show
Dennis Lundberg added a comment - 15/Jan/08 3:05 PM Here's a very small project that borrows the resource files from MPIR. It sets the default locale to the first command line parameter. Then it retrieves a resouce bundle for the English locale. Finally it gets a string from the resouce bundle and prints it. Run it using these commands:
mvn package
java -jar target\MPIR-79-1.0-SNAPSHOT.jar <defaultLocale>
I have not been able to get it to output anything else that the English text "About", no matter what I throw at it as the default locale. There must be something that I simply do not understand.
Hide
Permalink
Benjamin Bentmann added a comment - 15/Jan/08 3:26 PM

It sets the default locale to the first command line parameter.

No, it doesn't You simply assign a variable called "defaultLocale" but the default locale is maintained by the java.util.Locale class. One needs to call setDefault() in order to effectively change it.

I attached a slightly modified version of your test project. The modified code also prints out the effective locale of the bundle that has been retrieved (bundleLocale). Here's my log output:

M:\MPIR-79>java -jar target\MPIR-79-1.0-SNAPSHOT.jar de
defaultLocale=de
locale=en
bundleLocale=de
Willkommen bei

Can I convice you this way?

Show
Benjamin Bentmann added a comment - 15/Jan/08 3:26 PM
It sets the default locale to the first command line parameter.
No, it doesn't You simply assign a variable called "defaultLocale" but the default locale is maintained by the java.util.Locale class. One needs to call setDefault() in order to effectively change it. I attached a slightly modified version of your test project. The modified code also prints out the effective locale of the bundle that has been retrieved (bundleLocale). Here's my log output:
M:\MPIR-79>java -jar target\MPIR-79-1.0-SNAPSHOT.jar de
defaultLocale=de
locale=en
bundleLocale=de
Willkommen bei
Can I convice you this way?
Hide
Permalink
Dennis Lundberg added a comment - 15/Jan/08 3:57 PM

DOH!

Thanks for being patient with me. I'll start applying patches now...

Show
Dennis Lundberg added a comment - 15/Jan/08 3:57 PM DOH! Thanks for being patient with me. I'll start applying patches now...
Hide
Permalink
Benjamin Bentmann added a comment - 15/Jan/08 4:06 PM

Never mind, I always appreciate a good discussion as it might provide insights for other readers as well.

Show
Benjamin Bentmann added a comment - 15/Jan/08 4:06 PM Never mind, I always appreciate a good discussion as it might provide insights for other readers as well.
Hide
Permalink
Dennis Lundberg added a comment - 15/Jan/08 4:25 PM

Patch applied in r612253 and a new SNAPSHOT has been deployed.
Thank you!

Show
Dennis Lundberg added a comment - 15/Jan/08 4:25 PM Patch applied in r612253 and a new SNAPSHOT has been deployed. Thank you!

People

  • Assignee:
    Dennis Lundberg
    Reporter:
    Benjamin Bentmann
Vote (0)
Watch (0)

Dates

  • Created:
    08/Jan/08 4:00 AM
    Updated:
    15/Jan/08 4:25 PM
    Resolved:
    15/Jan/08 4:25 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.