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

Translating date #192

Closed
Pafzedog opened this issue Jul 1, 2020 · 9 comments
Closed

Translating date #192

Pafzedog opened this issue Jul 1, 2020 · 9 comments

Comments

@Pafzedog
Copy link

Pafzedog commented Jul 1, 2020

Hi,

it would be nice if date (Created, published on, etc ...) could be translated too.

thanks

@eikek
Copy link
Owner

eikek commented Jul 1, 2020

Ah yes, you're right. I totally forgot about these dates.

@eikek eikek mentioned this issue Jul 1, 2020
@eikek
Copy link
Owner

eikek commented Jul 1, 2020

Hi @Pafzedog , so I just had some time to look into this. Fortunately one library in use, ryannhg/date-format, already had translations for French, which I took. But this only applies to the date components, like month name and weekday name. The date pattern is left as is, because (sadly) I don't know French…. So … could you maybe have a look at this? It is in Messages/DateFormat.elm, the format part. This defines how the date-time string looks like.

@Pafzedog
Copy link
Author

Pafzedog commented Jul 1, 2020

ok, for french language we have to put day name before month name, I think also that comma between month and year is not needed and replacing comma after day of week by a dot is more "in the rules" of the language for an abbreviation.

Something like this

{ format =
        [ DateFormat.dayOfWeekNameAbbreviated
        , DateFormat.text ". "
        , DateFormat.dayOfMonthSuffix
        , DateFormat.text " "
        , DateFormat.monthNameFull
        , DateFormat.text " "
        , DateFormat.yearNumber
        , DateFormat.text ", "
        , DateFormat.hourMilitaryNumber
        , DateFormat.text ":"
        , DateFormat.minuteFixed
        ]
    , lang = french
    }

@eikek
Copy link
Owner

eikek commented Jul 1, 2020

Thank you! It would look like this:
Selection_023

Does this look ok?

@Pafzedog
Copy link
Author

Pafzedog commented Jul 1, 2020

After a better look to french translation in this library, I think I don't agree with the author about dayOfMonthSuffix.
In french, only the first day of the month need the suffix "er", all the others are just left as it.
It seems that the dev add "e" as suffix for all the other days.
I opened an issue

@Pafzedog
Copy link
Author

Pafzedog commented Jul 1, 2020

Thank you! It would look like this:
Selection_023

Does this look ok?

It is far better than before but this "e" suffix look weird.
PS: sorry but we wrote at the same time ;)

@eikek
Copy link
Owner

eikek commented Jul 1, 2020

Ah ok, thanks! Good is, we can just change it in sharry.

So, if I understand correctly, it should read like this:

toFrenchOrdinalSuffix : Int -> String
toFrenchOrdinalSuffix n =
    if n == 1 then
        "er"

    else
        ""

?

Do you maybe want to do this change? (so I don't take credit that is not mine) But I can change this, of course, if you want.

@Pafzedog
Copy link
Author

Pafzedog commented Jul 1, 2020

It's perfect like that.
If you can make the change, I don't really care about fatherhood and, to tell you the truth, I think it would take me hours to get my git repository up and running again. XD

@eikek
Copy link
Owner

eikek commented Jul 1, 2020

Sure :-) Thank you a lot!

eikek added a commit that referenced this issue Jul 1, 2020
@eikek eikek closed this as completed Jul 2, 2020
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