[Yanel-dev] Language version API

Josias Thöny josias.thoeny at wyona.com
Fri Mar 30 22:26:14 CEST 2007


Hi,

Michi proposed to store the information about language versions as 
follows in the resource configuration:

<yanel:property name="language" value="de"/>

<yanel:custom-config 
xmlns:xr="http://www.wyona.org/yanel/resource/xml-resource/1.0">
   <xr:alternative-languages>
     <xr:alternative-language lang="en" href="/about_en.html"/>
     <xr:alternative-language lang="es" href="/es/acerca.html"/>
   </xr:alternative-languages>
</yanel:custom-config>


Now the question is how to make this accessible in java. Maybe we could 
introduce a "Translatable" interface for resources which support 
multiple language versions:

interface Translatable {
     String getLanguage();
     String[] getLanguages();

     Resource getTranslation(String language);
     void addTranslation(Resource resource, String language);
     void removeTranslation(String language);
     boolean hasTranslation(String language);
}

WDYT?

josias



More information about the Yanel-development mailing list