You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Christoph Jäger (JIRA)" <ji...@apache.org> on 2010/02/05 01:06:28 UTC

[jira] Created: (TAP5-1003) Make Label try -label and for translation text

Make Label try <ID>-label and <ID> for translation text
-------------------------------------------------------

                 Key: TAP5-1003
                 URL: https://issues.apache.org/jira/browse/TAP5-1003
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
            Reporter: Christoph Jäger
            Priority: Minor


A Label currently queries the Messages instance for a translation with key "<ID>-label". It would be nice if also "<ID>" (without the "-label" suffix) was tried if no translation was found for key "<ID>-label". 

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


[jira] Commented: (TAP5-1003) Make Label try -label and for translation text

Posted by "Alexander Muthmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830328#action_12830328 ] 

Alexander Muthmann commented on TAP5-1003:
------------------------------------------

This should work:

change ComponentDefaultProviderImpl.java to:

public String defaultLabel(ComponentResources resources)
    {
        Defense.notNull(resources, "resources");

        String componentId = resources.getId();
        String key = componentId + "-label";

        Messages containerMessages = resources.getContainerResources().getMessages();

        if (containerMessages.contains(key)) return containerMessages.get(key);
       \\Try without -label
		if (containerMessages.contains(componentId)) return containerMessages.get(componentId);
        return TapestryInternalUtils.toUserPresentable(componentId);
 }

> Make Label try <ID>-label and <ID> for translation text
> -------------------------------------------------------
>
>                 Key: TAP5-1003
>                 URL: https://issues.apache.org/jira/browse/TAP5-1003
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: Christoph Jäger
>            Priority: Minor
>
> A Label currently queries the Messages instance for a translation with key "<ID>-label". It would be nice if also "<ID>" (without the "-label" suffix) was tried if no translation was found for key "<ID>-label". 

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


[jira] Commented: (TAP5-1003) Make Label try -label and for translation text

Posted by "Alexander Muthmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830328#action_12830328 ] 

Alexander Muthmann commented on TAP5-1003:
------------------------------------------

This should work:

change ComponentDefaultProviderImpl.java to:

public String defaultLabel(ComponentResources resources)
    {
        Defense.notNull(resources, "resources");

        String componentId = resources.getId();
        String key = componentId + "-label";

        Messages containerMessages = resources.getContainerResources().getMessages();

        if (containerMessages.contains(key)) return containerMessages.get(key);
       \\Try without -label
		if (containerMessages.contains(componentId)) return containerMessages.get(componentId);
        return TapestryInternalUtils.toUserPresentable(componentId);
 }

> Make Label try <ID>-label and <ID> for translation text
> -------------------------------------------------------
>
>                 Key: TAP5-1003
>                 URL: https://issues.apache.org/jira/browse/TAP5-1003
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: Christoph Jäger
>            Priority: Minor
>
> A Label currently queries the Messages instance for a translation with key "<ID>-label". It would be nice if also "<ID>" (without the "-label" suffix) was tried if no translation was found for key "<ID>-label". 

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