• When displaying my calendar in French names of months and weekdays show up in English, except in the mini calendar where abbreviated weekday names are correctly translated. I tried to add a french mo file in wp-content/languages, but the result is the same. I also briefly looked in the WP plugin translation and searched for untranslated months in French, but didn’t find any. Please help – au secours! (And thanks for a really great plugin!!)

    https://wordpress.org/plugins/my-calendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    The months and weekdays translations should, for the most part, come from the core WordPress French translation. They aren’t sourced from the My Calendar text. See https://developer.wordpress.org/reference/functions/date_i18n/

    Thread Starter christer_f

    (@christer_f)

    Thanks for your quick reply Joe!
    I found the place in my-calendar-output.php where you generate the month and weekday names, and I noticed that for the abbreviated names, used in the ‘mini’ view, you call __ to translate with the my-calendar text domain – and as I said in my first post, this works fine. For the longer names you use date_i18n, which does not specify a text domain. This means that it will use the WordPress-level mo-files, and these do not include abbreviated names like “Mon” or “Tue”. Just to check I added these to the WordPress-level French po file and compiled it, and now the names displayed nicely. Having said that, I don’t think it’s a good idea to rely on such translation strings being in the standard WordPress mo-files (just think about “sun”, which can have different translations depending on the context). Wouldn’t it be better to have the names of months and weekdays in their different forms in language files local to the plugin?
    Cheers,
    — christer

    Plugin Author Joe Dolson

    (@joedolson)

    Yes, that’s correct. If you want abbreviated names, you’ll need to provide them in an alternate way.

    If I could count on having the names of months and weekdays in the translations, that would be a great solution; however, in my past experience, that actually meant that I could only provide translations for those in a tiny fraction of languages.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translation of months and weekdays’ is closed to new replies.