getMainConfig()->get( MainConfigNames::GrammarForms ); if ( isset( $grammarForms['sl'][$case][$word] ) ) { return $grammarForms['sl'][$case][$word]; } switch ( $case ) { case 'mestnik': # locative $word = 'o ' . $word; break; case 'orodnik': # instrumental $word = 'z ' . $word; break; } # this will return the original value for 'imenovalnik' (nominativ) and # all undefined case values. return $word; } }