WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to improve the localization of the Bones theme. On the admin side it provides an RSS widget which uses the following code:

   echo $item->get_date('j F Y @ g:i a');

This uses SimplePie, here's the doc for the method. Which would be the best way to make this translatable?

share|improve this question

What do you think about this one?

    echo mysql2date(__('j F Y @ g:i a', 'bonestheme'), $item->get_date('Y-m-d H:i:s')); 
share|improve this answer

Best way would probably be to use the built in Internationalization function in WordPress. This will then translate according to the language pack being used.

The "U" character to a date() call gives the unix timestamp, which is just what you need in this case, for passing to date_i18n().

For example: echo date_i18n('j F Y @ g:i a', $item->get_date('U'));

The months and such will be translated accordingly. If you want to add the __() wrapper around the date format string, that will work just as well.

share|improve this answer

Your Answer


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.