[jira] Created: (TRINIDAD-1524) i18n issue with (German) format pattern

View: New views
6 Messages — Rating Filter:   Alert me  

[jira] Created: (TRINIDAD-1524) i18n issue with (German) format pattern

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i18n issue with (German) format pattern
---------------------------------------

                 Key: TRINIDAD-1524
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions:  1.2.11-core
            Reporter: Matthias Weßendorf
            Assignee: Matthias Weßendorf


This is not only a bug in Trinidad... It is mainly an issue in the core date_time_converter as well:

       <h:form>
         <h:messages/>
         <h:inputText value="#{input.date}" immediate="true">
           <f:convertDateTime type="both" timeStyle="full"
           timeZone="America/New_York"
           pattern="dd.MM.yyyy HH:mm' Uhr '"
           locale="de"
           />
         </h:inputText>
         <h:commandButton value="Submit" type="submit"/>
       </h:form>

Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
After the word "Uhr" there is an empty space (required by the pattern).

Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty String at the end),
we run into the problem, that the spec wants the converter to trim leading/trailing whitespaces before proceeding. Makes sense....
but gives us a (neat) error.

See this JavaDoc section:
http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html

<snip>
If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
</snip>

However, when the pattern requires an empty space at the end, we (the converter) should honor that...

possible change in the converter code (after the trim() has been called):
    if(pattern.endsWith(" '"))
    {
      value += " ";
         
    }

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


[jira] Updated: (TRINIDAD-1524) i18n issue with (German) format pattern

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/TRINIDAD-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf updated TRINIDAD-1524:
-----------------------------------------

    Status: Patch Available  (was: Open)

> i18n issue with (German) format pattern
> ---------------------------------------
>
>                 Key: TRINIDAD-1524
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> This is not only a bug in Trinidad... It is mainly an issue in the core date_time_converter as well:
>        <h:form>
>          <h:messages/>
>          <h:inputText value="#{input.date}" immediate="true">
>            <f:convertDateTime type="both" timeStyle="full"
>            timeZone="America/New_York"
>            pattern="dd.MM.yyyy HH:mm' Uhr '"
>            locale="de"
>            />
>          </h:inputText>
>          <h:commandButton value="Submit" type="submit"/>
>        </h:form>
> Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
> After the word "Uhr" there is an empty space (required by the pattern).
> Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty String at the end),
> we run into the problem, that the spec wants the converter to trim leading/trailing whitespaces before proceeding. Makes sense....
> but gives us a (neat) error.
> See this JavaDoc section:
> http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html
> <snip>
> If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
> </snip>
> However, when the pattern requires an empty space at the end, we (the converter) should honor that...
> possible change in the converter code (after the trim() has been called):
>     if(pattern.endsWith(" '"))
>     {
>       value += " ";
>          
>     }

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


[jira] Commented: (TRINIDAD-1524) i18n issue with (German) format pattern

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/TRINIDAD-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730835#action_12730835 ]

Matthias Weßendorf commented on TRINIDAD-1524:
----------------------------------------------

created spec ticket:
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1198

> i18n issue with (German) format pattern
> ---------------------------------------
>
>                 Key: TRINIDAD-1524
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>         Attachments: TRINIDAD-1524.patch
>
>
> This is not only a bug in Trinidad... It is mainly an issue in the core date_time_converter as well:
>        <h:form>
>          <h:messages/>
>          <h:inputText value="#{input.date}" immediate="true">
>            <f:convertDateTime type="both" timeStyle="full"
>            timeZone="America/New_York"
>            pattern="dd.MM.yyyy HH:mm' Uhr '"
>            locale="de"
>            />
>          </h:inputText>
>          <h:commandButton value="Submit" type="submit"/>
>        </h:form>
> Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
> After the word "Uhr" there is an empty space (required by the pattern).
> Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty String at the end),
> we run into the problem, that the spec wants the converter to trim leading/trailing whitespaces before proceeding. Makes sense....
> but gives us a (neat) error.
> See this JavaDoc section:
> http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html
> <snip>
> If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
> </snip>
> However, when the pattern requires an empty space at the end, we (the converter) should honor that...
> possible change in the converter code (after the trim() has been called):
>     if(pattern.endsWith(" '"))
>     {
>       value += " ";
>          
>     }

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


[jira] Updated: (TRINIDAD-1524) i18n issue with (German) format pattern

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/TRINIDAD-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf updated TRINIDAD-1524:
-----------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.12-core
           Status: Resolved  (was: Patch Available)

> i18n issue with (German) format pattern
> ---------------------------------------
>
>                 Key: TRINIDAD-1524
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>             Fix For:  1.2.12-core
>
>         Attachments: TRINIDAD-1524.patch
>
>
> This is not only a bug in Trinidad... It is mainly an issue in the core date_time_converter as well:
>        <h:form>
>          <h:messages/>
>          <h:inputText value="#{input.date}" immediate="true">
>            <f:convertDateTime type="both" timeStyle="full"
>            timeZone="America/New_York"
>            pattern="dd.MM.yyyy HH:mm' Uhr '"
>            locale="de"
>            />
>          </h:inputText>
>          <h:commandButton value="Submit" type="submit"/>
>        </h:form>
> Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
> After the word "Uhr" there is an empty space (required by the pattern).
> Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty String at the end),
> we run into the problem, that the spec wants the converter to trim leading/trailing whitespaces before proceeding. Makes sense....
> but gives us a (neat) error.
> See this JavaDoc section:
> http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html
> <snip>
> If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
> </snip>
> However, when the pattern requires an empty space at the end, we (the converter) should honor that...
> possible change in the converter code (after the trim() has been called):
>     if(pattern.endsWith(" '"))
>     {
>       value += " ";
>          
>     }

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


Re: [jira] Updated: (TRINIDAD-1524) i18n issue with (German) format pattern

by Blake Sullivan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthias,

This is slightly wrong for a couple of reasons:
1) We need to gather up all of the required whitespace, which can be more than one character and could be characters other than space
2) We need to ensure that the required whitespace was present before we called trim

-- Blake Sullivan

Matthias Weßendorf (JIRA) said the following On 7/14/2009 6:18 AM PT:
     [ https://issues.apache.org/jira/browse/TRINIDAD-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf updated TRINIDAD-1524:
-----------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.12-core
           Status: Resolved  (was: Patch Available)

  
i18n issue with (German) format pattern
---------------------------------------

                Key: TRINIDAD-1524
                URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
            Project: MyFaces Trinidad
         Issue Type: Bug
   Affects Versions:  1.2.11-core
           Reporter: Matthias Weßendorf
           Assignee: Matthias Weßendorf
            Fix For:  1.2.12-core

        Attachments: TRINIDAD-1524.patch


This is not only a bug in Trinidad... It is mainly an issue in the core date_time_converter as well:
       <h:form>
         <h:messages/>
         <h:inputText value="#{input.date}" immediate="true">
           <f:convertDateTime type="both" timeStyle="full"
           timeZone="America/New_York"
           pattern="dd.MM.yyyy HH:mm' Uhr '"
           locale="de"
           />
         </h:inputText>
         <h:commandButton value="Submit" type="submit"/>
       </h:form>
Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
After the word "Uhr" there is an empty space (required by the pattern).
Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty String at the end),
we run into the problem, that the spec wants the converter to trim leading/trailing whitespaces before proceeding. Makes sense....
but gives us a (neat) error.
See this JavaDoc section:
http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html
<snip>
If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
</snip>
However, when the pattern requires an empty space at the end, we (the converter) should honor that...
possible change in the converter code (after the trim() has been called):
    if(pattern.endsWith(" '"))
    {	
      value += " ";
         
    }
    

  


Re: [jira] Updated: (TRINIDAD-1524) i18n issue with (German) format pattern

by Matthias Wessendorf-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 14, 2009 at 7:38 PM, Blake
Sullivan<blake.sullivan@...> wrote:
> Matthias,
>
> This is slightly wrong for a couple of reasons:
> 1) We need to gather up all of the required whitespace, which can be more
> than one character and could be characters other than space
> 2) We need to ensure that the required whitespace was present before we
> called trim
>

correct. thanks for the note; let me add that.

-Matthias

> -- Blake Sullivan
>
> Matthias Weßendorf (JIRA) said the following On 7/14/2009 6:18 AM PT:
>
>      [
> https://issues.apache.org/jira/browse/TRINIDAD-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
>
> Matthias Weßendorf updated TRINIDAD-1524:
> -----------------------------------------
>
>        Resolution: Fixed
>     Fix Version/s:  1.2.12-core
>            Status: Resolved  (was: Patch Available)
>
>
>
> i18n issue with (German) format pattern
> ---------------------------------------
>
>                 Key: TRINIDAD-1524
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1524
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>             Fix For:  1.2.12-core
>
>         Attachments: TRINIDAD-1524.patch
>
>
> This is not only a bug in Trinidad... It is mainly an issue in the core
> date_time_converter as well:
>        <h:form>
>          <h:messages/>
>          <h:inputText value="#{input.date}" immediate="true">
>            <f:convertDateTime type="both" timeStyle="full"
>            timeZone="America/New_York"
>            pattern="dd.MM.yyyy HH:mm' Uhr '"
>            locale="de"
>            />
>          </h:inputText>
>          <h:commandButton value="Submit" type="submit"/>
>        </h:form>
> Note that the pattern is like this: dd.MM.yyyy HH:mm' Uhr '
> After the word "Uhr" there is an empty space (required by the pattern).
> Now when you enter this String "30.06.09 12:11 Uhr " (notice the empty
> String at the end),
> we run into the problem, that the spec wants the converter to trim
> leading/trailing whitespaces before proceeding. Makes sense....
> but gives us a (neat) error.
> See this JavaDoc section:
> http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/convert/DateTimeConverter.html
> <snip>
> If the specified String is null, return a null. Otherwise, trim leading and
> trailing whitespace before proceeding.
> </snip>
> However, when the pattern requires an empty space at the end, we (the
> converter) should honor that...
> possible change in the converter code (after the trim() has been called):
>     if(pattern.endsWith(" '"))
>     {
>       value += " ";
>
>     }
>
>
>
>



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf