<?php
+/**
+ * Slovak (Slovenčina) specific code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Language
+ */
+
/**
* Slovak (Slovenčina)
*
- * @package MediaWiki
- * @subpackage Language
+ * @ingroup Language
*/
class LanguageSk extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
+
/**
- * Cases: genitív, datív, akuzatív, lokál, inštrumentál
+ * @param $count int
+ * @param $forms array
+ * @return string
*/
- function convertGrammar( $word, $case ) {
- global $wgGrammarForms;
- if ( isset($wgGrammarForms['sk'][$case][$word]) ) {
- return $wgGrammarForms['sk'][$case][$word];
+ function convertPlural( $count, $forms ) {
+ if ( !count( $forms ) ) {
+ return '';
}
+ $forms = $this->preConvertPlural( $forms, 3 );
- switch ( $case ) {
- case 'genitív':
- if ( $word == 'Wikipédia' ) {
- $word = 'Wikipédie';
- } elseif ( $word == 'Wikislovník' ) {
- $word = 'Wikislovníku';
- } elseif ( $word == 'Wikicitáty' ) {
- $word = 'Wikicitátov';
- } elseif ( $word == 'Wikiknihy' ) {
- $word = 'Wikikníh';
- }
- break;
- case 'datív':
- if ( $word == 'Wikipédia' ) {
- $word = 'Wikipédii';
- } elseif ( $word == 'Wikislovník' ) {
- $word = 'Wikislovníku';
- } elseif ( $word == 'Wikicitáty' ) {
- $word = 'Wikicitátom';
- } elseif ( $word == 'Wikiknihy' ) {
- $word = 'Wikiknihám';
- }
- break;
- case 'akuzatív':
- if ( $word == 'Wikipédia' ) {
- $word = 'Wikipédiu';
- } elseif ( $word == 'Wikislovník' ) {
- $word = 'Wikislovník';
- } elseif ( $word == 'Wikicitáty' ) {
- $word = 'Wikicitáty';
- } elseif ( $word == 'Wikiknihy' ) {
- $word = 'Wikiknihy';
- }
- break;
- case 'lokál':
- if ( $word == 'Wikipédia' ) {
- $word = 'Wikipédii';
- } elseif ( $word == 'Wikislovník' ) {
- $word = 'Wikislovníku';
- } elseif ( $word == 'Wikicitáty' ) {
- $word = 'Wikicitátoch';
- } elseif ( $word == 'Wikiknihy' ) {
- $word = 'Wikiknihách';
- }
- break;
- case 'inštrumentál':
- if ( $word == 'Wikipédia' ) {
- $word = 'Wikipédiou';
- } elseif ( $word == 'Wikislovník' ) {
- $word = 'Wikislovníkom';
- } elseif ( $word == 'Wikicitáty' ) {
- $word = 'Wikicitátmi';
- } elseif ( $word == 'Wikiknihy' ) {
- $word = 'Wikiknihami';
- }
- break;
- }
- return $word;
- }
-
- function convertPlural( $count, $w1, $w2, $w3) {
- $count = str_replace ('.', '', $count);
- $forms = array( $w1, $w2, $w3);
if ( $count == 1 ) {
$index = 0;
} elseif ( $count == 2 || $count == 3 || $count == 4 ) {
}
return $forms[$index];
}
-
}
-?>