[xwiki-dev] [Proposal] Internationalizing XWiki Applications

Vincent Massol vincent at massol.net
Wed Jul 25 10:38:29 CEST 2007


Hi Catalin,

On Jul 25, 2007, at 9:45 AM, Catalin Hritcu wrote:

> Hi Vincent,
>
> Sorry for responding so late to this. There is however something that
> scares me about your proposal.
>
> The use case is this: changing the translation of one single existing
> string (suppose the previous translation was not good enough).
>
> It seems to me it will be hard to find out where the translation of
> this particular string is defined. The most severe seem to be use
> cases 2 and 3, where the call to msg explicitly specifies a place, but
> well that is just taken as a hint.
>
>>    - It'll search first in that doc's PropertiesClass and if not
>> found in XWiki's registered document bundles and if not there in
>> XWiki's static resource bundle files
>
> Assuming there are 3 document bundles registered with XWiki, there
> will be 5 different places (and a fixed order between them) where the
> user needs to look for his string.
>
> So what is the reason for applying the fallback mechanism when the
> user has explicitly mentioned where the string should come from?

I wasn't sure about that myself and I think I agree with you that if  
the user specified the location from where to take the translation  
then we shouldn't bubble up.

Thanks
-Vincent

> On 7/16/07, Vincent Massol <vincent at massol.net> wrote:
>> Hi,
>>
>> Here's my proposal for internationalizing XWiki apps. The idea is to
>> propose several solutions for XWiki apps writers:
>>
>> * Use case 1: I have lots of text on my page
>>    - solution: use XWiki's mechanism for translating page by creating
>> several editions of the page in the different languages
>>
>> * Use case 2: I want translation resources for my application only
>> and I'd like to share resources between pages
>>    - solution: use:  $msg("mykey",
>> "MySpace.MyTranslationDocForThisApplication")
>>    - MySpace.MyTranslationDocForThisApplication is a standard
>> document to which a XWiki.PropertiesClass object is attached
>>    - It'll search first in that doc's PropertiesClass and if not
>> found in XWiki's registered document bundles and if not there in
>> XWiki's static resource bundle files
>>
>> * Use case 3: I want translation resources only for a given page
>>    - solution: use:  $msg("mykey", $doc)
>>    - You'll need to have attached a PropertieClass object to the page
>> where $msg is used
>>    - It'll search first in that object and if not found in XWiki's
>> registered document bundles and if not there in XWiki's static
>> resource bundle files
>>
>> * Use case 4: I want to have a global translation resources for all
>> my apps in the wiki
>>    - solution: use:  $msg("mykey")
>>    - You'll need to have created ad registered resource bundle
>> documents in the Wiki preferences
>>    - It'll search first in XWiki's registered document bundles and if
>> not there in XWiki's static resource bundle files
>>
>> Implementation details:
>>
>> * Add XWikiMessageTool.get(String, String) API
>> * Add XWiki.PropertiesClass class in XE in the Administration
>> Application + a class sheet for presenting the properties nicely
>>
>> WDYT?
>>
>> Thanks
>> -Vincent





More information about the devs mailing list