You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ulrich Stärk (JIRA)" <de...@tapestry.apache.org> on 2008/06/16 00:21:45 UTC

[jira] Created: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Add localization to translators to allow for localized display/entering of values
---------------------------------------------------------------------------------

                 Key: TAPESTRY-2457
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
             Project: Tapestry
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.0.14
            Reporter: Ulrich Stärk


Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ulrich Stärk updated TAPESTRY-2457:
-----------------------------------

    Attachment: patch.txt

This patch adds support for localized translators by extending the Translator interface. It also introduces a new SymbolConstant tapestry.localized-translators which defaults to false to indicate whether localized translators should be used or not. The FloatTranslator and DoubleTranslator have been updated to parse and display floating point numbers in the client's locale (if so desired). FieldValidationSupportImpl has been altered to use the old (not localized) translators or if tapestry.localized-translators is set to true, to use the localized versions of the translators.

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Ulrich Stärk
>         Attachments: patch.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ulrich Stärk updated TAPESTRY-2457:
-----------------------------------

    Attachment: TAPESTRY-2457.txt

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Ulrich Stärk
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Andreas Andreou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645474#action_12645474 ] 

Andreas Andreou commented on TAP5-211:
--------------------------------------

Regarding the client side if this, i too used parts of dojo when doing tacos-jquery...

In http://tacos.svn.sourceforge.net/viewvc/tacos/tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js?view=markup
the most important parts are tapestry.form.validation.FORMAT_TABLE (line 1227, holds info for each locale ) and the various validation methods in tapestry.form.validation (line 786)


> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.1.0.0
>            Reporter: Ulrich Stärk
>         Attachments: LocalizedTranslatorSource.zip, TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ulrich Stärk updated TAP5-211:
------------------------------

    Attachment: LocalizedTranslatorSource.zip

Here is a localized TranslatorSource and a localized double translator I wrote, configure them like this in your module:

public static LocalizedTranslatorSource buildLocalizedTranslatorSource(
        @Inject @Symbol("tapestry.supported-locales") final String supportedLocales,
        @InjectService("ThreadLocale") ThreadLocale threadLocale)
{
    HashMap<Locale, Collection<Translator>> configuration = new HashMap<Locale, Collection<Translator>>();

    for (String locale : supportedLocales.split(","))
    {
        Locale l = new Locale(locale);

        Collection<Translator> s = new HashSet<Translator>();

        s.add(new LocalizedDoubleTranslator(l));
        s.add(new StringTranslator());
        s.add(new ByteTranslator());
        s.add(new IntegerTranslator());
        s.add(new LongTranslator());
        s.add(new FloatTranslator());
        s.add(new ShortTranslator());

        configuration.put(l, s);
    }
    return new LocalizedTranslatorSource(configuration, threadLocale);
}

public static void contributeAliasOverrides(Configuration<AliasContribution> configuration,
        @InjectService("LocalizedTranslatorSource")
        LocalizedTranslatorSource localizedTranslatorSource)
{
    configuration.add(AliasContribution.create(
            TranslatorSource.class,
            localizedTranslatorSource));
}

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Ulrich Stärk
>            Assignee: Howard M. Lewis Ship
>         Attachments: LocalizedTranslatorSource.zip, TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ulrich Stärk updated TAPESTRY-2457:
-----------------------------------

    Attachment:     (was: patch.txt)

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Ulrich Stärk
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-211:
--------------------------------------

             Assignee:     (was: Howard M. Lewis Ship)
    Affects Version/s:     (was: 5.0.15)
                       5.1.0.0

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.1.0.0
>            Reporter: Ulrich Stärk
>         Attachments: LocalizedTranslatorSource.zip, TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Issue Comment Edited: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Joakim Olsson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662784#action_12662784 ] 

argoyle edited comment on TAP5-211 at 1/11/09 7:07 AM:
-------------------------------------------------------------

I just attached my crude implementation of locale-aware double- and float-translators. The implementation also contains client-side locale-aware validation by sending the regular expression used to validate decimal numbers in the Tapestry.Init-call.

Maybe it can be of any use when creating a "real" solution to the problem.

      was (Author: argoyle):
    My crude implementation of locale-aware double- and float-translators. The implementation also contains client-side locale-aware validation by sending the regular expression used to validate decimal numbers in the Tapestry.Init-call.
  
> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.1.0.0
>            Reporter: Ulrich Stärk
>         Attachments: LocalizedTranslatorSource.zip, TAPESTRY-2457.txt, tapestry-locale-float-validation.diff
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Posted by "Ernest Monklitch (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608530#action_12608530 ] 

Ernest Monklitch commented on TAPESTRY-2457:
--------------------------------------------

This really should be corrected. Please let user override default translators, as this would fix the problem.

Howard: is there good reason why developers aren't allowed to override default translators?

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Ulrich Stärk
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643438#action_12643438 ] 

Ulrich Stärk commented on TAP5-211:
-----------------------------------

The majority of the world (see http://en.wikipedia.org/wiki/Decimal_separator#Examples_of_use) is using the ',' char as a seperator and you are saying there is no general need?

Sure, for a simple form on some page you can just provide your own Translator for the respective field. But if you are using components that rely on translators from the TranslatorSource service (like BeanEditForm) you can't just contribute your own translators, you'll also have to replace the TranslatorSource with an implementation that uses the current user's locale, so a workaround is everything else but trivial. And then there is still the client side validation issue.

So there are two things that need to be adressed:

1. We either need to have a TranslatorSource that takes into account the current user's locale or extend the Translator interface
2. We need a client side parsing function that matches the server side.

Dojo (http://api.dojotoolkit.org/jsdoc/dojo/1.2/dojo.number) has a number parser/formatter that can handle different locales, maybe we can borrow something from there.

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Ulrich Stärk
>            Assignee: Howard M. Lewis Ship
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2457) Add localization to translators to allow for localized display/entering of values

Posted by "Ulrich Stärk (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ulrich Stärk updated TAPESTRY-2457:
-----------------------------------

    Description: Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.  (was: Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part.)

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Ulrich Stärk
>         Attachments: patch.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-211) Add localization to translators to allow for localized display/entering of values

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

Joakim Olsson updated TAP5-211:
-------------------------------

    Attachment: tapestry-locale-float-validation.diff

My crude implementation of locale-aware double- and float-translators. The implementation also contains client-side locale-aware validation by sending the regular expression used to validate decimal numbers in the Tapestry.Init-call.

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.1.0.0
>            Reporter: Ulrich Stärk
>         Attachments: LocalizedTranslatorSource.zip, TAPESTRY-2457.txt, tapestry-locale-float-validation.diff
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643388#action_12643388 ] 

Howard M. Lewis Ship commented on TAP5-211:
-------------------------------------------

There isn't a need, generally, and if there is, you can contribute your own translators.  At issue is the fact that neither Tapestry not Prototype provides a JavaScript equivalent of Locale or Format, meaning that there's a strong possibility that localized number parsing on the server side will not be expressed on the client side (that is, the client side will accept one format, the server side enforce a different format).

So, we have to come up with a way for the client side to have parsing functions that match the server side, w.r.t. seperator characters (such as ',' in English) and decimal point ('.').



> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Ulrich Stärk
>            Assignee: Howard M. Lewis Ship
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAP5-211) Add localization to translators to allow for localized display/entering of values

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-211:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> Add localization to translators to allow for localized display/entering of values
> ---------------------------------------------------------------------------------
>
>                 Key: TAP5-211
>                 URL: https://issues.apache.org/jira/browse/TAP5-211
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Ulrich Stärk
>            Assignee: Howard M. Lewis Ship
>         Attachments: TAPESTRY-2457.txt
>
>
> Localization support for pages and messages is great in Tapestry but it lacks support for localization of input values because the translators don't have support for it. It would be great if users could just enter numbers etc. in their respective locale, e.g. use ',' instead of '.' to seperate decimal places from the integer part, out of the box.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org