You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Hitoshi Ozawa (Created) (JIRA)" <ji...@apache.org> on 2012/01/09 23:43:39 UTC

[jira] [Created] (CONNECTORS-370) Ability to pass parameters to I18N messages

Ability to pass parameters to I18N messages
-------------------------------------------

                 Key: CONNECTORS-370
                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
             Project: ManifoldCF
          Issue Type: Improvement
          Components: Framework crawler agent
    Affects Versions: ManifoldCF 0.5
            Reporter: Hitoshi Ozawa
            Priority: Minor
             Fix For: ManifoldCF 0.5


Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
Would like to have ability to pass parameters to messages in properties file:
e.g.
message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Commented] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Hitoshi Ozawa (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182924#comment-13182924 ] 

Hitoshi Ozawa commented on CONNECTORS-370:
------------------------------------------

Support FormatType and FormatStyle?
Would be good to have date format localized as well.

formatMessage = MessageFormat.format("At {1,time} on {1,date}, there where {0,number,integer} errors.",
     arguments);
                
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Commented] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182929#comment-13182929 ] 

Karl Wright commented on CONNECTORS-370:
----------------------------------------

bq. Support FormatType and FormatStyle? Would be good to have date format localized as well.

I don't see why not?  The code as is seems to do that.  Maybe give it a try and see if it works for you?

                
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Assigned] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Karl Wright (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright reassigned CONNECTORS-370:
--------------------------------------

    Assignee: Karl Wright
    
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Resolved] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Karl Wright (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright resolved CONNECTORS-370.
------------------------------------

    Resolution: Fixed
    
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Commented] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182913#comment-13182913 ] 

Karl Wright commented on CONNECTORS-370:
----------------------------------------

r1229416 corrects the locale issue (I think)...

                
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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

        

[jira] [Commented] (CONNECTORS-370) Ability to pass parameters to I18N messages

Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182909#comment-13182909 ] 

Karl Wright commented on CONNECTORS-370:
----------------------------------------

There's already code in the Messages class for optional arguments, which do this:

{code}
    // Format the message
    String formatMessage;
    if (args != null)
    {
      formatMessage = MessageFormat.format(message, args);
    }
    else
    {
      formatMessage = message;
    }
    return formatMessage;
{code}

For example:

{code}
 Object[] testArgs = {new Long(3), "MyDisk"};

 MessageFormat form = new MessageFormat(
     "The disk \"{1}\" contains {0} file(s).");

 System.out.println(form.format(testArgs));

 // output, with different testArgs
 output: The disk "MyDisk" contains 0 file(s).
 output: The disk "MyDisk" contains 1 file(s).
 output: The disk "MyDisk" contains 1,273 file(s).

{code}

The problem with MessageFormat is that it seems to use the current default locale exclusively when formatting the arguments.  As long as the arguments are strings this isn't a problem, but if any turn out to be numbers etc then MessageFormat will not do the right thing.

My suggestion is thus to (a) keep the general functionality of MessageFormat, but (b) reimplement the parts we use so that it uses the right locale.



                
> Ability to pass parameters to I18N messages
> -------------------------------------------
>
>                 Key: CONNECTORS-370
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-370
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework crawler agent
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Hitoshi Ozawa
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: I18N
>             Fix For: ManifoldCF 0.5
>
>
> Current I18N scheme only allows one sequential set of words to be extracted out to properties file.
> Some languages such as Japanese have different grammerical syntax than English may require parameters to be passed in different order.
> Would like to have ability to pass parameters to messages in properties file:
> e.g.
> message1={$1} with match parameters {$2} and {$3} resulted in {$4}

--
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