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.

Now it shows something like this:

  • March 2012
  • February 2012

But I want to show something like this

  • 03.2012
  • 02.2012

or something in Turkish like this

  • Mart 2012
  • Şubat 2012
share|improve this question

2 Answers 2

The WordPress Archive widget internally calls wp_get_archives(). You can find that function in wp-includes/general-template.php. On line 939 you find the applicable line:

/* translators: 1: month name, 2: 4-digit year */
$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);

I see no filters that would allow you to change it to something like "03.2012" without changing the core files. However, if you just would like the month to show up in Turkish, it should only be a matter of defining WPLANG correctly in wp-config.php. Of course, you have to make sure you provide the language mo-file in your wp-content/languages/ directory.

share|improve this answer
    
thank you for the answer... my WPLANG defined tr_TR in the config file and I am using correct mo-file... But that file does not contain month names... –  spinodal Mar 8 '12 at 15:13
1  
Well, in that case, it is just a matter of updating your mo-file. codex.wordpress.org/Translating_WordPress –  Geert Mar 8 '12 at 15:27
    
although I've added the month names to the file as described in the link you gave, it still is in English. I did not understand why? –  spinodal Mar 9 '12 at 11:30

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 NEED
    '01.', '02.', '03.', '04.', '05.', '06.', 
    '07.', '08.', '09.', '10.', '11.', '12.'
  );    

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

Hope it helps.

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.