> I must look into the link rewriter, maybe it'll be helpful here.

I found it very usefull, resulting in no broken links and no link translation hassle.

Moreover, I found the linkmap being a very useful resource: I used it to resolve the source content id and templates from the sitemap, thru input modules (starting from the document URI and retrieving various attributes in the linkmap).

And I believe the linkmap could be used as input of the CLI... it provides a complete overview of the site structure.

I had to tweak the LinkTransformer to handle logical links in Dreamweaver's onClick attributes, which look like this:

 MM_swapImage('domdesc','','pict:dom-desc-over',1)

and I wanted them to get translated to:

 MM_swapImage('domdesc','','/comx/img/fr/dom-desc-over.gif',1)

I saw that Cocoon 2.1.5 comes with regular expressions for the link patterns. It 
wonder if it would do it without tweaking the transformer source code.

And here are some details of the linkmap translation I used. Maybe it is of interest?

The linkmap looks like this:

<linkmap>
   <site id="phga" href="/">
       <!-- Language independant homepage (users have to choose) -->
       <document><page id="intro" href="index.html" /></document>

       <!-- Language specific document collections -->
       <lang-specific href="{lang}/">

           <!-- Homepage in a specific language -->
           <document><page id="home" href="index.html" /></document>

<!-- Domain "Project description" -->
<domain id="desc" href="descriptif/">
<document><page id="desc-home" href="index.html" /></document>
<document><page id="desc-detail(p1)" href="detail(p1).html" /></document>
<document><page id="desc-detail(p2)" href="detail(p2).html" /></document>
<document><page id="desc-detail(p3)" href="detail(p3).html" /></document>
<document><page id="desc-detail(p4)" href="detail(p4).html" /></document>
</domain>
[...]


In the sitemap, the linkrewriter is used thru <map:call resource="linkrewriter"> with a parameter 'lang':

<map:resource name="linkrewriter">
<map:transform type="linkrewriter" src="cocoon:/{lang}/linkmap.abs.xml">
<map:parameter name="link-attrs" value="href src value content onmouseover onMouseOver onmouseout onMouseOut onload onLoad onclick onClick"/>
<map:parameter name="schemes" value="phga external"/>
<map:parameter name="exclude-schemes" value="http https ftp mailto news"/>
<map:parameter name="bad-link-str" value="bad-link"/>
</map:transform>
</map:resource>


The linkmap is translated thru the following pipeline:

<map:match pattern="*/linkmap.abs.xml">
<map:generate type="file" src="linkmap.xml"/>
<map:transform type="xslt" src="transform/links/linkmap-translation.xsl">
<map:parameter name="lang" value="{1}"/></map:transform>
<map:serialize type="xml"/>
</map:match>


and a request to "cocoon:/fr/linkmap.abs.xml" would return a translated linkmap like this:

<linkmap>

   <site id="phga" href="/">
       <!-- Language independant homepage (users have to choose) -->
       <document><page id="intro" href="/index.html"/></document>

       <!-- Language specific document collections -->
       <lang-specific href="/fr/">

           <!-- Homepage in a specific language -->
           <document><page id="home" href="/fr/index.html"/></document>

           <!-- Domain "Project description" -->
           <domain id="desc" href="/fr/descriptif/">

               <document><page id="desc-home" 
href="/fr/descriptif/index.html"/></document>
               <document><page id="desc-detail(p1)" 
href="/fr/descriptif/detail(p1).html"/></document>
               <document><page id="desc-detail(p2)" 
href="/fr/descriptif/detail(p2).html"/></document>
               <document><page id="desc-detail(p3)" 
href="/fr/descriptif/detail(p3).html"/></document>
               <document><page id="desc-detail(p4)" 
href="/fr/descriptif/detail(p4).html"/></document>
           </domain>

The linkmap-translation.xsl XSL script was adapted from Forrest's 
absolutize-linkmap.xsl and does actually two things:
1) replaces all {lang} occurrences with a parameter value ("fr" in the example above);
2) absolutizes the href="..." attribute contents.

--
Olivier


Upayavira wrote:

Olivier Lange wrote:

Hi Joose

I used option 2 for a large site, with a complete user request space available in all langages. If some content is not available in some language, I put an explicit mention about the missing translation on that page, plus a text in some other langage.

For instance: this page is available in french, german, italian and english, but not rumantsch; so there's a mention:
http://www.gallerie-ph.ch/rm/events/construct-sonor/klanginstall/index.html



All this handled thru Linkrewriter and i18n message catalogs, so there is no link manipulation needed in the XSLT. By the way: the linkmap gets translated in each language also, of course. The message catalogs are generated.


Interesting. But if I set my browser's locale to French, that isn't taken into account, is it?

I must look into the link rewriter, maybe it'll be helpful here.

I'm working on an i18n site at the moment, and have created the I18nMatcher (soon to become the LocaleMatcher) for just this purpose. I also intend to get the Command Line Interface to be able to handle the creation of pages in different languages.

Maybe just the homepage could respond to a browser locale, and the rest are served as en/page.html, fr/page.html, etc.

Hmm.

Upayavira, who is a complete newbie when it comes to i18n.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to