[Zope3-dev] Re: SVN: Zope3/trunk/src/zope/app/ Removed all cases of bogus use 'i18n:translate'

Philipp von Weitershausen philipp at weitershausen.de
Sat May 7 14:39:59 EDT 2005


Dmitry Vasiliev wrote:
> Log message for revision 30249:
>   Removed all cases of bogus use 'i18n:translate'

I think most of these cases are not at all bogus. See below.

> Changed:
>   U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/iface_macros.pt
>   U   Zope3/trunk/src/zope/app/cache/browser/cacheableedit.pt
>   U   Zope3/trunk/src/zope/app/cache/browser/ramedit.pt
>   U   Zope3/trunk/src/zope/app/cache/browser/ramstats.pt
>   U   Zope3/trunk/src/zope/app/component/browser/site_management.pt
>   U   Zope3/trunk/src/zope/app/container/browser/commontasks.pt
>   U   Zope3/trunk/src/zope/app/dublincore/browser/edit.pt
>   U   Zope3/trunk/src/zope/app/file/browser/image_edit.pt
>   U   Zope3/trunk/src/zope/app/rotterdam/template.pt
>   U   Zope3/trunk/src/zope/app/rotterdam/template_tablelayout.pt
>   U   Zope3/trunk/src/zope/app/rotterdam/view_macros.pt
>   U   Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt
>   U   Zope3/trunk/src/zope/app/zopetop/widget_macros.pt

> Modified: Zope3/trunk/src/zope/app/cache/browser/cacheableedit.pt
> ===================================================================
> --- Zope3/trunk/src/zope/app/cache/browser/cacheableedit.pt	2005-05-05 10:46:49 UTC (rev 30248)
> +++ Zope3/trunk/src/zope/app/cache/browser/cacheableedit.pt	2005-05-05 12:53:53 UTC (rev 30249)
> @@ -50,7 +50,7 @@
>               i18n:attributes="value invalidate-cache-button" />
>  
>      </form>
> -    <div tal:content="options/message|nothing" i18n:translate="" />
> +    <div tal:content="options/message|nothing" />
>  
>    </div>
>    </body>

Why is this bogus? A user message seems likely to be translated. (Same 
question for ramedit.pt, ramstats.pt, site_management.pt, 
dublincore/../edit.pt, file/.../image_edit.pt)

> Modified: Zope3/trunk/src/zope/app/container/browser/commontasks.pt
> ===================================================================
> --- Zope3/trunk/src/zope/app/container/browser/commontasks.pt	2005-05-05 10:46:49 UTC (rev 30248)
> +++ Zope3/trunk/src/zope/app/container/browser/commontasks.pt	2005-05-05 12:53:53 UTC (rev 30249)
> @@ -2,12 +2,12 @@
>             condition="addingInfo" i18n:domain="zope">
>  
>    <tal:block repeat="info addingInfo"
> -	define="namesRequired context/@@+/nameAllowed">
> +    define="namesRequired context/@@+/nameAllowed">
>      <div tal:define="oddrow repeat/info/odd;
> -		     namesRequired context/@@+/nameAllowed;
> +        namesRequired context/@@+/nameAllowed;
>          has_custom_add_view python:'has_custom_add_view' in info"
> -      	tal:attributes="class python:oddrow and 'content even' or 'content odd'"
> -	class="even">
> +        tal:attributes="class python:oddrow and 'content even' or 'content odd'"
> +        class="even">
>        <a href="#"
>          tal:define="baseurl python:request.getURL(1)"
>          tal:condition="python: not info['action'].startswith('../')
> @@ -15,17 +15,17 @@
>          tal:attributes="
>            href string:${baseurl}/@@contents.html?type_name=${info/action};
>            class info/selected"
> -        tal:content="info/title" i18n:translate="">Folder
> +        tal:content="info/title">Folder
>        </a>
>  
>        <a href="#"
>          tal:define="baseurl python:request.getURL(1)"
>          tal:condition="python: not info['action'].startswith('../')
> -		               and (has_custom_add_view or not namesRequired)"
> +                   and (has_custom_add_view or not namesRequired)"
>          tal:attributes="
>            href string:${baseurl}/@@+/action.html?type_name=${info/action};
>            class info/selected"
> -        tal:content="info/title" i18n:translate="">Folder
> +        tal:content="info/title">Folder
>        </a>
>  
>        <a href="#"
> @@ -34,7 +34,7 @@
>          tal:attributes="
>            href python: info['action'][3:];
>            class info/selected"
> -        tal:content="info/title" i18n:translate="">Folder
> +        tal:content="info/title">Folder
>        </a>
>      </div>
>    </tal:block>

Uh, this is the add menu right? Why do you want to prevent translation 
of addable content type names? Same goes for action titles in 
rotterdam/template.pt and rotterdam/template_tablelayout.pt...

> Modified: Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt
> ===================================================================
> --- Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt	2005-05-05 10:46:49 UTC (rev 30248)
> +++ Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt	2005-05-05 12:53:53 UTC (rev 30249)
> @@ -40,7 +40,6 @@
>          <td align="center" tal:repeat="role view/roles">
>            <div class="list-item">
>              <a href="RolePermissions.html"
> -              i18n:translate=""
>                tal:attributes="
>                href string:RolePermissions.html?role_to_manage=${role/id}" 
>                tal:content="role/title">Anonymous</a>
> @@ -60,7 +59,6 @@
>          <td align="left" nowrap="nowrap">
>            <div class="list-item">
>               <a href="RolesWithPermission.html"
> -                i18n:translate=""
>                  tal:attributes="href 
>             string:RolesWithPermission.html?permission_to_manage=${perm/id}"
>                  tal:content="perm/title"

This is maybe a case of bogus translation because strictly role and 
permission titles are not message ids. However, the <role /> and 
<permission /> directive schemas specify the title and description 
attributes as translatable message ids.

Maybe you're right that we shouldn't translate role and permission 
titles; then we should get rid of all i18n code regarding that case. I 
would vote for the opposite, though. Also note 
http://www.zope.org/Collectors/Zope3-dev/298 on this subject.

Philipp




More information about the Zope3-dev mailing list