Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -81,6 +81,9 @@ |
82 | 82 | $wgDefinedMeaningPageTitlePrefix = ""; |
83 | 83 | $wgExpressionPageTitlePrefix = "Multiple meanings"; |
84 | 84 | require_once("$IP/extensions/Wikidata/OmegaWiki/GotoSourceTemplate.php"); |
| 85 | + |
| 86 | +$dir = dirname( __FILE__ ) . '/'; |
| 87 | +$wgExtensionMessagesFiles['Wikidata'] = $dir . 'SpecialLanguages.i18n.php'; |
85 | 88 | |
86 | 89 | $wgGotoSourceTemplates = array(5 => $swissProtGotoSourceTemplate); |
87 | 90 | |
— | — | @@ -195,11 +198,7 @@ |
196 | 199 | function initializeWikidata() { |
197 | 200 | global $wgExtensionPreferences, $wdSiteContext, $wgPropertyToColumnFilters; |
198 | 201 | |
199 | | - # Add extension messages to the cache (initialize it here because they will be needed below) |
200 | | - global $wgMessageCache, $wdMessages; |
201 | | - foreach( $wdMessages as $language => $translations ) { |
202 | | - $wgMessageCache->addMessages( $translations, $language ); |
203 | | - } |
| 202 | + wfLoadExtensionMessages( 'Wikidata' ); |
204 | 203 | |
205 | 204 | $dbr =& wfGetDB(DB_MASTER); |
206 | 205 | $dbr->query("SET NAMES utf8"); |
— | — | @@ -216,10 +215,9 @@ |
217 | 216 | 'size' => 10, |
218 | 217 | 'options' => $datasetarray |
219 | 218 | ); |
220 | | - |
221 | | - global |
222 | | - $messageCacheOK; |
223 | | - |
| 219 | + |
| 220 | + # FIXME: Temporary hack to ensure OmegaWikiAttributes does not exception. |
| 221 | + global $messageCacheOK; |
224 | 222 | $messageCacheOK = true; |
225 | 223 | |
226 | 224 | global |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php |
— | — | @@ -325,10 +325,10 @@ |
326 | 326 | |
327 | 327 | public function __get($key) { |
328 | 328 | if (!$this->setup()) |
329 | | - throw new Exception("OmegaWikiAttributes accessed, but was not properly initialized"); |
| 329 | + throw new MwException("OmegaWikiAttributes accessed, but was not properly initialized"); |
330 | 330 | $attributes=&$this->attributes; |
331 | 331 | if (!array_key_exists($key, $attributes)) { |
332 | | - throw new Exception("Key does not exist: " . $key); |
| 332 | + throw new MwException("Key does not exist: " . $key); |
333 | 333 | } |
334 | 334 | return $attributes[$key]; |
335 | 335 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | function createPage() { |
| 32 | + # FIXME: This method is no longer present. |
32 | 33 | $expressionNameSpaceId = Namespace::getIndexForName('expression'); |
33 | 34 | wfDebug("NS ID: $expressionNameSpaceId \n"); |
34 | 35 | return createPage($expressionNameSpaceId, getPageTitle($this->spelling)); |
— | — | @@ -768,6 +769,7 @@ |
769 | 770 | } |
770 | 771 | |
771 | 772 | function addDefinedMeaning($definingExpressionId) { |
| 773 | + # FIXME: This method is no longer present. |
772 | 774 | $definedMeaningNameSpaceId = Namespace::getIndexForName('definedmeaning'); |
773 | 775 | $dc=wdGetDataSetContext(); |
774 | 776 | |