forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pedro I. Sanchez" <>
Subject Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Date Tue, 07 Jun 2005 03:11:17 GMT
On Sun, 2005-05-06 at 14:04 +0200, Thorsten Scherler wrote:
> > This is key for me. If I cannot specify the language when I run
> > "forrest" to build my site then this is not a good solution. I guess the
> > other option would be to hard-code value="es_ES" in the above. At least
> > this would be just "one" thing hard coded :|
> > 
> Yeah that would solve your usecase, but in the future that should be
> done like you suggested in your former mail.
> LANG=de_DE forrest
> Any thoughts, how?

I've been playing a little bit with this, and I mean "playing" indeed.
Basically trial and error since I'm not familiar with the Cocoon
machinery at all.

Anyway, first I verified that setting value="es_ES" in
main/webapp/sitemap.xmap indeed works. It brings the Spanish strings
from the right catalogue. I also verified that value="${env.LANG}" does
*not* work.

It then occurred to me that I should be able to specify the locale
string in the site's file. So I tested two changes:

1) First change

Index: main/
--- main/      (revision 180126)
+++ main/      (working copy)
@@ -104,7 +104,8 @@
         <equals arg1="${project.i18n}" arg2="true"/>
-          <property name=""
location="${}/site/${env.LANG}"    />
+          <property name="project.language"
location="${env.LANG}" />
+          <property name=""
location="${}/site/${project.language}"    />
           <property name=""
location="${}/site"    />

In my site's I have to add


And this alone works just well. The site is generated under
build/site/es_ES but with English labels. The next step is
required to get the translations in place.

2) Second change: Reflecting these changes in the sitemap

Index: main/webapp/sitemap.xmap
--- main/webapp/sitemap.xmap    (revision 180126)
+++ main/webapp/sitemap.xmap    (working copy)
@@ -234,7 +234,7 @@
         <map:transform type="i18n">
-          <map:parameter name="locale" value="{request:locale}"/>
+          <map:parameter name="locale" value="{project:language}"/>

Unfortunately these gives me a null pointer and dies :( But there's tons
of {project:xxxx} strings used everywhere in the site map! So, what's
missing to make my newly created "language" property to work? likes it but sitemap.xmap doesn't.

What is then the right way to define a new project property?


View raw message