Hiong3-eng5 has uploaded a new change for review.

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

Change subject: optional collation
......................................................................

optional collation

Since my local php copy does not have the Collator class, I need this
routine so that I can use Preference.  Kindly check if this works when
Collator class exist.

Change-Id: I1843c3b0968484da5a6cfacf039e91583824a51e
---
M Wikidata.hooks.php
1 file changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/Wikidata.hooks.php b/Wikidata.hooks.php
index 0391ea0..36cee70 100644
--- a/Wikidata.hooks.php
+++ b/Wikidata.hooks.php
@@ -71,8 +71,11 @@
                );
 
                $owLanguageNames = getOwLanguageNames();
-               $col = new Collator('en_US.utf8');
-               $col->asort( $owLanguageNames );
+               // There are PHP that does not have the Collator class. ~he
+               if ( class_exists( 'Collator', false ) ) {
+                       $col = new Collator('en_US.utf8');
+                       $col->asort( $owLanguageNames );
+               }
                foreach ( $owLanguageNames as $language_id => $language_name ) {
                        
$preferences['ow_language_filter_list']['options'][$language_name] = 
$language_id ;
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1843c3b0968484da5a6cfacf039e91583824a51e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 <hiong3.e...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to