Kipcool has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/51837


Change subject: PageContentLanguage hook when userlang is rtl, page content is 
rtl
......................................................................

PageContentLanguage hook
when userlang is rtl, page content is rtl

Change-Id: Ib60ecffa1513f05409f86bcb4b0e6ff82555346b
---
M App.php
M Wikidata.hooks.php
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData 
refs/changes/37/51837/1

diff --git a/App.php b/App.php
index 3c2b04c..cfac608 100644
--- a/App.php
+++ b/App.php
@@ -188,6 +188,7 @@
 $wgHooks['NamespaceIsMovable'][] = 
'WikiLexicalDataHooks::onNamespaceIsMovable';
 $wgHooks['SpecialSearchNogomatch'][] = 'WikiLexicalDataHooks::onNoGoMatchHook';
 $wgHooks['SearchGetNearMatchBefore'][] = 'WikiLexicalDataHooks::onGoClicked';
+$wgHooks['PageContentLanguage'][] = 
'WikiLexicalDataHooks::onPageContentLanguage';
 $wgHooks['SkinTemplateNavigation'][] = 
'WikiLexicalDataHooks::onSkinTemplateNavigation';
 
 // LocalApp.php is optional. Its function is like LocalSettings.php,
diff --git a/Wikidata.hooks.php b/Wikidata.hooks.php
index f7c1814..0f2b3e8 100644
--- a/Wikidata.hooks.php
+++ b/Wikidata.hooks.php
@@ -148,6 +148,15 @@
                return true; // no match
        }
 
+       public static function onPageContentLanguage( $title, &$pageLang ) {
+               if ( $title->getNamespace() === NS_EXPRESSION || 
$title->getNamespace() === NS_DEFINEDMEANING ) {
+                       global $wgLang;
+                       // in this wiki, we try to deliver content in the user 
language
+                       $pageLang = $wgLang;
+               }
+               return true;
+       }
+
        public static function onSkinTemplateNavigation ( &$skin, &$links ) {
 
                // only for Expression and DefinedMeaning namespaces

-- 
To view, visit https://gerrit.wikimedia.org/r/51837
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib60ecffa1513f05409f86bcb4b0e6ff82555346b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Kipcool <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to