Skip to content
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

Incorrect localization for some languages #277

Open
frop-qart opened this issue Aug 8, 2024 · 1 comment
Open

Incorrect localization for some languages #277

frop-qart opened this issue Aug 8, 2024 · 1 comment

Comments

@frop-qart
Copy link

Prettytime will not localize “day” correctly if the default language is italian and prettytime's locale is set to english. The problem seems to be that when setting locale to english, the future singular/plural name and past singular/plural name for day (giorno/giorni) are not set to “”, so that when a timestamp gets formatted later, the singular and plural name that gets returned is “giorno”/”giorni” instead of “day”/”days”.

Moreover, I think this localization for italian may be incorrect. The future and past form for “day” doesn’t change at all which suggests italian may not have such forms. Additionally, I can see this being a problem for any time the default language has a future/past form for some time unit and the locale prettytime is set to doesn’t. I think modifying the catch blocks in setLocale so that the names are set to "" when an exception is thrown would fix the problem.

@emanuele6
Copy link

emanuele6 commented Aug 8, 2024

Note that this may be a second-hand report from TeamNewPipe/NewPipe#11148, and @frop-qart may not have experienced this issue.

I experience this issue pretty often (but not all the times) when using NewPipe with "English" selected as "App Language" in NewPipe settings, and "Italian" as only system language: I see "1 giorno ago"/"2 giorni ago" instead of "1 day ago"/"2 days ago".

I have no evidence (yet) that issue only happens with Italian as system language;
I have no idea how the App Language override of NewPipe is implemented;
I have no evidence that this issue happens because of prettytime, and not NewPipe (the "App Language" override of NewPipe seems to be a bit flaky, it is not uncommon to see it use the system language instead of the app language for the entire UI when reopening the app after it has been inactive for a while);
The Italian localisation for "1 day ago"/"2 days ago" is not wrong as claimed, NewPipe will show "1 giorno fa"/"2 giorni fa" if the selected "App Language" is "Italian";
The Italian localisation is not supposed to be used at all in this instance because the App Language is "English", so that is the only language that matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants