Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to use date_i18n() to display a localised date in my theme.

<?php echo date_i18n( 'F j, Y',  strtotime( get_the_time( "Y-m-d" ) ) ); ?>

However, this always returns the English version of the month, rather than the French version. I'm using wordpress as a network. My primary site has the default WPLANG (so english), and I'm setting the second site to french by setting the WPLANG to fr_FR in site-settings.

Other translations on the page are working fine, so wordpress is aware that the language is different.

I downloaded the necessary .mo and .po files for French, but it doesn't have months in there, so I assume there's somewhere else these are set/used.

Any help would be appreciated as I've been stumped by this for hours.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

date_i18n() gets month from WP_Locale->get_month(). Which in turn fills months using baseline translation function __(), nothing fancy.

Bottom line is — months should be translated in po/mo files, you just got incomplete translation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.