I can think of one potential drawback: Document objects are loaded/
saved at the same time as the object and thus the more translations
there are for the page the longer it'll take to display the page,
although the performance is probably minimal as this should be done
in the same SQL query.
-Vincent
On Jul 16, 2007, at 5:00 PM, Vincent Massol wrote:
hmm... I forgot one thing... We still need the ability
to translate
in different language inside the XWiki.PropertiesClass object...
Thus I propose the following convention:
* One XWikiPropertiesClass per required translation
* The language is defined as property of the XWikiPropertiesClass
class which has 2 property:
- one "locale" property
- one "properties" property with properties on each line as in a
properties file
Thanks
-Vincent
On Jul 16, 2007, at 4:49 PM, Vincent Massol 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