Ordinal day of month in Portuguese

Hello. I’d like to start by saying that I’m new to Discourse and I’ve been pushing the translation of Discourse into European Portuguese and it’s coming along great. It is truly a great piece of software that is very enjoyable to use!

I’ve been having some issues finding a proper way of translating the way that the dates are shown in the Cakeday menu. Here is how they look right now:

The relevant part is the one that lists the birthdays between a time interval. It seems the dates are represented with an ordinal number (as in 1st of April, 2nd, 3rd, etc). In Portugal we not only don’t use ordinal numbers, but we also use simply <Day> <Month> instead of <Month> <Day><suffix>.

I’ve spent quite a bit of time looking for these date format strings under Personalize → Text Content but I’ve been unable to change the strings. Can someone guide me into the correct place to edit the format so it lists:

5 abril

Instead of:

abril 5º

Thank you.

3 Likes

Good catch!

That is a bug in the plugin, where it isn’t using localized formats in many places

Looks like the built-in localized formats in Moment.js aren’t that great either, so we should use our own localized formats.

I suggest changing:

@@ -4,10 +4,11 @@ export default Ember.Controller.extend({
   @computed
   title() {
     const date = moment();
+    const dateFormat = I18n.t("dates.long_no_year_no_time");
 
     return I18n.t("anniversaries.upcoming.title", {
-      start_date: date.add(2, "days").format("MMMM Do"),
-      end_date: date.add(7, "days").format("MMMM Do")
+      start_date: date.add(2, "days").format(dateFormat),
+      end_date: date.add(7, "days").format(dateFormat)
     });
   },

What do you think @tgxworld ?

5 Likes

Thank you for the help!

I have a similar complaint that occurs in one of the summary emails, would it be OK to add it to this topic or should I create a new one for it?

Another topic please.

1 Like

Good catch @Falco. I’ve fixed it in

https://github.com/discourse/discourse-cakeday/commit/c85b67944843200d2221830d31d3fa99bd34ef66

Thanks to @plipsqueek for reporting this as well.

3 Likes