[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/styleguide/i18n/ Added initial content for i18n style guide

Roger Ineichen roger at projekt01.ch
Thu Feb 17 15:41:16 EST 2005


Log message for revision 29181:
  Added initial content for i18n style guide

Changed:
  A   Zope3/trunk/src/zope/app/styleguide/i18n/README.txt
  A   Zope3/trunk/src/zope/app/styleguide/i18n/__init__.py
  A   Zope3/trunk/src/zope/app/styleguide/i18n/configure.zcml

-=-
Added: Zope3/trunk/src/zope/app/styleguide/i18n/README.txt
===================================================================
--- Zope3/trunk/src/zope/app/styleguide/i18n/README.txt	2005-02-17 20:40:11 UTC (rev 29180)
+++ Zope3/trunk/src/zope/app/styleguide/i18n/README.txt	2005-02-17 20:41:14 UTC (rev 29181)
@@ -0,0 +1,70 @@
+==========================
+Zope3 - I18n - Style Guide
+==========================
+
+------------
+Introduction
+------------
+
+I18n samples ...
+
+----------
+Block text
+----------
+
+Use <tal:block> or <label> for translation strings, not span
+
+::
+
+  <span i18n:translate="msgid">blah</span>
+  because it produces:
+  <span>msgstr</span>
+  with useless <span> elements that needlessly encumber the HTML output.
+  
+  <tal:block i18n:translate="msgid">A meaningful translation</tal:block>
+  
+  or
+
+  <label i18n:translate="msgid">A meaningful translation</label>
+
+-----------------------
+Beware of empty <label>
+-----------------------
+
+::
+
+  <label i18n:translate="msgid" />
+  produces:
+  <label />msgstr
+  
+  To produce <label>msgstr</label> one must write
+  
+  <label i18n:translate="msgid">A meaningful translation</label>
+  
+  <label i18n:translate="msgid">A meaningful translation</label>
+
+---------
+Messageid
+---------
+
+::
+
+  Provide a meaningful translation message example in the template. Because a meaningful translation will help translators later on.
+  
+  <tal:block i18n:translate="msgid">A meaningful translation</tal:block>
+  
+  and NOT
+  
+  <tal:block i18n:translate="msgid"/> 
+
+------------
+Python rules
+------------
+
+Translate in Python if needed
+
+Output that returns in page templates has to be translated in Python
+
+::
+
+  ...sample


Property changes on: Zope3/trunk/src/zope/app/styleguide/i18n/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/styleguide/i18n/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/styleguide/i18n/__init__.py	2005-02-17 20:40:11 UTC (rev 29180)
+++ Zope3/trunk/src/zope/app/styleguide/i18n/__init__.py	2005-02-17 20:41:14 UTC (rev 29181)
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# Copyright (c) 2002 - 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Zope3 I18n styleguide
+
+$Id$
+"""


Property changes on: Zope3/trunk/src/zope/app/styleguide/i18n/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/styleguide/i18n/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/styleguide/i18n/configure.zcml	2005-02-17 20:40:11 UTC (rev 29180)
+++ Zope3/trunk/src/zope/app/styleguide/i18n/configure.zcml	2005-02-17 20:41:14 UTC (rev 29181)
@@ -0,0 +1,15 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:help="http://namespaces.zope.org/help"
+    i18n_domain="zope">
+
+  <help:register
+      id="i18n"
+      parent="styleguide"
+      title="I18n"
+      doc_path="README.txt"
+      class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
+      />
+
+</configure>


Property changes on: Zope3/trunk/src/zope/app/styleguide/i18n/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list