manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wright (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONNECTORS-420) Velocity support should include a model where there is one template for all languages, and tags that you can use for i18n strings
Date Thu, 01 Mar 2012 14:04:00 GMT

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

Karl Wright commented on CONNECTORS-420:
----------------------------------------

My proposal for internationalization is that the Velocity context will contain the following:

"Encoder" - the static encoder class, as described in the previous comment
"ResourceBundle" - the current resource bundle, looked up using the standard rules based on
the package and the locale

So, in theory, you should be able to do something like this:

{code}
<input type="hidden" name="foo" value="$Encoder.attributeEscape($ResourceBundle.getString('mystringkey'))"/>
{code}

I've committed code to the CONNECTORS-420 branch that should permit this.  Also, the resource
lookup sequence now should also look up the non-localized resource if the others are not found.
 So if "editSpecification_en_US.html" is not there, and "editSpecification_en.html" is not
there either, it will try "editSpecification.html".

There is also a new method meant for connectors to use that allows them to pass a Map<String,Object>
to the velocity rendered.  This should allow for arbitrary structures, and thus loops and
things within the template.

Together all of this should accomplish the goal, but I have not yet tried it out.

                
> Velocity support should include a model where there is one template for all languages,
and tags that you can use for i18n strings
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CONNECTORS-420
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-420
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework core
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 0.5
>
>
> The current way we use Velocity templates is to have a different template for each language.
 That's very wasteful and leads to code duplication.  We need to support a way of having one
template for all languages.

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

        

Mime
View raw message