Hello all,

My point is to show different versions of a picture for different
values of the users' locale, this will help for any picture with text
in it.

The first path explored was to have different picture for each locale :
* my_picture_en.jpg
* my_picture_fr.jpg

and to have sitemap replace a reference to /my_picture.jpg/ to the
correct localized version.
In order to reduce the number of images nedded, only the language part
of the locale is desired.

The org.apache.cocoon.matching.LocaleMatcher documentation indicated
that, among others, a *langage variable* was available within the
matcher, so I tried this :

========== BEGIN SITEMAP.XMAP SNAPSHOT ==============
[...]

<map:matcher logger="sitemap.matcher.locale" name="i18n"
                     src="org.apache.cocoon.matching.LocaleMatcher">       
        <locale-attribute>locale</locale-attribute>
        <use-locale>true</use-locale>
        <default-locale language="fr"/>
        <create-session>false</create-session>
        <store-in-request>true</store-in-request>
        <store-in-session>false</store-in-session>
        <store-in-cookie>false</store-in-cookie>
</map:matcher>

[...]

<map:match pattern="**/images/*.gif">
        <map:match type="i18n">
                <map:read mime-type="image/gif"
                                
src="{system-property:site.home}/images/{2}_{language}.gif"/>
        </map:match>
</map:match>

[...]
================END OF SNAPSHOT=============

Unfortunately, that doesn't work, server log sys :

(date) DEBUG [net.sf.ehcache.store.MemoryStore] cocoon-ehcache-1Cache:
MemoryStore miss for
PK_R-resource-file:/path/to/images/my_picture_.gif

As you can see, the /language/ is missing to the filename. When I try
to switch the two map:match, the log indicate that the server is
trying to reach file named *_en.gif* or *_fr.gif*.

Where is my mistake ? what's wrong ? Is there a better way to
internationalize pictures ?

Thanks for reading me through the end, and thanks in advance for any
answer, clue or help.

regards.

Thomas Detoux

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

Reply via email to