Make <visualeditor-preference-enable> message respect plural rules

Change-Id: I4660a530cd50a179c06a82295b6a24cae1b741b6
This commit is contained in:
James D. Forrester 2014-09-16 10:35:57 -07:00
parent 078f30f781
commit 92a6fdbb02
3 changed files with 9 additions and 5 deletions

View file

@ -255,16 +255,20 @@ class VisualEditorHooks {
public static function onGetPreferences( User $user, array &$preferences ) {
global $wgLang;
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'visualeditor' );
if ( !array_key_exists( 'visualeditor-enable', $preferences ) ) {
$namespaces = ConfigFactory::getDefaultInstance()
->makeConfig( 'visualeditor' )
->get( 'VisualEditorNamespaces' );
$preferences['visualeditor-enable'] = array(
'type' => 'toggle',
'label-message' => array(
'visualeditor-preference-enable',
$wgLang->commaList( array_map(
array( 'self', 'convertNs' ),
$config->get( 'VisualEditorNamespaces' )
) )
$namespaces
) ),
count( $namespaces )
),
'section' => 'editing/editor'
);

View file

@ -209,7 +209,7 @@
"visualeditor-preference-core-discussion-link": "\/\/mediawiki.org\/wiki\/Special:MyLanguage\/Talk:VisualEditor\/Beta_Features\/General",
"visualeditor-preference-core-info-link": "\/\/mediawiki.org\/wiki\/Special:MyLanguage\/VisualEditor\/Beta_Features\/General",
"visualeditor-preference-core-label": "VisualEditor",
"visualeditor-preference-enable": "Enable VisualEditor. It will be available in the following namespaces: $1",
"visualeditor-preference-enable": "Enable VisualEditor. It will be available in the following {{PLURAL:$2|namespace|namespaces}}: $1",
"visualeditor-preference-language-description": "Add an experimental tool to VisualEditor for marking the language in which text is written for testing, ahead of general release. Please remember to always review your changes before saving when using experimental features.",
"visualeditor-preference-language-discussion-link": "\/\/mediawiki.org\/wiki\/Special:MyLanguage\/Talk:VisualEditor\/Beta_Features\/Language",
"visualeditor-preference-language-info-link": "\/\/mediawiki.org\/wiki\/Special:MyLanguage\/VisualEditor\/Beta_Features\/Language",

View file

@ -218,7 +218,7 @@
"visualeditor-preference-core-discussion-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can discuss this Beta Feature. Defaults to a page on MediaWiki.org.}}",
"visualeditor-preference-core-info-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can learn about this Beta Feature. Defaults to a page on MediaWiki.org.}}",
"visualeditor-preference-core-label": "Used in [[Special:Preferences]].\n\nUsed as label for checkbox to enable VisualEditor.\n\nThe description for this checkbox is:\n* {{msg-mw|Visualeditor-preference-core-description}}\n{{Identical|VisualEditor}}",
"visualeditor-preference-enable": "Label for the user preference to enable VisualEditor while it is in alpha (opt-in) mode.\nLinks are in {{msg-mw|Visualeditor-mainnamespacepagelink}} and {{msg-mw|visualeditor-usernamespacepagelink}}.\n\nParameters:\n* $1 - Comma separated list of namespace names.\n\nSee also:\n* {{msg-mw|Visualeditor-preference-core-description}}",
"visualeditor-preference-enable": "Label for the user preference to enable VisualEditor while it is in alpha (opt-in) mode.\nLinks are in {{msg-mw|Visualeditor-mainnamespacepagelink}} and {{msg-mw|visualeditor-usernamespacepagelink}}.\n\nParameters:\n* $1 - Comma separated list of namespace names.\n* $2 - Number of namespaces in which it will be used.\n\nSee also:\n* {{msg-mw|Visualeditor-preference-core-description}}",
"visualeditor-preference-language-description": "Used in [[Special:Preferences]].\n\nUsed as description for the checkbox to enable language tools in VisualEditor.\n\nThe label for this checkbox is {{msg-mw|Visualeditor-preference-language-label}}.",
"visualeditor-preference-language-discussion-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can discuss this Beta Feature. Defaults to a page on MediaWiki.org.}}",
"visualeditor-preference-language-info-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can learn about this Beta Feature. Defaults to a page on MediaWiki.org.}}",