You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: