-
Notifications
You must be signed in to change notification settings - Fork 255
Description
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.