Advertisement
shmaltorhbooks

Untitled

Jun 15th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2.  
  3. define('Nominative', 0);
  4. define('Genitive', 1);
  5. define('Dativ', 2);
  6. define('Accusative', 3);
  7. define('Instrumentativ', 4);
  8. define('Prepozitiv', 5);
  9.  
  10. $_declentions = array(
  11.     'Семейные споры' => array(
  12.         Nominative => 'Семейные споры',
  13.         Genitive => 'Семейных спор',
  14.         Dativ => 'Семейным спорам',
  15.         Accusative => 'Семейных спор',
  16.         Instrumentativ => 'Семейными спорами',
  17.         Prepozitiv => 'Семейных спорах',
  18.     ),
  19.     'Недвижимость' => array(
  20.         Nominative => 'Недвижимость',
  21.         Genitive => 'Недвижимости',
  22.         Dativ => 'Недвижимости',
  23.         Accusative => 'Недвижимость',
  24.         Instrumentativ => 'Недвижимостью',
  25.         Prepozitiv => 'Недвижимости',
  26.     )
  27. );
  28.  
  29. function __($word, $declention = Nominative){
  30.     global $_declentions;
  31.     if (!isset($_declentions[$word][$declention])) {
  32.         return $word;
  33.     } else {
  34.         return $_declentions[$word][$declention];
  35.     }
  36. }
  37.  
  38. ?>
  39. пиздеж о <?= __('Недвижимость', Dativ) ?>
  40. всякая чушь о <?= __('Семейные споры', Prepozitiv) ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement