forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thorsten Scherler (JIRA)" <>
Subject [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Date Sat, 04 Jun 2005 21:36:39 GMT
    [ ] 

Thorsten Scherler commented on FOR-506:

@@ -424,23 +430,21 @@
               <xsl:when test="$config/search/@provider = 'lucene'">
                 <!-- Lucene search -->
-		  <input type="submit" value="Search" name="Search"/>
+                  <input type="submit" value="Search" name="Search" i18n:attr="value"/>

By adding  'i18n:attr="value another@attribute ..."'  to the form tag the value will be marked
as i18n:text.

The problem is that like stated in

"Parameter replacement is not available for attributes at this time."

That explains the following code changes for the forms:
@@ -424,23 +430,21 @@
               <xsl:when test="$config/search/@provider = 'lucene'">
                 <!-- Lucene search -->
-                <form method="get" action="{$root}{$lucene-search}">
-                  <input type="text" id="query" name="queryString" size="18"
-                    value="Search with {$config/search/@provider}:"
-                    onFocus="getBlank (this, 'Search with {$config/search/@provider}:');"/>
-		  &#160;
+                <form method="get" action="{$root}{$lucene-search}"><i18n:text >Search
the site with </i18n:text>&#160;
+                  <input type="text" id="query" name="queryString" size="18" onFocus="getBlank
(this, '{$config/search/@provider}');">
+                    <xsl:attribute name="value"><xsl:value-of select="$config/search/@provider"/></xsl:attribute>
+                  </input>&#160;

I tried some workarounds to overcome above mentioned limitation but that did not work, one
idea was:
<xsl:attribute name="value"><i18n:text >Search the site with </i18n:text>&#160;<xsl:value-of
but that gave an exeption. :(

The last step was to add the keys to the catalog. e.g. spanish:
Index: webapp/skins/common/messages/CommonMessages_es.xml
--- webapp/skins/common/messages/CommonMessages_es.xml	(revision 0)
+++ webapp/skins/common/messages/CommonMessages_es.xml	(revision 0)
@@ -0,0 +1,22 @@
+  <message key="Font size:">Tamaño de fuente:</message>
+  <message key="Last Published:">Último publicado:</message>
+  <message key="Search">Búsqueda</message>
+  <message key="Search the site with">Búsqueda en</message>

I committed the changes to revision 180026.

> Do not hard-code site-visible message strings in skin files
> -----------------------------------------------------------
>          Key: FOR-506
>          URL:
>      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:
For more information on JIRA, see:

View raw message