You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/04/09 14:43:50 UTC

[jira] Created: (FELIX-2267) Improved locale detection

Improved locale detection
-------------------------

                 Key: FELIX-2267
                 URL: https://issues.apache.org/jira/browse/FELIX-2267
             Project: Felix
          Issue Type: Improvement
          Components: Web Console
    Affects Versions: webconsole-3.0.0
            Reporter: Carsten Ziegeler


Currently the locale is detected by checking the request; I think we should improve this:
- a user should be able to switch the language
- there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.

So what about a new configuration value for the web console which defines the default language - this is optional.

The language detection might then go like this:
- check for a cookie with a language
- check the user for a configured language (once we have user admin support)
- if a language is configured for the web console, use this
- use request locale


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856010#action_12856010 ] 

Valentin Valchev commented on FELIX-2267:
-----------------------------------------

Unfortunately this way a lot of temporary object will be created since we need a wrapper object for each request the client makes.


> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856341#action_12856341 ] 

Carsten Ziegeler commented on FELIX-2267:
-----------------------------------------

Great, your suggested patch looks good to me - maybe we should treat potential GUI changes for changing the locale through the cookie in a different issue.

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>         Attachments: conflocale.patch
>
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856009#action_12856009 ] 

Carsten Ziegeler commented on FELIX-2267:
-----------------------------------------

I guess the easiest implementation is then to have kind of a servlet filter or preprocessor which simply wraps the request object with a new implementation that overrides getLocale()
As this request object is then used by everyone it should work ootb without requiring to change the plugins

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856041#action_12856041 ] 

Valentin Valchev commented on FELIX-2267:
-----------------------------------------

Ok, I'll make a prototype that utilizes a request wrapper.

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Resolved: (FELIX-2267) Improved locale detection

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev resolved FELIX-2267.
-------------------------------------

         Assignee: Valentin Valchev
    Fix Version/s: webconsole-3.0.2
       Resolution: Fixed

Patch committed and create new issue for user-interface change:
https://issues.apache.org/jira/browse/FELIX-2277

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: conflocale.patch
>
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Updated: (FELIX-2267) Improved locale detection

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2267:
------------------------------------

    Attachment: conflocale.patch

The provided patch allows the locale to be configured by:

1. cookie, named 'felix.webconsole.locale'
2. configuration property

and if none of the above is set, will fall-back to the original request locale.

It wraps the request, so all plugins automatically gets the pre-configured locale.


However, the patch doesn't provide GUI changes for setting the cookie.

So WDYT?

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>         Attachments: conflocale.patch
>
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856013#action_12856013 ] 

Carsten Ziegeler commented on FELIX-2267:
-----------------------------------------

Now, I don't think that this is really an issue - it is one simple wrapper object per request

> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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

        

[jira] Commented: (FELIX-2267) Improved locale detection

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855993#action_12855993 ] 

Valentin Valchev commented on FELIX-2267:
-----------------------------------------

I was investigating a possible solution for the problem, and tried to make at least configurable (CM) locale available.

It seems that the problem is rather complex and would require quite a lot, really a lot of changes not only to the web console but also to the plugins.

It is quite easy to load the resource files in the configured language, and generally this will work. However some plugins provide additional localization. As example:

1. config plugin uses the request locale to obtain meta-type information.
2. services & bundles plugins use request locale to get localized bundle name
3. license & bundes plugins use request locale to sort bundle names in locale-specific way.
4. bundle plugin gets localized bundle headers, again using the request locale.

This means, that the plugin should be also aware of the configured locale. We can add new request attribute but we cannot force the plugin to use 
request.getAttribute(LOCALE_PARAM)
instead of
request.getLocale();


> Improved locale detection
> -------------------------
>
>                 Key: FELIX-2267
>                 URL: https://issues.apache.org/jira/browse/FELIX-2267
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Carsten Ziegeler
>
> Currently the locale is detected by checking the request; I think we should improve this:
> - a user should be able to switch the language
> - there should be a possibility to configure a default language - I guess there are situations where localization of the web console is simply not desired.
> So what about a new configuration value for the web console which defines the default language - this is optional.
> The language detection might then go like this:
> - check for a cookie with a language
> - check the user for a configured language (once we have user admin support)
> - if a language is configured for the web console, use this
> - use request locale

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