https://bugzilla.wikimedia.org/show_bug.cgi?id=34383

       Web browser: ---
             Bug #: 34383
           Summary: SemanticMediaWiki: Canonical namespace names are set
                    incorrectly.
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: van.de.bug...@gmail.com
                CC: jeroen_ded...@yahoo.com, mar...@semantic-mediawiki.org
    Classification: Unclassified


MediaWiki setups namespaces incorrectly. English (canonical) namespace names
are set as namespace aliases. This is wrong, because
MWNamespace::getCanonicalName( SMW_NS_PROPERTY ) returns "Свойство", not
expected "Property".

To setup namespaces correctly:

1. Create file "SMW_Namespaces.php" with content:

> $namespaceNames   = array();
> $namespaceAliases = array();
> 
> $namespaceNames[ 'en' ] = array(
>    SMW_NS_PROPERTY   => 'Property',
>    ...
> );
> $namespaceAliases[ 'en' ] = array(
>    ...
> );
> 
> $namespaceNames[ 'xx' ] = array(
>     SMW_NS_PROPERTY  => 'Localised name',
> );
> $namespaceAliases[ 'xx' ] = array(
>     ...
> );

2. Let MediaWiki know about namespace:

> $wgExtensionMessagesFiles[ 'SMW_Namespaces' ] = ".../SMW_Namespaces.php";

3. Canonical namespace names must be setup via hook:

> $wgHooks[ 'CanonicalNamespaces' ][] = 'SMW_onCanonicalNamespaceNames';

4. The hook body:

> function SMW_onCanonicalNamespaceNames( &$namespaces ) {
>     $namespaces += array(
>         SMW_NS_PROPERTY => 'Property',
>         ...
>     );
>     return true;
> } // function ocCanonicalNamespaceNames

In such a case everything works as expected -- users see localized namespace
names, while MWNamespace::getCanonicalName() returns English name.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to