merged master
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderLanguageDataModule.php
index a36aaec..c916c4a 100644 (file)
@@ -29,7 +29,7 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
 
        protected $language;
        /**
-        * Get the grammer forms for the site content language.
+        * Get the grammar forms for the site content language.
         *
         * @return array
         */
@@ -37,6 +37,15 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
                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
@@ -61,17 +70,19 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
         * @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()