Author: thomas.heute(a)jboss.com
Date: 2007-11-26 10:17:45 -0500 (Mon, 26 Nov 2007)
New Revision: 9110
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/navtabs.xml
Log:
- Fix page width for DTDs
- Update documentation about Tab localization
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd 2007-11-26
14:52:55 UTC (rev 9109)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd 2007-11-26
15:17:45 UTC (rev 9110)
@@ -68,7 +68,8 @@
</portlet>
-->
-<!ELEMENT portlet
(portlet-name,remotable?,ajax?,session-config?,transaction?,header-content?,portlet-info?)>
+<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
+ header-content?,portlet-info?)>
<!--
The portlet name.
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-11-26
14:52:55 UTC (rev 9109)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-11-26
15:17:45 UTC (rev 9110)
@@ -93,7 +93,8 @@
does not have a visual representation. It can exist only under the root. A context can
only have children with the portal type.
-->
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
(display-name* | (resource-bundle, supported-locale+)))>
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
+ (display-name* | (resource-bundle, supported-locale+)))>
<!--
The context name value.
@@ -108,7 +109,8 @@
(view,edit,help) and (normal,minimized,maximized).
-->
<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
- listener?,security-constraint?,page*, (display-name* |
(resource-bundle, supported-locale+)))>
+ listener?,security-constraint?,page*,
+ (display-name* | (resource-bundle, supported-locale+)))>
<!--
The portal name value.
@@ -158,7 +160,8 @@
type page and window. The children windows are the windows of the page and the children
pages are the subpages of this page.
-->
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
(display-name* | (resource-bundle, supported-locale+)))>
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
+ (display-name* | (resource-bundle, supported-locale+)))>
<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name
@@ -185,7 +188,9 @@
The region and height defines how the window is placed in the page.
-->
-<!ELEMENT window
(window-name,(instance-ref|content),region,height,initial-window-state?,initial-mode?,properties?,listener?,
(display-name* | (resource-bundle, supported-locale+)))>
+<!ELEMENT window (window-name,(instance-ref|content),region,height,
+ initial-window-state?,initial-mode?,properties?,listener?,
+ (display-name* | (resource-bundle, supported-locale+)))>
<!--
The window name value.
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-11-26
14:52:55 UTC (rev 9109)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-11-26
15:17:45 UTC (rev 9110)
@@ -74,7 +74,8 @@
</instance>
-->
-<!ELEMENT instance
(instance-id,portlet-ref,display-name*,preferences?,security-constraint?, (display-name* |
(resource-bundle, supported-locale+)))>
+<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,
+ security-constraint?, (display-name* | (resource-bundle,
supported-locale+)))>
<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/navtabs.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/navtabs.xml 2007-11-26
14:52:55 UTC (rev 9109)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/navtabs.xml 2007-11-26
15:17:45 UTC (rev 9110)
@@ -4,8 +4,12 @@
<author>
<firstname>Roy</firstname>
<surname>Russo</surname>
- <email>roy at jboss dot org</email>
</author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ <email>theute(a)jboss.org</email>
+ </author>
</chapterinfo>
<title>Navigation Tabs</title>
<para>The navigation tabs allow users to navigate the portal pages. This section
describes some of the functionality
@@ -39,25 +43,49 @@
</para>
</sect1>
<sect1>
- <title>Internationalizing tab labels</title>
- <para>JBoss Portal uses Resource bundles to localize the tab naming for
international users. The resource files
- can be found in
- <emphasis>jboss-portal.sar/conf/bundles</emphasis>
- and have the names
- <emphasis>Resource_*.properties</emphasis>
- </para>
- <para>The resource files provide a mapping between the name of the page, as
defined in the *-object.xml, and a
- localized value to display in the tab. For example, our standard bundled pages:
Home, Admin, Test, News, are
- mapped as such in the
- <emphasis>Resource_fr.properties</emphasis>
- file, for French users:
-<programlisting><![CDATA[
-PAGENAME_default=Accueil
-PAGENAME_Admin=Admin
-PAGENAME_Test=Test
-PAGENAME_News=Actualités]]></programlisting>
- So the mapping pattern is
- <emphasis>PAGENAME_[Name in *-object.xml]=[translated
value]</emphasis>
- </para>
+ <title>Translating tab labels</title>
+ <para>Labels on tabs can be defined in multiple languages. Two different ways
can be used, the first one consist at
+ defining several display name for page objects, the second one consists of defining
a resource bundle where to find
+ the localized display-name. Both methods have advantages and
drawbacks.</para>
+ <sect2>
+ <title>Method one: Multiple
<literal>display-name</literal></title>
+ <para>In the <filename>*-object.xml</filename> descriptor
under the <literal>page</literal> element, it is possible
+ to define a display-name per locale. Here is an example:
+ <programlisting><![CDATA[
+<page>
+ <page-name>News</page-name>
+ <display-name xml:lang="en">News</display-name>
+ <display-name xml:lang="it">Novita'</display-name>
+ <display-name xml:lang="es">Noticias</display-name>
+ <display-name xml:lang="fr">Actualités</display-name>
+ ...
+</page>
+ ]]></programlisting>
+ Here we defined a display name for four different languages. The advantage of
this method is that it is simple and the
+ display name is kept along the metadata. The drawback of this method is that if
you may end up with different places
+ to keep your localized data. If you are using resource bundles for other
elements, the second method might be simpler
+ when you add new supported languages.
+ </para>
+ </sect2>
+ <sect2>
+ <title>Defining a resource bundle and supported locales</title>
+ <para>If you are already using resource bundles for localization you may
prefer to point to those files. To do so you
+ can define the name of your ressource bundle. The files should be in the
classloader of the war containing the <filename>*-object.xml</filename>
+ where you define them, meaning in the same war file.</para>
+ <para>Here is an example:
+ <programlisting><![CDATA[
+<page>
+ <page-name>Weather</page-name>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>en</supported-locale>
+ ...
+</page>
+ ]]></programlisting>
+ With one or the other method, accessing the portal will now display the tab names
with the preferred locale if a localized
+ value exists.
+ </para>
+ <warning><para>If you change the values in the descriptor (method 1)
or in the resource bundles (method 2) you need to use
+ the
<literal><if-exists>overwrite</if-exists></literal>
so that the values are updated</para></warning>
+ </sect2>
</sect1>
</chapter>
\ No newline at end of file