Internationalisation/Localisation
In working on trying to make sure an XWiki application is localisable I have found that the content of pages can be dealt with easily, but not so with classes and objects (or attachments). Has anybody found a good way to localise class "Pretty Name" and list values ? Or have recommendations on the best way to internationalise/localise object values? Thanks, David [email protected] --
Hi David, Check ListClass getDisplayValue to see how internationalized strings for list values are retrieved: */ protected String getDisplayValue(String value, String name, Map map, XWikiContext context) { ListItem item = (ListItem) map.get(value); String displayValue; if (item == null) { displayValue = value; } else { displayValue = item.getValue(); } if ((context == null) || (context.getWiki() == null)) { return displayValue; } String msgname = getFieldFullName() + "_" + value; String newresult = context.getWiki().getMessage(msgname, context); if (msgname.equals(newresult)) { msgname = "option_" + name + "_" + value; newresult = context.getWiki().getMessage(msgname, context); if (msgname.equals(newresult)) { msgname = "option_" + value; newresult = context.getWiki().getMessage(msgname, context); if (msgname.equals(newresult)) { return displayValue; } } } return newresult; } Ludovic David Ward a écrit :
In working on trying to make sure an XWiki application is localisable I have found that the content of pages can be dealt with easily, but not so with classes and objects (or attachments).
Has anybody found a good way to localise class "Pretty Name" and list values ? Or have recommendations on the best way to internationalise/localise object values?
Thanks,
David [email protected] --
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost AIM: nvludo Yahoo: ludovic
participants (2)
-
David Ward -
Ludovic Dubost