summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GentooToolbox/GentooToolbox.php4
-rw-r--r--GentooToolbox/localizedmsg/LocalizedMsg.php14
2 files changed, 18 insertions, 0 deletions
diff --git a/GentooToolbox/GentooToolbox.php b/GentooToolbox/GentooToolbox.php
index a5da0537..8ef161df 100644
--- a/GentooToolbox/GentooToolbox.php
+++ b/GentooToolbox/GentooToolbox.php
@@ -44,3 +44,7 @@ $wgAutoloadClasses['GTBXTranslationProperties'] = $dir . '/properties/Translat
$wgHooks['smwInitProperties'][] = 'GTBXTranslationProperties::setupProperties';
$wgHooks['SMWStore::updateDataBefore'][] = 'GTBXTranslationProperties::updateDataBefore';
+
+// LocalizedMessage
+$wgAutoloadClasses['GTBXLocalizedMsg'] = $dir . '/localizedmsg/LocalizedMsg.php';
+$wgHooks['ParserFirstCallInit'][] = 'GTBXLocalizedMsg::SetUpLocalizedMsgParserFunction';
diff --git a/GentooToolbox/localizedmsg/LocalizedMsg.php b/GentooToolbox/localizedmsg/LocalizedMsg.php
new file mode 100644
index 00000000..9db1abb2
--- /dev/null
+++ b/GentooToolbox/localizedmsg/LocalizedMsg.php
@@ -0,0 +1,14 @@
+<?php
+
+class GTBXLocalizedMsg {
+ public static function SetUpLocalizedMsgParserFunction( &$parser ) {
+ $parser->setFunctionHook( 'msg', 'GTBXLocalizedMsg::LocalizedMsgParserFunction' );
+
+ return true;
+ }
+
+ public static function LocalizedMsgParserFunction( $parser, $message, $language = 'en' ) {
+ return wfMessage( $message )->inLanguage( $language )->escaped();
+ }
+}
+?> \ No newline at end of file