Code to test plural forms in Samogitian language. Needed for translation.
Find a file
2024-08-23 12:26:09 +00:00
.gitignore working with test 2021-06-08 19:23:06 +03:00
LICENSE Initial commit 2021-06-08 14:23:33 +00:00
plural.c J.Pabrieža noted: dual only on 2 2024-06-21 13:33:49 +03:00
README.md Update README.md 2024-08-23 12:26:09 +00:00
result.txt J.Pabrieža noted: dual only on 2 2024-06-21 13:33:49 +03:00

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