2004-02-18 02:15:00 +00:00
|
|
|
|
<?php
|
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
|
|
|
|
|
2005-04-05 11:00:27 +00:00
|
|
|
|
/**
|
2006-06-16 18:47:15 +00:00
|
|
|
|
* Hebrew (עברית)
|
|
|
|
|
|
*
|
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-16 18:47:15 +00:00
|
|
|
|
*
|
2006-08-13 21:03:56 +00:00
|
|
|
|
* @author Rotem Liss
|
2006-06-16 18:47:15 +00:00
|
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
|
class LanguageHe extends Language {
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-05-26 18:26:51 +00:00
|
|
|
|
/**
|
2006-06-25 10:37:45 +00:00
|
|
|
|
* Convert grammar forms of words.
|
2006-06-16 18:47:15 +00:00
|
|
|
|
*
|
2006-06-25 10:37:45 +00:00
|
|
|
|
* Available cases:
|
|
|
|
|
|
* "prefixed" (or "תחילית") - when the word has a prefix
|
2006-05-26 18:26:51 +00:00
|
|
|
|
*
|
2010-06-05 19:15:50 +00:00
|
|
|
|
* @param $word String: the word to convert
|
|
|
|
|
|
* @param $case String: the case
|
2011-05-29 15:03:33 +00:00
|
|
|
|
*
|
|
|
|
|
|
* @return string
|
2006-06-25 10:37:45 +00:00
|
|
|
|
*/
|
2006-07-07 13:12:51 +00:00
|
|
|
|
public function convertGrammar( $word, $case ) {
|
2006-06-25 10:37:45 +00:00
|
|
|
|
global $wgGrammarForms;
|
2010-07-29 09:43:18 +00:00
|
|
|
|
if ( isset( $wgGrammarForms['he'][$case][$word] ) ) {
|
2006-06-25 10:37:45 +00:00
|
|
|
|
return $wgGrammarForms['he'][$case][$word];
|
|
|
|
|
|
}
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-06-25 10:37:45 +00:00
|
|
|
|
switch ( $case ) {
|
|
|
|
|
|
case 'prefixed':
|
|
|
|
|
|
case 'תחילית':
|
|
|
|
|
|
# Duplicate the "Waw" if prefixed
|
|
|
|
|
|
if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
|
$word = "ו" . $word;
|
2006-06-25 10:37:45 +00:00
|
|
|
|
}
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-06-25 10:37:45 +00:00
|
|
|
|
# Remove the "He" if prefixed
|
|
|
|
|
|
if ( substr( $word, 0, 2 ) == "ה" ) {
|
|
|
|
|
|
$word = substr( $word, 2 );
|
|
|
|
|
|
}
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-06-25 10:37:45 +00:00
|
|
|
|
# Add a hyphen if non-Hebrew letters
|
|
|
|
|
|
if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
|
$word = "־" . $word;
|
2006-06-25 10:37:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-06-25 10:37:45 +00:00
|
|
|
|
return $word;
|
|
|
|
|
|
}
|
2010-06-05 19:15:50 +00:00
|
|
|
|
|
2006-06-25 10:37:45 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Gets a number and uses the suited form of the word.
|
2006-05-26 18:26:51 +00:00
|
|
|
|
*
|
2010-06-05 19:15:50 +00:00
|
|
|
|
* @param $count Integer: the number of items
|
|
|
|
|
|
* @param $forms Array with 3 items: the three plural forms
|
|
|
|
|
|
* @return String: the suited form of word
|
2006-05-26 18:26:51 +00:00
|
|
|
|
*/
|
2007-11-18 20:15:49 +00:00
|
|
|
|
function convertPlural( $count, $forms ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
|
if ( !count( $forms ) ) { return ''; }
|
2007-11-18 20:15:49 +00:00
|
|
|
|
$forms = $this->preConvertPlural( $forms, 3 );
|
|
|
|
|
|
|
2006-05-26 18:26:51 +00:00
|
|
|
|
if ( $count == '1' ) {
|
2007-11-18 20:15:49 +00:00
|
|
|
|
return $forms[0];
|
2010-07-29 09:43:18 +00:00
|
|
|
|
} elseif ( $count == '2' && isset( $forms[2] ) ) {
|
2007-11-18 20:15:49 +00:00
|
|
|
|
return $forms[2];
|
2006-05-26 18:26:51 +00:00
|
|
|
|
} else {
|
2007-11-18 20:15:49 +00:00
|
|
|
|
return $forms[1];
|
2006-05-26 18:26:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2003-07-08 20:17:36 +00:00
|
|
|
|
}
|