There is no way we could translate js.badges.granted_on correctly!

AI-generated summary

The discussion revolves around the challenge of translating the js.badges.granted_on key, particularly in languages other than English. iamntz explains that the key’s dynamic nature, which can result in phrases like “Granted 7 days ago” or “Granted 7th april”, poses a problem in translation. For instance, in Romanian, “Granted 7th april” becomes “Acordat acum 7 aprilie”, which translates back to English as “granted 7th april ago”, sounding unnatural.

The issue is not limited to badges, as iamntz also points out a similar problem with the “User profile → Seen XXX” feature, where the translation fails for longer time periods, such as months. A possible solution could involve using a syntax similar to the one proposed in Message format support for localization.

I’m trying to translate js.badges.granted_on key, but there is a big issue.

In english, the text looks like this:

granted_on: "Granted %{date}"

Which can later on can become Granted 7 days ago or Granted 7th april or whatever. This makes sense.

However, in other languages - romanian in my case - thing doesn’t look that peachy, because we can’t get it right in any cases.

  • Granted 7 days ago becomes Acordat acum 19 z, which is great,
  • Granted 7th april becomes Acordat acum 7 aprilie, which can be roughly be translated back in english to granted 7th april ago. Which clearly isn’t that great, because sounds… uhm… dumb :smiley:

I dug a bit in the code and although there is a medium_with_ago key, that doesn’t seems to be used in the badges mechanism.

So, it’s a bug or is something that i miss?

5 Likes

Bumping this a bit just to mention that the very same issue is present on User profile -> Seen XXX, where XXX looks nice on small time period (up to weeks), but fails badly on months.

E.g.:

  • Văzut acum 5 zile is ok (seen 5 days ago)
  • văzut acum 2 săptămâni is ok (seen 2 weeks ag)
  • văzut acum 31 mai is not ok (seen 31 may)

I think this can be solved using a syntax similar to this: Message Format support for localization.

please reopen if still an issue