Support » Plugins and Hacks » Spanish date format

Spanish date format

  • I’m using WordPress 2.3.1 in the original English for a site in Spanish and want to format dates in the Spanish format, that is to say, the date of this post is 9 de diciembre de 2007.
    Note the de before the month and the year, and the month name in lower case.
    I’ve tried:
    <?php setlocale(LC_TIME, "es_ES"); ?><?php echo strftime("%d de %B de %Y"); ?>
    but this renders:
    09 de December de 2007
    with the month name in English.
    My WordPress runs on Ubuntu 7.04, PHP 5.2.1.

    Also, in wp-config.php, I have:
    define ('WPLANG', 'es_ES');

    but this doesn’t seem to have any effect on the app, everything appears in English in the Admin panel. This is no problem, I mention it in case it has any bearing on the date format issue.

    Any help appreciated.

Viewing 1 replies (of 1 total)
  • If you define WPLANG in the config file – you also need to have the proper .mo file installed. However, that still would trsnalte only the backend (admin) and not the front-end = i.e. the theme.
    Themes need their own localization (.mo file).
    As for the date: you need to edit the_dtae or the_time tag in your theme file(s) and use the proper parameters there.

    If you don’t want to translate the wholoe theme… then just edit the wp-includes/locale.php and translate the months names + edit the tags as said above.

Viewing 1 replies (of 1 total)
  • The topic ‘Spanish date format’ is closed to new replies.