Issue Type: Bug Bug
Assignee: Unassigned
Components: dialogs
Created: 18/Mar/13 10:58 PM
Description:

Apache Commons Lang support only two letter with wariants

Apache org.apache.commons.lang.LocaleUtils
line 99:

if (len != 2 && len != 5 && len < 7)

{ throw new IllegalArgumentException("Invalid locale format: " + str); }

Patch ugly, but showing what is broken

  1. This patch file was generated by NetBeans IDE
  2. It uses platform neutral UTF-8 encoding and \n newlines.
      • HEAD
        +++ Modified In Working Tree
        @@ -109,8 +109,15 @@

@Override
public void i18nIze(Dialog dialog) {
+ final String configValue = dialog.getConfigValue("locale", null);
// TODO: should this be set in the aggregation state?

  • Locale locale = LocaleUtils.toLocale(dialog.getConfigValue("locale", null));
    + Locale locale;
    + try { + locale = LocaleUtils.toLocale(configValue); + }

    catch (IllegalArgumentException iae)

    { + //language ISO 639 alpha-2 or alpha-3 language code, + locale = new Locale(configValue); + }

    boolean isFallbackLanguage = i18nContentSupport.getFallbackLocale().equals(locale);

if (isEnabled() && i18nContentSupport.isEnabled() && locale != null) {

Environment: Gentoo Linux, Java 1.7.0
Project: Magnolia UI
Labels: locale i18n ISO639-2
Priority: Major Major
Reporter: Michał Kudła
Security Level: Public
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to