Hi list, I first tried to introduce directly the in the document like this

Seach

The result is Internal Server Error Message: null Description: No details available. Sender: org.apache.cocoon.servlet.CocoonServlet Source: Cocoon Servlet Request URI evolution/indexi.html cause The prefix "i18n" for element "i18n:text" is not bound. request-uri /evolution/indexi.html Apache Cocoon 2.2.0-dev Then I realised that the modification of the browser language tranlate the tabs and the menu. So I try to go on with this method. I like the idea to separate text from non text. I did'nt use svg files. May be it interresting too. In my exemple we only modify indexi.xml to replace an image. If we had one file for each language (index_en.xml,index_de.xml ,index_se.xml) we should modify each file. In general we can keep the layout, and just change the text. I know there are two other possibilities than the browser lang to indicate the language. index.en.xml, index.de.xml , index.se.xml index.xml?lang=en, index.xml?lang=de, index.xml?lang=se, In those cases the sitemap.xmap should analyse the parameters and the suffixs to dectect the language. The sitemap.xmap should delclare a priority the resolve conflicts. Example langformatpriority=langparameter, browserlang,filesuffixlang My first idea was to have a separate first "treatment" to translate the source text everywhere: -in "boxes" organized in the general layout given by the skin (header, tabs, menu, footer) - in "boxes" organized in layout inside the page. But then I follow the sitemap.xmap and I modify as little as possible. Why did you switch the order and nested the map:select? I switch the order so that the pfd suits the browser lang value. But eventhought, I had a still a problem with the pdf display. At the beginning, it suits the browser lang value. Then it sticks to one lang. I don't know yet, if it a server cache problem or a mistake from my implementation. May be the following version with the "dispatcher" will simplifiy the way to have the same display. Paul Thorsten Scherler 28/02/2006 19:49 Please respond to user To: forrest dev cc: forrest user Subject: Re: forrest 0.7 multi language site contribution and question (second version) El lun, 27-02-2006 a las 08:34 +0100, Paul.Divine@alcatel.fr escribió: > > Hi list, > May be this mail should be send to a dev list. :) This discussion will go on on dev. ;) This is a really nice mail, thank you very much for this infos. ...the only thing that I wonder is whether we can simplify the process. ;) > > > In order to display with dynamic forrest (started with forrest run) > a page with a text corresponding to the language of the preference > of the browser of the user, I did the following modifications. > This only concerns the page, not the menu or the tabs. > The basic idea is to > - created a new DTD for document to introduce an element tt which > surround the text to be translated. Why did you not decided to use xml:lang? http://www.w3.org/TR/REC-xml/#sec-lang-tag > - to translate this tt element to an i18:text element with an xslt > stylesheet > - apply the i18n transformation to translate. Why did you not directly used http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html This text will be translated. > Note > In the examples > forrest is in D:\DATA\apache\apache-forrest-0.7 > forrest site is in D:\DATA\apache\apache-forrest-0.7-paul-site > > A) I create a new DTD document-v21.dtd with a new module > document-v21.mod > in directory > D:\DATA\apache\apache-forrest-0.7\main\webapp\resources\schema\dtd\ > > The document-v21.dtd is > > "-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN" > "common-charents-v10.mod"> > %common-charents; > > > > > > "-//APACHE//ENTITIES Documentation V2.1//EN" > "document-v21.mod"> > %document; > > > Note > Only the two lines are different from document-v20.dtd > "-//APACHE//ENTITIES Documentation V2.1//EN" > "document-v21.mod"> > > > in directory > D:\DATA\apache\apache-forrest-0.7\main\webapp\resources\schema\dtd\ > The document document-v21.mod is a copy of document-v20.mod > with differences given hereafter > > 1) The line > > becomes > > This line is put in comment > > 2) The folowing lines are added after > > > > 3) before the lines > > > > > add > > > > > > > > The basic idea is to surround text to be translated with the tt > element. > > > B) A new stylesheet i18ntext.xsl to replace by > in directory D:\DATA\apache\apache-forrest-0.7\main\webapp\resources > \stylesheets > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:i18n="http://apache.org/cocoon/i18n/2.1" > > > > > > > > > > > see above, why did you not directly declared i18n:text in the dtd and used tt? > C) Modify the sitemap.xmap in order to do the two modifications > (markup modification and translation) for html page and pdf page > in directory > D:\DATA\apache\apache-forrest-0.7\main\webapp > > After the lines > > > > > > Add the lines > > > > > > > > > > > > > > and after the lines > > > > > > > > > > > > > > add the lines > > > > > > > > > > > > Why did you decide to use inline translations over document specific. Like: index_en.xml; index_de.xml; index_es.xml; ... > D) in the pdf plugin output.xmap we inverse the presence test > to solve a problem of cache (this is a workaround) > (the cache does not recognise that the language has changed, so it > displays the same page) > in the directory > D:\DATA\apache\apache-forrest-0.7\build\plugins > \org.apache.forrest.plugin.output.pdf\ > > After the lines > > > > > > put in comment the lines > > and after add the lines > > > > > > > > > > > > > Why did you switch the order and nested the map:select? > E) In forrest.xmap in D:\DATA\apache\apache-forrest-0.7\main\webapp > In order to catch the new DTD. > After the lines > > > > Add the lines > > > > > > > Afer the lines > > src="{forrest:stylesheets}/docv20todocv13.xsl" /> > > Add the lines > > > src="{forrest:stylesheets}/docv20todocv13.xsl" /> > > > > F) in D:\DATA\apache\apache-forrest-0.7\main\webapp\skins\common > \translations > fill catalogs CommonMessages_xx.xml with in the languages you want. > For the example > I use CommonMessages_en_US.xml and CommonMessages_fr.xml > with already translated "Search". > Rechercher > > G) Update Catalog of forrest > In D:\DATA\apache\apache-forrest-0.7\main\webapp\resources\schema > \catalog.forrest > After the line > -- Document Type Definitions -- > > add the line > PUBLIC "-//APACHE//DTD Documentation V2.1//EN" > "dtd/document-v21.dtd" > > > H)in catalog.forrest.xcat in the directory > D:\DATA\apache\apache-forrest-0.7\main\webapp\resources\schema > After the line > > > add the lines > > uri="dtd/document-v21.dtd"/> > > > After the line > > add the lines > > > uri="dtd/document-v21.mod"/> > > > > I) Put in your page the new DOCTYPE and the text to translate in > markup. > Exemple indexi.xml > in the directory > D:\DATA\apache\apache-forrest-0.7-paul-site\src\documentation\content > \xdocs > > > "http://forrest.apache.org/dtd/document-v21.dtd"> > >
> <tt>Search</tt> untranslate >
> >
> <tt>Search</tt> untranslate >

Search untranslate >

>
> >
> > > > J) In forrest.properties of the site put the indicator to true > Example > D:\DATA\apache\apache-forrest-0.7-paul-site > After the line > #project.i18n=true > add the line > project.i18n=true > > K) In the directory of your site start the site with command "forrest > run" > > Example > cd D:\DATA\apache\apache-forrest-0.7-paul-site > SET JAVA_HOME=C:\java\j2sdk1.4.2_03 > set FOREST_HOME=C:\apache\apache-forrest-0.7 > set PATH=%PATH%;%FOREST_HOME%\bin > forrest run > > L) To look at the results > > - With your favorit browser put your language preferences to > english en_US > (tool/internet option/language ..) > > http://localhost:8888/indexi.html > You can see "Search" > and if you clic on the PDF icon you should see the same in pdf > format. > > - With your favorit browser put your language preferences to german > de > > http://localhost:8888/indexi.html > You can see "Suche" > and if you clic on the PDF icon you should see the same in pdf > format. > > - With your favorit browser put your language preferences to french > fr > > http://localhost:8888/indexi.html > You can see "Rechercher" > and if you clic on the PDF icon you should see the same in pdf > format. > > > Note > For the tab and the menu > Catalogues of the language should be define > D:\DATA\apache\apache-forrest-0.7-paul-site\src\documentation > \translations > langcode.xml > > menu_de.xml menu_fr.xml the menu_lang file should exist > > Restrictions > - The research function in the site is looking at the text in the > page > Only the basic langague is seen, not the translations. Some work > is > needed to add to the index the text of each language. Yeah, that would be easier if we use index_en.xml,... > - The other tags of i18n like "if" are not taken into account. yeah, why not using i18n:text right away? > - To inform the user of the multi language possibilities > a new skin should be done. yeah, right, but I think we should rather extend the dispatcher (implementing/testing i18n is next on my list). It is very easy with jx in the structurer to responding/requesting index_en.xml; index_de.xml; index_es.xml; ... > - Only document-v20.dtd can be translated all the other formats > cannot. Hmm. > > The question is: Why the Pdf function has no translation? I do not understand this question. salu2 -- thorsten "Together we stand, divided we fall!" Hey you (Pink Floyd)