2004-08-09 09:46:33 +00:00
|
|
|
<?php
|
2012-06-07 11:06:19 +00:00
|
|
|
/**
|
|
|
|
|
* Lithuanian (Lietuvių) 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
|
|
|
|
|
*/
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
|
2012-06-07 11:06:19 +00:00
|
|
|
/**
|
|
|
|
|
* Lithuanian (Lietuvių)
|
2006-06-21 18:09:39 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Language
|
2006-06-21 18:09:39 +00:00
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageLt extends Language {
|
2006-05-12 15:06:22 +00:00
|
|
|
/* Word forms (with examples):
|
2006-10-20 17:36:00 +00:00
|
|
|
1 - vienas (1) lapas, dvidešimt vienas (21) lapas
|
2006-05-12 15:12:17 +00:00
|
|
|
2 - trys (3) lapai
|
|
|
|
|
3 - penkiolika (15) lapų
|
2006-12-16 22:31:08 +00:00
|
|
|
*/
|
2011-05-29 15:20:43 +00:00
|
|
|
|
|
|
|
|
/**
|
2012-01-09 12:46:53 +00:00
|
|
|
* Lithuanian plural forms as per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#lt
|
2011-05-29 15:20:43 +00:00
|
|
|
* @param $count int
|
|
|
|
|
* @param $forms array
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2007-11-18 20:15:49 +00:00
|
|
|
function convertPlural( $count, $forms ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( !count( $forms ) ) { return ''; }
|
2012-01-16 10:05:48 +00:00
|
|
|
|
|
|
|
|
// if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
|
|
|
|
|
if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
|
|
|
|
|
|
2007-11-18 20:15:49 +00:00
|
|
|
$forms = $this->preConvertPlural( $forms, 3 );
|
2012-01-09 12:46:53 +00:00
|
|
|
// Form[0] if n mod 10 is 1 and n mod 100 not in 11..19;
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0];
|
2012-01-09 12:46:53 +00:00
|
|
|
// Forms[1] if n mod 10 in 2..9 and n mod 100 not in 11..19;
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( $count % 10 >= 2 && ( $count % 100 < 10 || $count % 100 >= 20 ) ) return $forms[1];
|
2007-11-18 20:15:49 +00:00
|
|
|
return $forms[2];
|
2006-05-12 15:06:22 +00:00
|
|
|
}
|
2004-08-09 09:46:33 +00:00
|
|
|
}
|