[MediaWiki-l] Mustache i18n

Vedmaka god.vedmaka at gmail.com
Tue Aug 2 20:15:18 UTC 2016


Contributions are appreciated :)

02.08.2016 19:53, Ryan Kaldari пишет:
> Very nice.
>
> On Tue, Aug 2, 2016 at 6:20 AM, Vedmaka <god.vedmaka at 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 at 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
>>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


-- 

_____________________________________________________________
Mediawiki & Semantic Mediawiki support: https://mediawiki.pro








More information about the MediaWiki-l mailing list