Purodha has uploaded a new change for review.
https://gerrit.wikimedia.org/r/254399
Change subject: Add canonical namespace names.
......................................................................
Add canonical namespace names.
Change-Id: I9eadb8aa04a591a4b7402b751b623b92c264378f
---
M App.php
M Database scripts/Convenience/wikidataCoreTables.sql
M OmegaWiki.hooks.php
3 files changed, 16 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData
refs/changes/99/254399/1
diff --git a/App.php b/App.php
index 05b9a4e..5090394 100644
--- a/App.php
+++ b/App.php
@@ -178,6 +178,7 @@
# $wgHooks['ParserBeforeStrip'][] =
'OmegaWikiHooks::onInternalParseBeforeLinks';
# $wgHooks['ParserBeforeInternalParse'][] =
'OmegaWikiHooks::onInternalParseBeforeLinks';
$wgHooks['InternalParseBeforeSanitize'][] =
'OmegaWikiHooks::onInternalParseBeforeLinks';
+$wgHooks['CanonicalNamespaces'][] = 'OmegaWikiHooks::addCanonicalNamespaces';
// Jobs
require_once( $wgWldSetupScriptPath . "OWJobs.php" );
diff --git a/Database scripts/Convenience/wikidataCoreTables.sql b/Database
scripts/Convenience/wikidataCoreTables.sql
index 69170d3..0fce6d9 100644
--- a/Database scripts/Convenience/wikidataCoreTables.sql
+++ b/Database scripts/Convenience/wikidataCoreTables.sql
@@ -1,3 +1,6 @@
+-- This script is outdated. There is no table 'namespace' any more. Purodha
2015-11-20.
+--
+
--
-- Add the wikidata specific namespaces
--
@@ -126,4 +129,4 @@
set_dmid int(10) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-
\ No newline at end of file
+
diff --git a/OmegaWiki.hooks.php b/OmegaWiki.hooks.php
index 21cb9f8..5e2ed47 100644
--- a/OmegaWiki.hooks.php
+++ b/OmegaWiki.hooks.php
@@ -61,4 +61,15 @@
return True;
}
+ /**
+ * Adds canonical namespaces.
+ */
+ public static function addCanonicalNamespaces( &$list ) {
+ $list[NS_DEFINEDMEANING] = 'DefinedMeaning';
+ $list[NS_DEFINEDMEANING + 1] = 'DefinedMeaning_talk';
+ $list[NS_EXPRESSION] = 'Expression';
+ $list[NS_EXPRESSION + 1] = 'Expression_talk';
+ return true;
+ }
+
}
--
To view, visit https://gerrit.wikimedia.org/r/254399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9eadb8aa04a591a4b7402b751b623b92c264378f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Purodha <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits