Hiong3-eng5 has uploaded a new change for review. https://gerrit.wikimedia.org/r/132141
Change subject: Defined Meaning Namespace ...................................................................... Defined Meaning Namespace When a preferred language is not found in wgLang, the preferred language is searched at wgUser first, before defaulting to English, and then any other language. Change-Id: Id7e6d73eab24285797569dbefd904e5424543452 --- M OmegaWiki/WikiDataAPI.php 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData refs/changes/41/132141/1 diff --git a/OmegaWiki/WikiDataAPI.php b/OmegaWiki/WikiDataAPI.php index 6ccad7d..9ea6539 100644 --- a/OmegaWiki/WikiDataAPI.php +++ b/OmegaWiki/WikiDataAPI.php @@ -2573,6 +2573,7 @@ function definedMeaningExpression( $definedMeaningId ) { global $wgLang; + // get id via $wgLang $userLanguageId = getLanguageIdForCode( $wgLang->getCode() ) ; list( $definingExpressionId, $definingExpression, $definingExpressionLanguage ) = definingExpressionRow( $definedMeaningId ); @@ -2580,11 +2581,14 @@ if ( $userLanguageId > 0 ) { $result = definedMeaningExpressionForLanguage( $definedMeaningId, $userLanguageId ); } else { - $result = ""; + global $wgUser; + // try getting result via $wgUser instead + $result = definedMeaningExpressionForLanguage( $definedMeaningId, getLanguageIdForCode( $wgUser->mOptionOverrides['language'] ) ); } + if ( $result == "" ) { // if no expression exists for the specified language : look for an expression in English - $result = definedMeaningExpressionForLanguage( $definedMeaningId, 85 ); + $result = definedMeaningExpressionForLanguage( $definedMeaningId, WLD_ENGLISH_LANG_ID ); if ( $result == "" ) { $result = definedMeaningExpressionForAnyLanguage( $definedMeaningId ); -- To view, visit https://gerrit.wikimedia.org/r/132141 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7e6d73eab24285797569dbefd904e5424543452 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