podverse-web icon indicating copy to clipboard operation
podverse-web copied to clipboard

Translation: date and date time formats are not localized

Open xthiago opened this issue 3 years ago • 4 comments

Describe the bug Date and DateTime formats are not localized (at least for pt-BR).

To Reproduce Steps to reproduce the behavior:

  1. Go to a page where a date or date time is displayed in pt-BR.
  2. See the format.

Expected behavior Dates are expected to be displayed in format d/m/Y and date time in d/m/Y H:i.

*m Month can be displayed as number or as localized string.

Examples of valid formats for pt-BR:

  • date
    • 25/set/2020 - short format
    • 25/setembro/2020 -> regular format
    • 25 de setembro de 2020 -> expanded format
  • time
    • 20:01 (without seconds) - regular format
    • 20:01:22 - regular format
    • 20h01m22s - alternative format

We may have to check which format fits better on each app place :)

** I think we don't have to display seconds for

Screenshots

image

image

xthiago avatar Sep 12 '22 11:09 xthiago

I just remembered that my operating system is in English, and I'm using USA formats. 😅

Until tomorrow, I will check how the website is displayed on my wife's laptop. She uses Brazilian format.

xthiago avatar Sep 12 '22 12:09 xthiago

Bug confirmed.

I accessed podverse website from a Windows in Brazilian Portuguese – including number/date formats.

xthiago avatar Sep 13 '22 10:09 xthiago

@xthiago thanks for opening this. Would you be able to work on this? I believe we just need to add conditional format change when the lang is pt-br in this function: https://github.com/podverse/podverse-web/blob/develop/src/lib/utility/date.ts#L18

I can make the code change myself if you could confirm what the moment format needs to be.

mitchdowney avatar Sep 18 '22 03:09 mitchdowney

Would you be able to work on this?

Yes. I can work with this issue on the weekend. Then I'm able to test different formats to pick the one who fits perfectly in each page.

xthiago avatar Sep 21 '22 11:09 xthiago