38 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
40 if ( !isset( $grammarForms[
'sh'] ) ) {
44 if ( isset( $grammarForms[
'sh'][$case][$word] ) ) {
45 return $grammarForms[
'sh'][$case][$word];
48 # if the word is not supported (i.e. there's no entry for any case),
49 # use a descriptive declension for it
50 $isWordSupported =
false;
51 foreach ( $grammarForms[
'sh'] as $caseForms ) {
52 if ( isset( $caseForms[$word] ) ) {
53 $isWordSupported =
true;
58 # descriptive declension for unknown projects
59 if ( !$isWordSupported && isset( $grammarForms[
'sh'][$case][
'projekt'] ) ) {
60 return $grammarForms[
'sh'][$case][
'projekt'] .
' ' . $word;
63 # this will return the original value for 'nominativ' (nominative)
Serbo-Croatian (srpskohrvatski / српскохрватски)
convertGrammar( $word, $case)
Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ.
A class containing constants representing the names of configuration variables.