Opened 10 years ago

Closed 10 years ago

#2801 closed defect (fixed)

"Saved at" column displays the text "long" for non-English

Reported by: Hans Nordhaug Owned by: Tom Hughes
Priority: minor Milestone:
Component: website Version:
Keywords: Cc:


If your browser has for example Norwegian as preferred language, the "Saved at" column in the "History" tab displays the text "long" instead of the actual date.

Change History (7)

comment:1 Changed 10 years ago by Tom Hughes

Resolution: invalid
Status: newclosed

Then go to Translatewiki and add/change the relevant translation. We don't make changes to non-English translations directly, they all have to come via Translatewiki.

comment:2 Changed 10 years ago by Hans Nordhaug

Resolution: invalid
Status: closedreopened

The text "long" doesn't come from the translation. It's a bug when converting the date from English to non-English - for example Norwegian. ("long" might indicate that the website framework considers the results of the conversion a long variable instead of a date.)

comment:3 Changed 10 years ago by Tom Hughes

It does come from a translation, but it's a rails translation not an OSM translation. The rails translations are here:

The specific problem will be the lack of a time.formats.long translation.

In fact I suspect the real problem is that the rails translations are using no-NB so aren't getting picked up and merged into the no translations that we use - nor would they get merged into the nb translations you are proposing.

I can arrange to alias things together but we need some sort of agreement on which codes exactly are equivalent... I assume that:

nb == no-NB nn == no-NN

But should no also be aliased to nb for backwards compatibility? I don't really know what the history of all this is to be able to make a judgement.

comment:4 Changed 10 years ago by Tom Hughes

comment:5 Changed 10 years ago by Hans Nordhaug

OK, thanks for the explanation. This makes me think Rails has messed up big time - a missing translation should always give the source text (the English string) so it is at least understandable. In addition Rails have manage to create their own language codes. Amazing.

Yes, "no" should be aliased to "nb". (nb == no-NB and nn == no-NN is also correct.)

PS! I looked at and it seems time.formats.long is translated in that file. Could you apply it to the OSM website?

comment:6 Changed 10 years ago by Tom Hughes

Rails does generally fall back to english, but there's a specific issue about the way it handles time formats that makes that fail.

What it does is look up time.formats (which returns an array of formats) and if it doesn't find that then it looks up time.formats in English. Then it looks up the format it wants in that array. The result is that if the array exists in your language, but doesn't have the specific format requested, then it fails to fall back.

I'll look at patching things up later on.

comment:7 Changed 10 years ago by Tom Hughes

Resolution: fixed
Status: reopenedclosed

This should be fixed now. I've renamed the rails translations (as you say, the codes upstream are using are nonsense) and arranged to alias no and nb together.

Note: See TracTickets for help on using tickets.