• contactaidandelaney

    (@contactaidandelaneygmailcom)


    Hi, I have a dual language website. Rather than use a language plugin I just copied the site, put it on a subdomain and manually convert the language. I know this sounds like a lot of work, but I was having too many issues with getting menus to work with multilingual plugins. Also, the second language is Irish so I couldn’t find much for it.

    Anyway, I now have one major issue; I need to convert the months from English to Irish that WordPress automatically generates. I don’t know how to go about this at all. I don’t even know how or where WordPress generates dates.

    I’m thinking that I might be able to implement this by using something like str_ireplace but I have no idea where I could set variables to hold an array and where then to execute the code.

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    How dates are handled on the front end varies by theme. If your theme uses standard WP date functions, they mostly rely on date_i18n() to get locale specific date strings. That function in turn uses the WP_Locale class defined on wp_includes/locale.php. If you look at the source code there, you’ll see date strings simply come from the __() translation function.

    Thus if you have the proper translation files installed, the dates should already be displayed as is appropriate for the locale. For more on this see I18n for WordPress Developers.

    RossMitchell

    (@rossmitchell)

    On the other hand you should check if date displays get filtered. If they do, then this would be an ideal place to do your string replacements.

    https://adambrown.info/p/wp_hooks/hook

    I see one “date_rewrite_rules” also “date_i18n”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Convert months to different language’ is closed to new replies.