Code to test plural forms in Samogitian language. Needed for translation.
.gitignore | ||
LICENSE | ||
plural.c | ||
README.md | ||
result.txt |
Samogitian language (ISO-639-3: sgs) plural forms
Written by Arns Udovič in 2021 a@arns.lt
Refs: https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms
Main
nplurals=4;
plural=(n % 10 == 1 && n % 100 != 11) ? 0
: ((n % 10 == 2 && n % 100 != 12) ? 1
: ((n % 10 >= 3 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? 2
: 3));
Logics
- 0 - singular or ending in 1 with exception for 11. Ex., 1 laps
- 1 - dual. Ex. 2 lapo
- 2 - other plural. Ex. 25 lapā
- 3 - plural for 11-19, 10, 20, 100... Ex. 12 lapu
Build and run
Code should be compilled:
$ gcc -o plural plural.c
Then it can be run to see testing results.
$ ./plural
Result
See result.txt