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 2009/04/22 13:27:47 UTC

[jira] Created: (FELIX-1051) Localize the web console

Localize the web console
------------------------

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


We should think about localizing the web console.

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


[jira] Issue Comment Edited: (FELIX-1051) Localize the web console

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804083#action_12804083 ] 

Felix Meschberger edited comment on FELIX-1051 at 1/23/10 2:08 PM:
-------------------------------------------------------------------

I have applied a variation of the patch in Rev. 902097

All requests handled by web console plugins are now wrapped by response wrapper, which installs a Writer filter if the response is a text/html response. This writer filter recognizes variables of the pattern ${name} and tries to replace that part of the output with another string:

    * If a variable of that name exists, the value of that variable is used.
    * Otherwise if a resource bundle provides a translated string for the name, that string is used.
    * Otherwise the name itself is just placed in the output

The resource bundle is created using bundle localization of the plugin-providing bundle and bundle localization of the Web Console bundle itself. To get at the localisation resources, the Bundle-Localization bundle header is used according to Section 3.10 Localization in the Core Specification. Any localization in the providing bundle takes preference on any localization in the web console bundle.

The variable resolution is provided by the plugin at request time. Currently the plugin is checked whether it implements the new VariabledResolver interface and if so, the plugin is directly called to resovle variables. This works fine for "static" variables, but fails completely for request-time variables like for example a bundle list to be expanded for the current request. Some more thinking has to go in there to be able to make this request-dependent.....

      was (Author: fmeschbe):
    I have applied a variation of the patch in Rev. 

All requests handled by web console plugins are now wrapped by response wrapper, which installs a Writer filter if the response is a text/html response. This writer filter recognizes variables of the pattern ${name} and tries to replace that part of the output with another string:

    * If a variable of that name exists, the value of that variable is used.
    * Otherwise if a resource bundle provides a translated string for the name, that string is used.
    * Otherwise the name itself is just placed in the output

The resource bundle is created using bundle localization of the plugin-providing bundle and bundle localization of the Web Console bundle itself. To get at the localisation resources, the Bundle-Localization bundle header is used according to Section 3.10 Localization in the Core Specification. Any localization in the providing bundle takes preference on any localization in the web console bundle.

The variable resolution is provided by the plugin at request time. Currently the plugin is checked whether it implements the new VariabledResolver interface and if so, the plugin is directly called to resovle variables. This works fine for "static" variables, but fails completely for request-time variables like for example a bundle list to be expanded for the current request. Some more thinking has to go in there to be able to make this request-dependent.....
  
> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Commented: (FELIX-1051) Localize the web console

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805519#action_12805519 ] 

Felix Meschberger commented on FELIX-1051:
------------------------------------------

Added some basic documentation for this functionality at http://felix.apache.org/site/web-console-output-templating.html.

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Resolved: (FELIX-1051) Localize the web console

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

Felix Meschberger resolved FELIX-1051.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: webconsole-3.0.0

With basic implementation for internationalization and the additional work in FELIX-1988, this issue has been fixed.

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Commented: (FELIX-1051) Localize the web console

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805506#action_12805506 ] 

Felix Meschberger commented on FELIX-1051:
------------------------------------------

In Rev 903634 fixed the VariableResolver issue: Now the VariableResolver is stored as a request attribute and retrieved from the request at the time the ServletResponse.getWriter() method is called. Thus the plugin must make sure to at least provide the VariableResolver before getting the writer to send the response.

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Updated: (FELIX-1051) Localize the web console

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

Felix Meschberger updated FELIX-1051:
-------------------------------------

    Attachment: FELIX-1051.patch

Attaching a prototype of the proposed change.

This prototype contains the bundle.properties file providing the default strings (actually, just the commented list of strings) and a german translation of the strings in bundle_de.properties. The translations are provided with a special ResourceBundle implementation in the new i18n package.

Finally all requests are handled with a response wrapper filtering ${} strings to their translations.

This prototype does not support translations from service bundles, yet.

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Commented: (FELIX-1051) Localize the web console

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800649#action_12800649 ] 

Felix Meschberger commented on FELIX-1051:
------------------------------------------

I have been thinking about the localization a bit and here is my proposal:

* Localization is based on Java ResourceBundle (actually PropertyResourceBundle)
* The web console loads the PropertyResourceBundles itself to be able to control caching
* The localization base file is set using the Bundle-Localization header
* The localization key is used as the value if a resource bundle does not have a translation
* The web console wraps the response with a filtering writer which applies localization
* The actual ResourceBundle used for the filter is a combination of the web console localization ResourceBundles and the plugin provider bundle localization. The key resolution just looks in the plugin bundle's own resource bundle, then in the web console resource bundle and finally falls back to using the key if no translation can be found.
* The output may contain localization strings of the form ${key} which are replaced by the translation (or key if there is non)
* The "${" sequence may be escaped with "\${", "\" is escaped with "\\"

Example:

1. The web console has localizations in OSGI-INF/l10n/webconsole and provides the webconsole.properties file

2. A bundle provides bulgarian translations of the web console
    --> the bundle attaches as a fragment to the web console
    --> the bundle has a OSGI-INF/l10n/webconsole_bg.properties file

3. A plugin bundle provides localization for its own bundles and defines the Bundle-Localization header providing a default file.

4. A plugin generates localizable output
    --> This is a ${localizable} string

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>
> We should think about localizing the web console.

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


[jira] Assigned: (FELIX-1051) Localize the web console

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

Felix Meschberger reassigned FELIX-1051:
----------------------------------------

    Assignee: Felix Meschberger

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Closed: (FELIX-1051) Localize the web console

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

Carsten Ziegeler closed FELIX-1051.
-----------------------------------


> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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


[jira] Commented: (FELIX-1051) Localize the web console

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804083#action_12804083 ] 

Felix Meschberger commented on FELIX-1051:
------------------------------------------

I have applied a variation of the patch in Rev. 

All requests handled by web console plugins are now wrapped by response wrapper, which installs a Writer filter if the response is a text/html response. This writer filter recognizes variables of the pattern ${name} and tries to replace that part of the output with another string:

    * If a variable of that name exists, the value of that variable is used.
    * Otherwise if a resource bundle provides a translated string for the name, that string is used.
    * Otherwise the name itself is just placed in the output

The resource bundle is created using bundle localization of the plugin-providing bundle and bundle localization of the Web Console bundle itself. To get at the localisation resources, the Bundle-Localization bundle header is used according to Section 3.10 Localization in the Core Specification. Any localization in the providing bundle takes preference on any localization in the web console bundle.

The variable resolution is provided by the plugin at request time. Currently the plugin is checked whether it implements the new VariabledResolver interface and if so, the plugin is directly called to resovle variables. This works fine for "static" variables, but fails completely for request-time variables like for example a bundle list to be expanded for the current request. Some more thinking has to go in there to be able to make this request-dependent.....

> Localize the web console
> ------------------------
>
>                 Key: FELIX-1051
>                 URL: https://issues.apache.org/jira/browse/FELIX-1051
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-1.2.8
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>         Attachments: FELIX-1051.patch
>
>
> We should think about localizing the web console.

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