protected $language;
/**
- * Get the grammer forms for the site content language.
+ * Get the grammar forms for the site content language.
*
* @return array
*/
return $this->language->getGrammarForms();
}
+ /**
+ * Get the plural forms for the site content language.
+ *
+ * @return array
+ */
+ protected function getPluralRules() {
+ return $this->language->getPluralRules();
+ }
+
/**
* Get the digit transform table for the content language
* Seperator transform table also required here to convert
* @return array
*/
protected function getData() {
- return array( 'grammarForms' => $this->getSiteLangGrammarForms(),
- 'digitTransformTable' => $this->getDigitTransformTable()
- );
+ return array(
+ 'digitTransformTable' => $this->getDigitTransformTable(),
+ 'grammarForms' => $this->getSiteLangGrammarForms(),
+ 'pluralRules' => $this->getPluralRules(),
+ );
}
/**
* @param $context ResourceLoaderContext
- * @return string: Javascript code
+ * @return string: JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
- $this->language = Language::factory( $context ->getLanguage() );
+ $this->language = Language::factory( $context->getLanguage() );
return Xml::encodeJsCall( 'mw.language.setData', array(
$this->language->getCode(),
$this->getData()