forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thorsten Scherler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Date Sat, 04 Jun 2005 04:06:42 GMT
    [ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312612 ] 

Thorsten Scherler commented on FOR-506:
---------------------------------------

The patch enables i18n support for forrest. Mainly it is focus right now on the i18n support
for skins (in particular pelt).

The changes I do not mention here are related to setup i18n support for the backend.

The following code changes are as well the only example I implemented right now. ;-)

Index: webapp/skins/pelt/xslt/html/site2xhtml.xsl
===================================================================
--- webapp/skins/pelt/xslt/html/site2xhtml.xsl	(revision 179925)
+++ webapp/skins/pelt/xslt/html/site2xhtml.xsl	(working copy)
@@ -34,7 +34,8 @@
 
 -->
 
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
 
   <xsl:import href="../../../common/xslt/html/site2xhtml.xsl"/>
 <!--+
@@ -687,7 +688,7 @@
   <xsl:template match="div[@id='disable-font-script']">
     <xsl:if test="$disable-font-script = 'false'">
 	  <div class="trail">
-	        Font size: 
+	         <i18n:text >Font size:</i18n:text> 

You see I just surrounded the caption with a <i18n:text /> tag and added the key into
the common messages.

e.g. spanish translation:
+<catalogue>
+  <message  key="Font size:">Tamaño de fuente:</message>
+</catalogue>
 
or german:
+<catalogue>
+  <message key="Font size:">Schriftgrösse:</message>
+</catalogue>

So what we need is that 
1) we surround all captions with <i18n:text /> tags
2) add this keys to the catalogue

I will prepare an example how to do it with @attributes.

> Do not hard-code site-visible message strings in skin files
> -----------------------------------------------------------
>
>          Key: FOR-506
>          URL: http://issues.apache.org/jira/browse/FOR-506
>      Project: Forrest
>         Type: Improvement
>   Components: Skins (general issues)
>     Versions: 0.7-dev
>  Environment: N/A
>     Reporter: Pedro I. Sanchez
>     Assignee: Thorsten Scherler
>     Priority: Minor
>  Attachments: patchI18n.diff
>
> Text strings like "Copyright", "Published", and "Search" are hardcoded into skin files
like site2xhtml.xsl. When creating web sites in languages other than English the web developer
is forced to create local versions of these skin files with the appropriated translations.
> Instead, the DTD for the skinconf.xml should be improved to allow these translations
to be specified in this file. This would make Forrest much easier to use.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message