Take a look at the CentralNotice extension. It provides it's own interface for adding custom translatable messages. There might be some code there that is useful to you.
Ryan Kaldari
On 4/8/13 12:05 PM, Yuri Astrakhan wrote:
Hi, I need to use the localization framework - wfMessage() to translate my own custom messages. I have a message dictionary in the form of {languageCode => message, ...}, and looking for a way to inject those messages into the message cache. The actual messages dictionary is stored as a custom setting as part of a json blob, and cannot be added to the regular $message['xx'] = '...'; for translatewiki. Thanks!
Usage scenario:
// Array is generated from an external source and will look like this: $messageMap = array('en'=>'aaa', 'fr'=>'b {{SITENAME}} b', ...);
// Some magic method to add the entire message map into message cache messageCache->Add('custom-key1', $messageMap);
// Process message // Note that in case 'fr' is not defined, it should fallback using default resolution rules. $result = wfMessage('custom-key1')->inLanguage('fr')->text(); _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l