hivokas/correct-word-form

Package provides ability to get the correct word form depending on the number before this word.

1.0.0 2018-02-14 10:17 UTC

README

Package provides ability to get the correct word form depending on the number before this word.

GitHub starsGitHub forksGitHub issuesGitHub licensecontributions welcome

Installation

composer require hivokas/correct-word-form

Usage examples

Russian

for ($i = 0; $i < 5; $i++) {
  $amount = rand(-20, 200) / 2;
  echo $amount . ' ' . Hivokas\CorrectWordForm\CorrectWordForm::ru($amount, 'яблоко', 'яблока', 'яблок') . PHP_EOL;
}
23.5 яблока
-7.5 яблок
33 яблока
2 яблока
41.5 яблоко

English

for ($i = 0; $i < 5; $i++) {
  $amount = rand(-20, 200) / 2;
  echo $amount . ' ' . Hivokas\CorrectWordForm\CorrectWordForm::en($amount, 'apple', 'apples') . PHP_EOL;
}
67.5 apples
1 apple
54.5 apples
33.5 apples
25 apples

Supported languages

Language name Language native name ISO
Afrikaans Afrikaans af
Amharic አማርኛ am
Arabic العربية ar
Aymara aymar aru ay
Azerbaijani azərbaycan dili az
Belarusian беларуская мова be
Bulgarian български език bg
Bengali বাংলা bn
Bosnian bosanski jezik bs
Catalan català ca
Czech čeština cs
Danish dansk da
German Deutsch de
Dzongkha རྫོང་ཁ dz
Greek (modern) ελληνικά el
English English en
Spanish Español es
Estonian eesti et
Persian (Farsi) فارسی fa
Fula Fulfulde ff
Finnish suomi fi
Faroese føroyskt fo
French français fr
Irish Gaeilge ga
Hebrew (modern) עברית he
Hindi हिन्दी hi
Croatian hrvatski jezik hr
Hungarian magyar hu
Armenian Հայերեն hy
Indonesian Bahasa Indonesia id
Icelandic Íslenska is
Italian Italiano it
Japanese 日本語 (にほんご) ja
Georgian ქართული ka
Kazakh қазақ тілі kk
Kalaallisut kalaallisut kl
Khmer ខ្មែរ km
Korean 한국어 ko
Kurdish Kurdî ku
Kyrgyz Кыргызча ky
Luxembourgish Lëtzebuergesch lb
Lingala Lingála ln
Lao ພາສາລາວ lo
Lithuanian lietuvių kalba lt
Latvian latviešu valoda lv
Malagasy fiteny malagasy mg
Māori te reo Māori mi
Macedonian македонски јазик mk
Mongolian Монгол хэл mn
Malay bahasa Melayu ms
Maltese Malti mt
Burmese ဗမာစာ my
Norwegian Bokmål Norsk bokmål nb
Nepali नेपाली ne
Dutch Nederlands nl
Norwegian Nynorsk Norsk nynorsk nn
Norwegian Norsk no
(Eastern) Punjabi ਪੰਜਾਬੀ pa
Polish język polski pl
Pashto پښتو ps
Portuguese Português pt
Romanian Română ro
Russian Русский ru
Kinyarwanda Ikinyarwanda rw
Sinhalese සිංහල si
Slovak slovenčina sk
Slovene slovenski jezik sl
Somali Soomaaliga so
Albanian Shqip sq
Serbian српски језик sr
Swedish svenska sv
Swahili Kiswahili sw
Tamil தமிழ் ta
Tajik тоҷикӣ tg
Thai ไทย th
Tigrinya ትግርኛ ti
Turkmen Türkmen tk
Turkish Türkçe tr
Ukrainian Українська uk
Urdu اردو ur
Uzbek Oʻzbek uz
Vietnamese Tiếng Việt vi
Chinese 中文 (Zhōngwén) zh