[
http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312663 ]
Thorsten Scherler commented on FOR-506:
---------------------------------------
@@ -424,23 +430,21 @@
<xsl:choose>
<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 [EMAIL PROTECTED] ..."' to the form tag the value
will be marked as i18n:text.
The problem is that like stated in
http://cocoon.apache.org/2.1/userdocs/transformers/i18n-transformer.html#Attributes
"Parameter replacement is not available for attributes at this time."
That explains the following code changes for the forms:
@@ -424,23 +430,21 @@
<xsl:choose>
<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}:');"/>
-  
+ <form method="get" action="{$root}{$lucene-search}"><i18n:text
>Search the site with </i18n:text> 
+ <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> 
</form>
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> <xsl:value-of
select="$config/search/@provider"/></xsl:attribute>
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 @@
+<catalogue>
+ <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>
+</catalogue>
I committed the changes to revision 180026.
> 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