Tricky Translation System #113
taufik-nurrohman
started this conversation in
Ideas
Replies: 2 comments
-
Case 2: Plural, Singular, and Zero Termif (0 === $count) {
echo i('No Comments');
} else if (1 === $count) {
echo i('%d Comment', [$count]);
} else {
echo i('%d Comments', [$count]);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Case 3: Possesion Rules in EnglishAssumes if (str_ends_with($name, 's')) {
echo i("%s' Home Page", [$name]);
} else {
echo i("%s's Home Page", [$name]);
}Then you can translate the string to another language this way: $GLOBALS['I']["%s' Home Page"] = 'Beranda Milik %s';
$GLOBALS['I']["%s's Home Page"] = 'Beranda Milik %s'; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Case 1: Plural and Singular Term
Assumes we have
$countvariable that holds a number:Then to translate the string to another language:
Beta Was this translation helpful? Give feedback.
All reactions