0

I've translated my theme successfully. Yet, there are some part that I couldn't find out how to translate them.

I've done a tutorial to Translate or convert WordPress date/time/comment number into my local language successfully. (see the blue arrow in screenshot below)

translate date and time
click to enlarge

I have some parts that need to also convert/translate such as:

  • The numbers (year) of archive widget; is it possible to convert/translate it into my local language?
  • The word (on) in comment widget as well as in comment form; how could I translate it?
  • The part that I rounded with red circle; how could I translate them?
0

For archives you can use the get_archives_link filter like this:

add_filter('get_archives_link', 'translate_archive_month');
function translate_archive_month($list) {

  $patterns = array( 
    '/January/', '/February/', '/March/', '/April/', '/May/', '/June/',
    '/July/', '/August/', '/September/', '/October/',  '/November/', '/December/'
  );

  $replacements = array( //Put here whatever you want
    '01', '02', '03', '04', '05', '06', 
    '07', '08', '09', '10', '11', '12'
  );    

  $list = preg_replace($patterns, $replacements, $list);
return $list; 
}

Hope it helps.

  • That's for translating the months. I want the number to convert into my local language as in the picture. – Sok Vanrithy May 14 '13 at 16:53
  • have you tried any multilanguage plugin like WPML or QTranslate? Other option would be create your own widget. – Oterox May 14 '13 at 19:31
  • Thanks! I've used them but it doesn't have the translation of the thing that I want. I don't know how to create my own widget! – Sok Vanrithy May 15 '13 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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