-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pl translation #1027
Fix pl translation #1027
Conversation
lang_hours={0,plural,one {godzinę},two {# godziny},other {# godzin}} temu | ||
lang_minutes={0,plural,one {minutę},two {# minuty},other {# minut}} temu | ||
lang_seconds={0,plural,one {sekundę},two {# sekundy},other {# sekund}} temu | ||
lang_hours=przed {0,plural,one {godziną},other {# godzinami}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is done to fix the incorrect “4 godzin temu”. Would you more expressive language files with CLDR rules support ({0,plural,one {godzinę},many {# godziny},other {# godzin}} temu
) be better or does this “przed 2 godzinami” sound good enough? It is something I want to do anyway, the current system is terrible, but I can prioritize it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, selfoss 2.18 with pl language gives error TypeError: pluralValue is undefined
or Uncaught TypeError: Cannot read property 'replace' of undefined
; there is no two
case.
And yes, it fixes incorrect "3 godzin", "4 godzin", "23 minut", "24 minut", "33 sekund", …
Would you more expressive language files with CLDR rules support ({0,plural,one {godzinę},many {# godziny},other {# godzin}} temu) be better or does this “przed 2 godzinami” sound good enough?
Yes, indeed. This case is not worth the effort, "przed 2 godzinami" probably sounds as good as "před 2 hodinami". :)
There is example how correct sentence with … temu
should look:
function format(num, unit) {
let n1 = num % 10;
let n2 = num % 100;
let dictionary = {
"sekundy": ["sekundę", "sekundy", "sekund"],
"minuty": ["minutę", "minuty", "minut"],
"godziny": ["godzinę", "godziny", "godzin"]
};
unit = dictionary[unit];
if (n2 > 4 && n2 < 22) {
return `${num} ${unit[2]} temu`;
}
if (n1 > 1 && n1 <= 4) {
return `${num} ${unit[1]} temu'`;
}
if (num == 1) {
return `${unit[0]} temu`; // number omitted intentionally
}
return `${num} ${unit[2]} temu`;
}
for (let i = 0; i <= 60; i++) {
console.log(format(i, "sekundy"));
console.log(format(i, "minuty"));
console.log(format(i, "godziny"), "\n");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, we already have a client side implementation of pluralization rules, I agree that the effort is too high. I will add the CLDR support once we move everything to the client side.
Thanks. |
Hi @skotniczny. Previously, it was not clear if selfoss was licensed under GPL 3 only, or also any later version. Could you clarify whether you are fine with licensing your contributions under Thanks again and sorry for the confusion. |
I'm fine with that. |
pl.ini breaks selfoss 2.18.
This pull request solves it. Translation also follows polish grammar rules, which was impossible before.