Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -84,6 +84,31 @@ |
85 | 85 | 'ow_uipref_datasets' => 'Default view', |
86 | 86 | 'ow_uiprefs' => 'Wikidata', |
87 | 87 | 'ow_none_selected' => '<None selected>', |
| 88 | + 'ow_conceptmapping_help' => "<p>possible actions: <ul> |
| 89 | + <li>&action=insert&<data_context_prefix>=<defined_id>&... insert a mapping</li> |
| 90 | + <li>&action=get&concept=<concept_id> read a mapping back</li> |
| 91 | + <li>&action=list_sets return a list of possible data context prefixes and what they refer to.</li> |
| 92 | + <li>&action=get_associated&dm=<defined_meaning_id>&dc=<dataset_context_prefix> for one defined meaning in a concept, return all others</li> |
| 93 | + <li>&action=help Show helpful help.</li> |
| 94 | + </ul></p>", |
| 95 | + 'ow_conceptmapping_uitext' => " |
| 96 | + <p>Concept Mapping allows you to identify |
| 97 | + which defined meaning in one dataset is identical |
| 98 | + to defined meanings in other datasets.</p>\n |
| 99 | + <p>Please enter or cut and paste the defined |
| 100 | + meanings (with id), or simply the defined meaning ids |
| 101 | + which are identical.</p>\n |
| 102 | + <p> For example, you could paste <code>DefinedMeaning:Boat (7774)</code> |
| 103 | + or simply type <code>7774</code>.</p>\n", |
| 104 | + 'ow_conceptmapping_no_action_specified'=>"Apologies, I don't know how to '$1'.", |
| 105 | + 'ow_OK'=>'OK', |
| 106 | + 'ow_not_present_or_malformed'=>'not present or malformed', |
| 107 | + 'ow_mapping_successful'=>"Mapped all fields marked with [OK]<br>\n", |
| 108 | + 'ow_mapping_unsuccessful'=>"Need to have at least two defined meanings before I can link them.\n", |
| 109 | + 'ow_will_insert'=>"Will insert the following:", |
| 110 | + 'ow_contents_of_mapping'=>'Contents of mapping', |
| 111 | + 'ow_available_contexts'=>'Available contexts', |
| 112 | + 'add_concept_link'=>'Add link to other concepts' |
88 | 113 | ) |
89 | 114 | ); |
90 | 115 | |
Index: trunk/extensions/Wikidata/Database scripts/Convenience/Create wikidata.php |
— | — | @@ -3,9 +3,12 @@ |
4 | 4 | # this module create a wikidata extension for mediawiki |
5 | 5 | # it generates the tables in a database (passed as parameter) with a defined prefix (passed as parameter) |
6 | 6 | |
| 7 | +define('MEDIAWIKI', true ); |
| 8 | + |
7 | 9 | $wgUseMasterForMaintenance = true; |
| 10 | +require_once( "../../../../LocalSettings.php"); |
8 | 11 | require_once( "../../../../maintenance/commandLine.inc"); |
9 | | -#require_once( "../../../../LocalSettings.php"); |
| 12 | +require_once( "../../OmegaWiki/WikiDataAPI.php"); |
10 | 13 | #require_once( "install-utils.inc" ); |
11 | 14 | #require_once( "AdminSettings.php"); |
12 | 15 | #require_once( "GlobalFunctions.php" ); |
— | — | @@ -125,6 +128,8 @@ |
126 | 129 | ReadSQLFile( $wdDatabase, "/*\$wgWDprefix*/", $wgWDprefix, $wgWDtemplate ); |
127 | 130 | $wdDatabase->query( "DELETE FROM wikidata_sets WHERE set_prefix = '$prefix'" ); |
128 | 131 | $wdDatabase->query( "INSERT INTO wikidata_sets (set_prefix,set_fallback_name,set_dmid) VALUES ('$prefix','$comment',0)" ); |
| 132 | +bootstrapCollection("datasets",85,"MAPP",$wgWDprefix); |
| 133 | + |
129 | 134 | $wdDatabase->close(); |
130 | 135 | |
131 | | -?> |
\ No newline at end of file |
| 136 | +?> |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | } |
165 | 165 | $cmtitle=Title::newFromText("Special:ConceptMapping"); |
166 | 166 | $titleText=$wgTitle->getPrefixedURL(); |
167 | | - $cmlink=$sk->makeLinkObj($cmtitle,"<small>Add link to other concepts</small>","set_$dc=$titleText&suppressWarnings=true"); |
| 167 | + $cmlink=$sk->makeLinkObj($cmtitle,"<small>".wfMsg("add_concept_link")."</small>","set_$dc=$titleText&suppressWarnings=true"); |
168 | 168 | $html.="<tr><td>$cmlink</td></tr>\n"; |
169 | 169 | $html.="</table>\n"; |
170 | 170 | $html.="</div>\n"; |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php |
— | — | @@ -26,17 +26,17 @@ |
27 | 27 | return createPage($expressionNameSpaceId, getPageTitle($this->spelling)); |
28 | 28 | } |
29 | 29 | |
30 | | - function isBoundToDefinedMeaning($definedMeaningId) { |
31 | | - return expressionIsBoundToDefinedMeaning($definedMeaningId, $this->id); |
| 30 | + function isBoundToDefinedMeaning($definedMeaningId, $dc=null) { |
| 31 | + return expressionIsBoundToDefinedMeaning($definedMeaningId, $this->id, $dc); |
32 | 32 | } |
33 | 33 | |
34 | | - function bindToDefinedMeaning($definedMeaningId, $identicalMeaning) { |
35 | | - createSynonymOrTranslation($definedMeaningId, $this->id, $identicalMeaning); |
| 34 | + function bindToDefinedMeaning($definedMeaningId, $identicalMeaning, $dc=null) { |
| 35 | + createSynonymOrTranslation($definedMeaningId, $this->id, $identicalMeaning, $dc); |
36 | 36 | } |
37 | 37 | |
38 | | - function assureIsBoundToDefinedMeaning($definedMeaningId, $identicalMeaning) { |
39 | | - if (!$this->isBoundToDefinedMeaning($definedMeaningId)) |
40 | | - $this->bindToDefinedMeaning($definedMeaningId, $identicalMeaning); |
| 38 | + function assureIsBoundToDefinedMeaning($definedMeaningId, $identicalMeaning, $dc=null) { |
| 39 | + if (!$this->isBoundToDefinedMeaning($definedMeaningId, $dc)) |
| 40 | + $this->bindToDefinedMeaning($definedMeaningId, $identicalMeaning, $dc); |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
— | — | @@ -78,9 +78,9 @@ |
79 | 79 | return ""; |
80 | 80 | } |
81 | 81 | |
82 | | -function getExpressionId($spelling, $languageId) { |
| 82 | +function getExpressionId($spelling, $languageId, $dc=null) { |
83 | 83 | |
84 | | - $dc=wdGetDataSetContext(); |
| 84 | + $dc=wdGetDataSetContext($dc); |
85 | 85 | |
86 | 86 | $dbr = &wfGetDB(DB_SLAVE); |
87 | 87 | $sql = "SELECT expression_id FROM {$dc}_expression_ns " . |
— | — | @@ -91,9 +91,10 @@ |
92 | 92 | return isset($expression->expression_id) ? $expression->expression_id : null; |
93 | 93 | } |
94 | 94 | |
95 | | -function createExpressionId($spelling, $languageId) { |
| 95 | +function createExpressionId($spelling, $languageId, $dc=null) { |
96 | 96 | |
97 | | - $dc=wdGetDataSetContext(); |
| 97 | + $dc=wdGetDataSetContext($dc); |
| 98 | + wfDebug("Context : $dc"); |
98 | 99 | |
99 | 100 | $expressionId = newObjectId("{$dc}_expression_ns"); |
100 | 101 | |
— | — | @@ -146,24 +147,24 @@ |
147 | 148 | return $revisionId; |
148 | 149 | } |
149 | 150 | |
150 | | -function findExpression($spelling, $languageId) { |
151 | | - if ($expressionId = getExpressionId($spelling, $languageId)) |
| 151 | +function findExpression($spelling, $languageId, $dc=null) { |
| 152 | + if ($expressionId = getExpressionId($spelling, $languageId, $dc)) |
152 | 153 | return new Expression($expressionId, $spelling, $languageId); |
153 | 154 | else |
154 | 155 | return null; |
155 | 156 | } |
156 | 157 | |
157 | | -function createExpression($spelling, $languageId) { |
158 | | - $expression = new Expression(createExpressionId($spelling, $languageId), $spelling, $languageId); |
| 158 | +function createExpression($spelling, $languageId, $dc=null) { |
| 159 | + $expression = new Expression(createExpressionId($spelling, $languageId, $dc), $spelling, $languageId); |
159 | 160 | $expression->createNewInDatabase(); |
160 | 161 | return $expression; |
161 | 162 | } |
162 | 163 | |
163 | | -function findOrCreateExpression($spelling, $languageId) { |
164 | | - if ($expression = findExpression($spelling, $languageId)) |
| 164 | +function findOrCreateExpression($spelling, $languageId, $dc=null) { |
| 165 | + if ($expression = findExpression($spelling, $languageId, $dc)) |
165 | 166 | return $expression; |
166 | 167 | else |
167 | | - return createExpression($spelling, $languageId); |
| 168 | + return createExpression($spelling, $languageId, $dc); |
168 | 169 | } |
169 | 170 | |
170 | 171 | function getSynonymId($definedMeaningId, $expressionId) { |
— | — | @@ -178,9 +179,9 @@ |
179 | 180 | return 0; |
180 | 181 | } |
181 | 182 | |
182 | | -function createSynonymOrTranslation($definedMeaningId, $expressionId, $identicalMeaning) { |
| 183 | +function createSynonymOrTranslation($definedMeaningId, $expressionId, $identicalMeaning, $dc=null) { |
183 | 184 | |
184 | | - $dc=wdGetDataSetContext(); |
| 185 | + $dc=wdGetDataSetContext($dc); |
185 | 186 | |
186 | 187 | $synonymId = getSynonymId($definedMeaningId, $expressionId); |
187 | 188 | |
— | — | @@ -194,8 +195,8 @@ |
195 | 196 | $queryResult = $dbr->query($sql); |
196 | 197 | } |
197 | 198 | |
198 | | -function expressionIsBoundToDefinedMeaning($definedMeaningId, $expressionId) { |
199 | | - $dc=wdGetDataSetContext(); |
| 199 | +function expressionIsBoundToDefinedMeaning($definedMeaningId, $expressionId, $dc=null) { |
| 200 | + $dc=wdGetDataSetContext($dc); |
200 | 201 | $dbr = &wfGetDB(DB_SLAVE); |
201 | 202 | $queryResult = $dbr->query("SELECT expression_id FROM {$dc}_syntrans WHERE expression_id=$expressionId AND defined_meaning_id=$definedMeaningId AND ". getLatestTransactionRestriction("{$dc}_syntrans") ." LIMIT 1"); |
202 | 203 | |
— | — | @@ -431,8 +432,8 @@ |
432 | 433 | addTranslatedText($setId, $languageId, $text); |
433 | 434 | } |
434 | 435 | |
435 | | -function createText($text) { |
436 | | - $dc=wdGetDataSetContext(); |
| 436 | +function createText($text, $dc=null) { |
| 437 | + $dc=wdGetDataSetContext($dc); |
437 | 438 | $dbr = &wfGetDB(DB_MASTER); |
438 | 439 | $text = $dbr->addQuotes($text); |
439 | 440 | $sql = "insert into {$dc}_text(text_text) values($text)"; |
— | — | @@ -441,8 +442,8 @@ |
442 | 443 | return $dbr->insertId(); |
443 | 444 | } |
444 | 445 | |
445 | | -function createTranslatedContent($translatedContentId, $languageId, $textId) { |
446 | | - $dc=wdGetDataSetContext(); |
| 446 | +function createTranslatedContent($translatedContentId, $languageId, $textId, $dc=null) { |
| 447 | + $dc=wdGetDataSetContext($dc); |
447 | 448 | |
448 | 449 | $dbr = &wfGetDB(DB_MASTER); |
449 | 450 | $sql = "insert into {$dc}_translated_content(translated_content_id,language_id,text_id,add_transaction_id) values($translatedContentId, $languageId, $textId, ". getUpdateTransactionId() .")"; |
— | — | @@ -451,8 +452,8 @@ |
452 | 453 | return $dbr->insertId(); |
453 | 454 | } |
454 | 455 | |
455 | | -function translatedTextExists($textId, $languageId) { |
456 | | - $dc=wdGetDataSetContext(); |
| 456 | +function translatedTextExists($textId, $languageId, $dc=null) { |
| 457 | + $dc=wdGetDataSetContext($dc); |
457 | 458 | $dbr = &wfGetDB(DB_SLAVE); |
458 | 459 | $queryResult = $dbr->query( |
459 | 460 | "SELECT translated_content_id" . |
— | — | @@ -465,18 +466,18 @@ |
466 | 467 | return $dbr->numRows($queryResult) > 0; |
467 | 468 | } |
468 | 469 | |
469 | | -function addTranslatedText($translatedContentId, $languageId, $text) { |
470 | | - $textId = createText($text); |
471 | | - createTranslatedContent($translatedContentId, $languageId, $textId); |
| 470 | +function addTranslatedText($translatedContentId, $languageId, $text,$dc=null) { |
| 471 | + $textId = createText($text, $dc); |
| 472 | + createTranslatedContent($translatedContentId, $languageId, $textId, $dc); |
472 | 473 | } |
473 | 474 | |
474 | | -function addTranslatedTextIfNotPresent($translatedContentId, $languageId, $text) { |
475 | | - if (!translatedTextExists($translatedContentId, $languageId)) |
476 | | - addTranslatedText($translatedContentId, $languageId, $text); |
| 475 | +function addTranslatedTextIfNotPresent($translatedContentId, $languageId, $text, $dc=null) { |
| 476 | + if (!translatedTextExists($translatedContentId, $languageId, $dc)) |
| 477 | + addTranslatedText($translatedContentId, $languageId, $text, $dc); |
477 | 478 | } |
478 | 479 | |
479 | | -function getDefinedMeaningDefinitionId($definedMeaningId) { |
480 | | - $dc=wdGetDataSetContext(); |
| 480 | +function getDefinedMeaningDefinitionId($definedMeaningId, $dc=null) { |
| 481 | + $dc=wdGetDataSetContext($dc); |
481 | 482 | $dbr = &wfGetDB(DB_SLAVE); |
482 | 483 | $queryResult = $dbr->query("SELECT meaning_text_tcid FROM {$dc}_defined_meaning WHERE defined_meaning_id=$definedMeaningId " . |
483 | 484 | " AND " . getLatestTransactionRestriction("{$dc}_defined_meaning")); |
— | — | @@ -484,9 +485,9 @@ |
485 | 486 | return $dbr->fetchObject($queryResult)->meaning_text_tcid; |
486 | 487 | } |
487 | 488 | |
488 | | -function updateDefinedMeaningDefinitionId($definedMeaningId, $definitionId) { |
| 489 | +function updateDefinedMeaningDefinitionId($definedMeaningId, $definitionId, $dc=null) { |
489 | 490 | $dbr = &wfGetDB(DB_MASTER); |
490 | | - $dc=wdGetDataSetContext(); |
| 491 | + $dc=wdGetDataSetContext($dc); |
491 | 492 | $dbr->query("UPDATE {$dc}_defined_meaning SET meaning_text_tcid=$definitionId WHERE defined_meaning_id=$definedMeaningId" . |
492 | 493 | " AND " . getLatestTransactionRestriction("{$dc}_defined_meaning")); |
493 | 494 | } |
— | — | @@ -496,19 +497,19 @@ |
497 | 498 | return newObjectId("{$dc}_translated_content"); |
498 | 499 | } |
499 | 500 | |
500 | | -function addDefinedMeaningDefiningDefinition($definedMeaningId, $languageId, $text) { |
| 501 | +function addDefinedMeaningDefiningDefinition($definedMeaningId, $languageId, $text, $dc=null) { |
501 | 502 | $definitionId = newTranslatedContentId(); |
502 | | - addTranslatedText($definitionId, $languageId, $text); |
503 | | - updateDefinedMeaningDefinitionId($definedMeaningId, $definitionId); |
| 503 | + addTranslatedText($definitionId, $languageId, $text, $dc); |
| 504 | + updateDefinedMeaningDefinitionId($definedMeaningId, $definitionId, $dc); |
504 | 505 | } |
505 | 506 | |
506 | | -function addDefinedMeaningDefinition($definedMeaningId, $languageId, $text) { |
507 | | - $definitionId = getDefinedMeaningDefinitionId($definedMeaningId); |
| 507 | +function addDefinedMeaningDefinition($definedMeaningId, $languageId, $text, $dc=null) { |
| 508 | + $definitionId = getDefinedMeaningDefinitionId($definedMeaningId, $dc); |
508 | 509 | |
509 | 510 | if ($definitionId == 0) |
510 | | - addDefinedMeaningDefiningDefinition($definedMeaningId, $languageId, $text); |
| 511 | + addDefinedMeaningDefiningDefinition($definedMeaningId, $languageId, $text, $dc); |
511 | 512 | else |
512 | | - addTranslatedTextIfNotPresent($definitionId, $languageId, $text); |
| 513 | + addTranslatedTextIfNotPresent($definitionId, $languageId, $text, $dc); |
513 | 514 | } |
514 | 515 | |
515 | 516 | function createDefinedMeaningAlternativeDefinition($definedMeaningId, $translatedContentId, $sourceMeaningId) { |
— | — | @@ -606,12 +607,12 @@ |
607 | 608 | addDefinedMeaningToCollection($definedMeaningId, $collectionId, $internalId); |
608 | 609 | } |
609 | 610 | |
610 | | -function bootstrapCollection($collection, $languageId, $collectionType){ |
611 | | - $expression = findOrCreateExpression($collection, $languageId); |
612 | | - $definedMeaningId = addDefinedMeaning($expression->id); |
613 | | - $expression->assureIsBoundToDefinedMeaning($definedMeaningId, true); |
614 | | - addDefinedMeaningDefinition($definedMeaningId, $languageId, $collection); |
615 | | - return addCollection($definedMeaningId, $collectionType); |
| 611 | +function bootstrapCollection($collection, $languageId, $collectionType,$dc=null){ |
| 612 | + $expression = findOrCreateExpression($collection, $languageId, $dc); |
| 613 | + $definedMeaningId = addDefinedMeaning($expression->id, $dc); |
| 614 | + $expression->assureIsBoundToDefinedMeaning($definedMeaningId, true, $dc); |
| 615 | + addDefinedMeaningDefinition($definedMeaningId, $languageId, $collection, $dc); |
| 616 | + return addCollection($definedMeaningId, $collectionType, $dc); |
616 | 617 | } |
617 | 618 | |
618 | 619 | function getCollectionMeaningId($collectionId) { |
— | — | @@ -632,8 +633,8 @@ |
633 | 634 | return $dbr->fetchObject($queryResult)->collection_id; |
634 | 635 | } |
635 | 636 | |
636 | | -function addCollection($definedMeaningId, $collectionType) { |
637 | | - $dc=wdGetDataSetContext(); |
| 637 | +function addCollection($definedMeaningId, $collectionType, $dc=null) { |
| 638 | + $dc=wdGetDataSetContext($dc); |
638 | 639 | $collectionId = newObjectId("{$dc}_collection_ns"); |
639 | 640 | |
640 | 641 | $dbr = &wfGetDB(DB_MASTER); |
— | — | @@ -643,9 +644,9 @@ |
644 | 645 | return $collectionId; |
645 | 646 | } |
646 | 647 | |
647 | | -function addDefinedMeaning($definingExpressionId) { |
| 648 | +function addDefinedMeaning($definingExpressionId, $dc=null) { |
648 | 649 | $definedMeaningNameSpaceId = Namespace::getIndexForName('definedmeaning'); |
649 | | - $dc=wdGetDataSetContext(); |
| 650 | + $dc=wdGetDataSetContext($dc); |
650 | 651 | |
651 | 652 | $definedMeaningId = newObjectId("{$dc}_defined_meaning"); |
652 | 653 | |
— | — | @@ -759,8 +760,8 @@ |
760 | 761 | "VALUES ($valueId, $objectId, $attributeId, $translatedContentId, ". getUpdateTransactionId() .")"); |
761 | 762 | } |
762 | 763 | |
763 | | -function addTranslatedTextAttributeValue($objectId, $attributeId, $languageId, $text) { |
764 | | - $dc=wdGetDataSetContext(); |
| 764 | +function addTranslatedTextAttributeValue($objectId, $attributeId, $languageId, $text, $dc) { |
| 765 | + $dc=wdGetDataSetContext($dc); |
765 | 766 | $translatedTextValueAttributeId = newObjectId("{$dc}_translated_content_attribute_values"); |
766 | 767 | $translatedContentId = newTranslatedContentId(); |
767 | 768 | |
Index: trunk/extensions/Wikidata/OmegaWiki/suggest.js |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | http.onreadystatechange = function() { |
74 | 74 | if (http.readyState == 4) { |
75 | 75 | var newTable = document.createElement('div'); |
76 | | - |
| 76 | + //alert(http.responseText); |
77 | 77 | if (http.responseText != '') { |
78 | 78 | newTable.innerHTML = leftTrim(http.responseText); |
79 | 79 | table.parentNode.replaceChild(newTable.firstChild, table); |
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialConceptMapping.php |
— | — | @@ -17,18 +17,6 @@ |
18 | 18 | 'author' => 'Kim Bruning', |
19 | 19 | ); |
20 | 20 | |
21 | | -define('help_text', |
22 | | - "<p>possible actions: <ul> |
23 | | - <li>&action=insert&<data_context_prefix>=<defined_id>&... insert a mapping</li> |
24 | | - <li>&action=get&concept=<concept_id> read a mapping back</li> |
25 | | - <li>&action=list_sets return a list of possible data context prefixes and what they refer to.</li> |
26 | | - <li>&action=get_associated&dm=<defined_meaning_id>&dc=<dataset_context_prefix> for one defined meaning in a concept, return all others</li> |
27 | | - <li>&action=help Show helpful help.</li> |
28 | | - </ul></p>"); #brief help message |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | 21 | function wfSpecialConceptMapping() { |
34 | 22 | # Add messages |
35 | 23 | #require_once "$IP/includes/SpecialPage.php"; |
— | — | @@ -58,8 +46,8 @@ |
59 | 47 | } elseif ($action=="get_associated"){ |
60 | 48 | $this->get_associated(); |
61 | 49 | } else { |
62 | | - $wgOut->addWikiText("Apologies, I don't know how to '$action'."); |
63 | | - $wgOut->addWikiText(help_text); |
| 50 | + $wgOut->addWikiText(wfMsg('ow_conceptmapping_no_action_specified',$action)); |
| 51 | + $wgOut->addWikiText(wfMsg('ow_conceptmapping_help')); |
64 | 52 | } |
65 | 53 | } |
66 | 54 | |
— | — | @@ -67,16 +55,7 @@ |
68 | 56 | global $wgOut; |
69 | 57 | require_once("forms.php"); |
70 | 58 | |
71 | | - $wgOut->addHTML(" |
72 | | - <p>Concept Mapping allows you to identify |
73 | | - which defined meaning in one dataset is identical |
74 | | - to defined meanings in other datasets.</p>\n |
75 | | - <p>Please enter or cut and paste the defined |
76 | | - meanings (with id), or simply the defined meaning ids |
77 | | - which are identical.</p>\n |
78 | | - <p> For example, you could paste <code>DefinedMeaning:Boat (7774)</code> |
79 | | - or simply type <code>7774</code>.</p>\n"); |
80 | | - |
| 59 | + $wgOut->addHTML(wfMsg('ow_conceptmapping_uitext')); |
81 | 60 | $sets=wdGetDataSets(); |
82 | 61 | $options = array(); |
83 | 62 | $html=""; |
— | — | @@ -110,20 +89,20 @@ |
111 | 90 | if ($id!=null) { |
112 | 91 | $mappings[$key]=$id; |
113 | 92 | if(!$noerror) { |
114 | | - $wgOut->addHTML(' <span style="color:green">[OK]</span>'); |
| 93 | + $wgOut->addHTML(' <span style="color:green">['.wfMsg('ow_OK').']</span>'); |
115 | 94 | } |
116 | 95 | } else { |
117 | 96 | if(!$noerror) { |
118 | | - $wgOut->addHTML(' <span style="color:red">[not present or malformed]</span>'); |
| 97 | + $wgOut->addHTML(' <span style="color:red">['.wfMsg('ow_not_present_or_malformed').']</span>'); |
119 | 98 | } |
120 | 99 | } |
121 | 100 | $wgOut->addHTML("<br>\n"); |
122 | 101 | } |
123 | 102 | if (sizeOf($mappings)>1) { |
124 | 103 | createConceptMapping($mappings); |
125 | | - $wgOut->addHTML("Mapped all fields marked with [OK]<br>\n"); |
| 104 | + $wgOut->addHTML(wfMsg('ow_mapping_successful')); |
126 | 105 | } else { |
127 | | - $wgOut->addHTML("Need to have at least two defined meanings before I can link them"); |
| 106 | + $wgOut->addHTML(wfMsg('ow_mapping_unsuccessful')); |
128 | 107 | } |
129 | 108 | |
130 | 109 | } |
— | — | @@ -140,7 +119,7 @@ |
141 | 120 | protected function help() { |
142 | 121 | global $wgOut; |
143 | 122 | $wgOut->addWikiText("<h2>Help</h2>"); |
144 | | - $wgOut->addWikiText(help_text); |
| 123 | + $wgOut->addWikiText(wfMsg('ow_conceptmapping_help')); |
145 | 124 | } |
146 | 125 | |
147 | 126 | protected function insert() { |
— | — | @@ -150,7 +129,7 @@ |
151 | 130 | # $wgRequest->getText( 'page' ); |
152 | 131 | $sets=wdGetDataSets(); |
153 | 132 | #$requests=$wgRequest->getValues(); |
154 | | - $wgOut->addWikiText("<h2>Will insert the following:</h2>"); |
| 133 | + $wgOut->addWikiText("<h2>".wfMsg('ow_will_insert')."</h2>"); |
155 | 134 | $map=array(); |
156 | 135 | foreach ($sets as $key => $set) { |
157 | 136 | $dc=$set->getPrefix(); |
— | — | @@ -171,7 +150,7 @@ |
172 | 151 | global |
173 | 152 | $wgOut, $wgRequest; |
174 | 153 | $concept_id=$wgRequest->getText("concept"); |
175 | | - $wgOut->addWikiText("<h2>Contents of mapping:</h2>"); |
| 154 | + $wgOut->addWikiText("<h2>".wfMsg('ow_contents_of_mapping')."</h2>"); |
176 | 155 | $map=readConceptMapping($concept_id); |
177 | 156 | #$sets=wdGetDataSets(); |
178 | 157 | |
— | — | @@ -182,7 +161,7 @@ |
183 | 162 | |
184 | 163 | protected function list_sets() { |
185 | 164 | global $wgOut; |
186 | | - $wgOut->addWikiText("<h2>available contexts</h2>"); |
| 165 | + $wgOut->addWikiText("<h2>".wfMsg('available contexts')."</h2>"); |
187 | 166 | $sets=wdGetDataSets(); |
188 | 167 | foreach ($sets as $key => $set) { |
189 | 168 | $name=$set->fetchName(); |