Very nice.
On Tue, Aug 2, 2016 at 6:20 AM, Vedmaka god.vedmaka@gmail.com wrote:
My pretty straightforward solution of this problem available here: https://www.mediawiki.org/wiki/Extension:Mustache_i18n
02.08.2016 4:20, Ryan Kaldari пишет:
That's correct AFAIK. The current method of using Mustache templates (via
the Mustache engine in core) is to translate the messages before they are passed to the Mustache template. For example:
echo $templateParser->processTemplate( 'MyWidget', array( 'username' => $user->getName(), 'message' => wfMessage( 'message-key' )->text() ) );
...or if you wanted to override the language...
echo $templateParser->processTemplate( 'MyWidget', array( 'username' => $user->getName(), 'message' => wfMessage( 'message-key' )->inLanguage( $lang )->text() ) );
I think adding a custom Mustache function (or lambda or whatever it's called) to the core Mustache engine for handling i18n would be a pretty good idea, personally. It would probably need a pretty thorough security vetting though.
On Sat, Jul 30, 2016 at 2:56 PM, Vedmaka god.vedmaka@gmail.com wrote:
Hi, Guys!
I was surprised by discovering that current Mustache engine lacks of i18n support, is it correct or I am missing something ?
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
--
Mediawiki & Semantic Mediawiki support: https://mediawiki.pro
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l