You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/07/19 12:26:13 UTC
svn commit: r557559 - in
/lenya/docu/src/documentation/content/xdocs/docs/2_0_x:
reference/resource-types.xml tutorials/resourcetype/part1.xml
tutorials/resourcetype/part2.xml
Author: andreas
Date: Thu Jul 19 03:26:09 2007
New Revision: 557559
URL: http://svn.apache.org/viewvc?view=rev&rev=557559
Log:
Updated resource type docs re. i18n-ized label
Modified:
lenya/docu/src/documentation/content/xdocs/docs/2_0_x/reference/resource-types.xml
lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part1.xml
lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part2.xml
Modified: lenya/docu/src/documentation/content/xdocs/docs/2_0_x/reference/resource-types.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/2_0_x/reference/resource-types.xml?view=diff&rev=557559&r1=557558&r2=557559
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/2_0_x/reference/resource-types.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/2_0_x/reference/resource-types.xml Thu Jul 19 03:26:09 2007
@@ -169,6 +169,18 @@
</section>
+ <section>
+ <title>I18n for the Resource Type Label</title>
+ <p>
+ There is a convention that the message key <em>resourceType-{name}</em> is used for a
+ human-readable, translated resource type label:
+ </p>
+ <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <message key="resourceType-profile">Profile</message>
+</catalogue>]]></source>
+ </section>
+
<section><title>Define a Custom Menubar</title>
<p>
If you want to use a custom menubar for your resource type,
@@ -181,9 +193,12 @@
To let the user create new resources using the <code>DefaultBranchCreator</code>,
you have to add the following menu item:
</p>
-<source>
- <![CDATA[<item uc:usecase="site.create" href="?doctype=profile"><i18n:text>New Profile Document</i18n:text></item>]]>
-</source>
+ <source><![CDATA[<item uc:usecase="sitemanagement.create" href="?doctype=profile">
+ <i18n:translate>
+ <i18n:text>New ... Document</i18n:text>
+ <i18n:param><i18n:text>resourceType-profile</i18n:text></i18n:param>
+ </i18n:translate>
+</item>]]></source>
</section>
<section>
Modified: lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part1.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part1.xml?view=diff&rev=557559&r1=557558&r2=557559
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part1.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part1.xml Thu Jul 19 03:26:09 2007
@@ -66,6 +66,7 @@
cocoon-xconf/ Patch files for cocoon.xconf.
resourcetype-person.xconf The declaration of our resource type.
resources/
+ i18n/ The internationalization catalogues.
icons/
person.gif The icon for the sitetree.
samples/ Samples to create person documents.
@@ -143,6 +144,27 @@
</p>
<p>
In the <a href="site:newResourceTypePart2">next section</a> we'll setup the creation of person documents.
+ </p>
+ </section>
+
+ <section>
+ <title>Adding I18n Messages for the Resource Type Name</title>
+ <p>
+ Now we'll provide <acronym title="Internationalization">i18n</acronym> messages for each
+ language to show the resource type name in a human-readable form. There is a convention
+ that the message key <em>resourceType-{name}</em> is used.
+ </p>
+ <p>
+ Create the file <code>$MODULE_HOME/resources/i18n/cmsui.xml</code> with the following content:
+ </p>
+ <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <message key="resourceType-person">Person</message>
+</catalogue>]]></source>
+ <p>
+ For other languages, use the language code as suffix (<code>cmsui_de.xhml</code> etc.) and
+ don't forget to set the <em>xml:lang</em> attribute of the <code><![CDATA[<catalogue>]]></code>
+ element.
</p>
</section>
Modified: lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part2.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part2.xml?view=diff&rev=557559&r1=557558&r2=557559
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part2.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/2_0_x/tutorials/resourcetype/part2.xml Thu Jul 19 03:26:09 2007
@@ -45,7 +45,8 @@
</map:sitemap>]]></source>
<p>
According to this sitemap, the menu XSP is located at
- <code>$MODULE_HOME/config/menu.xsp</code>:
+ <code>$MODULE_HOME/config/menu.xsp</code>. Note that we're using the i18n
+ message for the resource type label which we added in the previous section:
</p>
<source xml:space="preserve"><![CDATA[<?xml version="1.0"?>
<xsp:page
@@ -61,7 +62,7 @@
<item uc:usecase="sitemanagement.create" href="?doctype=person">
<i18n:translate>
<i18n:text>New ... Document</i18n:text>
- <i18n:param>Person</i18n:param>
+ <i18n:param><i18n:text>resourceType-person</i18n:text></i18n:param>
</i18n:translate>
</item>
</block>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org