incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Pablo Santos Rodríguez (JIRA) <j...@apache.org>
Subject [jira] [Commented] (JSPWIKI-143) Unlocalized messages in user management
Date Sat, 12 Jan 2013 13:14:12 GMT

    [ https://issues.apache.org/jira/browse/JSPWIKI-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13551921#comment-13551921
] 

Juan Pablo Santos Rodríguez commented on JSPWIKI-143:
-----------------------------------------------------

Both UserDatabase receive a WikiEngine instance on their initialize() methods, we could store
it to get access to the I18nManager.

Regarding i18n as a whole (=not only on those classes), another couple of approaches could
be used:

* Transforming InternationalizationManager into an enum, so it can be accesed without a WikiEngine
reference, dropping WikiEngine#getInternationalizationManager()

* Accessing the ResourceBundle directly, as it's done for instance on VariableManager:

{code:title=VariableManager.java, lines 484-490}
  public String getUsername()
  {
      Principal wup = m_context.getCurrentUser();

      ResourceBundle rb = m_context.getBundle( InternationalizationManager.CORE_BUNDLE );
      return wup != null ? wup.getName() : rb.getString( "varmgr.not.logged.in" );
  }
{code}

I'm more inclined to using the first approach, though. Thoughts?
                
> Unlocalized messages in user management
> ---------------------------------------
>
>                 Key: JSPWIKI-143
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-143
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.0
>            Reporter: Florian Holeczek
>            Priority: Minor
>             Fix For: 3.0
>
>
> When trying to create a new user with an existing name, the page says: 'The login name
'flo' is already taken.'
> I guess it's an Exception from UserManager. It's the same problem with full name (a few
lines down).
> Maybe there are the following mesages unlocalized, too:
> JDBCUserDatabase:
> throw new DuplicateUserException( "Cannot rename: the login name '" + newName + "' is
already taken." );
> XMLUserDatabase:
> throw ( new DuplicateUserException( "Cannot rename: the login name '" + newName + "'
is already taken." ) );

--
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

Mime
View raw message