How to have a Non-English namespace in mediawiki?

Viewed 27

I created a custom namespace in my mediawiki as below following this doc: https://www.mediawiki.org/wiki/Manual_talk:Using_custom_namespaces

I created a namespace as bellow:

define("NS_CAFE", 3000); // This MUST be even.
define("NS_CAFE_TALK", 3001); // This MUST be the following odd integer.
$wgExtraNamespaces[NS_CAFE] = "کافه";
$wgExtraNamespaces[NS_CAFE_TALK] = "کافه_بحث"; // Note underscores in the namespace name.
$wgNamespaceProtection[NS_CAFE] = array( 'editfoo' ); // permission "editfoo" required to edit the foo namespace
$wgNamespacesWithSubpages[NS_CAFE] = true;            // subpages enabled for the foo namespace
$wgGroupPermissions['sysop']['editfoo'] = true;      // permission "editfoo" granted to users in the "sysop" group
$wgContentNamespaces[] = NS_CAFE;

AS NS_CAFE is in our language then what values should be for $wgNamespaceProtection[NS_CAFE] and for second array element of $wgGroupPermissions['sysop'] ?

1 Answers

Permission names are seldom seen by users (except on Special:ListGroupRights). They face the consequences of being granted or denied certain rights. Therefore, there is no point in choosing non-Latin names for user rights, and your editfoo is all right.

However, you need to create two MediaWiki messages in your wiki:

  • MediaWiki:right-editfoo, which will be seen on Special:ListGroupRights and
  • MediaWiki:action-editfoo, which will be used in a sentence like "You do not have permission to (editfoo)".

It makes sense to create those messages in your wiki language, e.g. ویرایش کافه. If you expect some users to change their user interface language to some other language, you may want to define versions of those messages in that language, too: e.g., MediaWiki:right-editfoo/en and MediaWiki:right-editfoo/en.

Related