LocaleUtils.java_dots_ to_underscores_i18n _bundles

Description

I am developing a plugin named like xxx.server.openfire.yyy, following the naming convention of a bigger project and using that as root package name for the plugin's classes.

The resource bundle for internationalization was named like the plugin, but was not found since the file had dots in its name and the classloader would look for it in folders that are not there (and won't get packaged by the ant script if you make them).

The solution was to rename the file with underscores xxx_server_openfire_yyy_i18n.properties and apply this patch.

This should not break any other plugin in the source tree.
It should be documented on the plugin developer guide.

Environment

Linux

Attachments

1

Activity

Show:

Daryl Herzmann October 27, 2014 at 6:11 PM

Daryl Herzmann April 30, 2014 at 5:43 PM

Moving unfixed 3.9.2 issues to 3.9.3 for consideration.

csh March 6, 2014 at 4:24 PM

Reviewed the patch. It should work fine.

The problem is that java.util.ResourceBundle treats dots as packages/folders:

It generates a path name from the candidate bundle name by replacing all "." characters with "/" and appending the string ".properties".

Daryl Herzmann February 13, 2014 at 9:52 PM

assigning to next release in hopes of a code review.

Fixed

Details

Assignee

Reporter

Labels

Ignite Forum URL

Components

Fix versions

Affects versions

Priority

Created November 26, 2012 at 9:03 AM
Updated October 28, 2020 at 1:26 PM
Resolved October 28, 2014 at 2:18 AM