[ 
http://jira.dspace.org/jira/browse/DS-418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11077#action_11077
 ] 

Kim Shepherd commented on DS-418:
---------------------------------

This should shed some further light:
----------

From org.dspace.app.webui.jsptag.ItemTag:

label = I18nUtil.getMessage("metadata."
                            + (style != null ? style + "." : "") + field,
                            pageContext.getRequest().getLocale());


i18nUtil has 3 getMessage methods -- one which just takes the message key and 
uses default locale, one which accepts a locale as an argument, and one which 
accepts context as an argument and extracts locale from there.

A lot of JSPUI tag classes and JSPs are inconsistent in how they're getting 
i18n keys: the example from ItemTag above means that the browser locale is 
going to take precedence, but if we changed that to

label = I18nUtil.getMessage("metadata."
                            + (style != null ? style + "." : "") + field,  c);

It should (afaict) use the Eperson's locale instead.

This has only become noticeable since we applied the patch for DS-294, since 
the Eperson locale's were always being ignored before that.

I think we should try and decide on a standard priority for determining locale, 
and try to apply it consistently throughout JSPUI.
My 2c would be: Eperson settings, then browser locale, then DSpace default.

It seems to me that using I18Util.getMessage(String key, Context c) makes the 
most sense: the HTTP request can be extracted from there anyway if the lookup 
fails and the browser locale needs to be tried second.

---------

Please speak up if I'm completely wrong :)



> i18n broken in jspui
> --------------------
>
>                 Key: DS-418
>                 URL: http://jira.dspace.org/jira/browse/DS-418
>             Project: DSpace 1.x
>          Issue Type: Bug
>          Components: JSPUI
>    Affects Versions: 1.6.0
>            Reporter: Claudia Jürgen
>             Fix For: 1.6.0
>
>         Attachments: [DS-418].patch.txt
>
>
> The i18n of the jspui is broken. Regardless of enabling multiple language or 
> not, the language chosen or set by browser or user preferences is partially 
> neglected. This varies between different pages or even within one page, 
> showing mixed language tags, e.g. in the default item display. Navigating 
> from one page to another can cause the language displayed to be changed. This 
> behavior appears in different browsers, but with variations from browser to 
> browser.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to