Web de León

El conocimiento humano pertenece al mundo

Traducción de la Fecha de WordPress a Español

Publicado en Descargas, Tutoriales, Wordpress el 09/13/2010 por León

Traducción versión 3.0.1 o superior:

Este post esta actualizado a WordPress 3.0.1

El día de hoy les traigo la traducción de la fecha de WordPress al Español sin usar ningún plugin, solo editando el archivo locale.php de tu WordPress. Pueden descargar la versión de WordPress en Español pero la fecha de su plantilla seguirá estando en inglés y esto es porque el WordPress en Español solo traduce el Panel de Administración así que les traigo la solución. Esta traducción del locale.php es para WordPress 3.0.1. El archivo locale.php se encuentra en la carpeta wp-includes/ del directorio donde se encuentran los archivos de tu WordPress ;) .

Bueno este post se divide en 3 partes:
El Procedimiento de Edición – para que aprendan como hacerlo, esto es solo en la versión mas reciente (WordPress 3.0.1).
La Descarga del Archivo – por si se hacen pelotas en el camino o quieren evitar tecnicismos para saltarse la primera parte jeje ;) (Descarga para la versión WordPress 3.0.1 o superior).
Y finalmente el Formato de Fecha – para que lo implementen en la plantilla/template/diseño/theme/tema de su blog.

Nota: Recuerden hacer respaldo de su archivo locale.php por si algo les falla.

Procedimiento de Edición:

Primero que nada extraemos el archivo locale.php el cual tiene la siguiente ruta /wp-includes/locale.php y lo abrimos en su editor de texto/html favorito (ya sea Front Page, Dreamweaver, el Bloc de Notas, gedit, geany, Notepad++ o el que usen).

-Ahora bien vamos a la línea 108  a  114 y tenemos lo siguiente:

$this->weekday[0] = /* translators: weekday */ __('Sunday');
$this->weekday[1] = /* translators: weekday */ __('Monday');
$this->weekday[2] = /* translators: weekday */ __('Tuesday');
$this->weekday[3] = /* translators: weekday */ __('Wednesday');
$this->weekday[4] = /* translators: weekday */ __('Thursday');
$this->weekday[5] = /* translators: weekday */ __('Friday');
$this->weekday[6] = /* translators: weekday */ __('Saturday');

*Lo cambiamos por esto:

$this->weekday[0] = /* translators: weekday */ __('Domingo');
$this->weekday[1] = /* translators: weekday */ __('Lunes');
$this->weekday[2] = /* translators: weekday */ __('Martes');
$this->weekday[3] = /* translators: weekday */ __('Miércoles');
$this->weekday[4] = /* translators: weekday */ __('Jueves');
$this->weekday[5] = /* translators: weekday */ __('Viernes');
$this->weekday[6] = /* translators: weekday */ __('Sábado');

*Nota: é y á es la forma HTML de escribir la e acentuada (é) y la a acentuada (á) respectivamente y están escritas de este modo para que sea codificado correctamente al ser llamado a la plantilla :) .

-Ahora editamos la línea 118 a 124 que tiene algo asi:

$this->weekday_initial[__('Sunday')]    = /* translators: one-letter abbreviation of the weekday */ __('S_Sunday_initial');
$this->weekday_initial[__('Monday')]    = /* translators: one-letter abbreviation of the weekday */ __('M_Monday_initial');
$this->weekday_initial[__('Tuesday')]   = /* translators: one-letter abbreviation of the weekday */ __('T_Tuesday_initial');
$this->weekday_initial[__('Wednesday')] = /* translators: one-letter abbreviation of the weekday */ __('W_Wednesday_initial');
$this->weekday_initial[__('Thursday')]  = /* translators: one-letter abbreviation of the weekday */ __('T_Thursday_initial');
$this->weekday_initial[__('Friday')]    = /* translators: one-letter abbreviation of the weekday */ __('F_Friday_initial');
$this->weekday_initial[__('Saturday')]  = /* translators: one-letter abbreviation of the weekday */ __('S_Saturday_initial');

*Y lo cambiamos por esto:

$this->weekday_initial[__('Domingo')]    = /* translators: one-letter abbreviation of the weekday */ __('D_Domingo_initial');
$this->weekday_initial[__('Lunes')]    = /* translators: one-letter abbreviation of the weekday */ __('L_Lunes_initial');
$this->weekday_initial[__('Martes')]   = /* translators: one-letter abbreviation of the weekday */ __('Ma_Martes_initial');
$this->weekday_initial[__('Miércoles')] = /* translators: one-letter abbreviation of the weekday */ __('Mi_Miércoles_initial');
$this->weekday_initial[__('Jueves')]  = /* translators: one-letter abbreviation of the weekday */ __('J_Jueves_initial');
$this->weekday_initial[__('Viernes')]    = /* translators: one-letter abbreviation of the weekday */ __('V_Viernes_initial');
$this->weekday_initial[__('Sábado')]  = /* translators: one-letter abbreviation of the weekday */ __('S_Sábado_initial');

-Vamos a la línea 131 a 137 que contiene esto:

$this->weekday_abbrev[__('Sunday')]    = /* translators: three-letter abbreviation of the weekday */ __('Sun');
$this->weekday_abbrev[__('Monday')]    = /* translators: three-letter abbreviation of the weekday */ __('Mon');
$this->weekday_abbrev[__('Tuesday')]   = /* translators: three-letter abbreviation of the weekday */ __('Tue');
$this->weekday_abbrev[__('Wednesday')] = /* translators: three-letter abbreviation of the weekday */ __('Wed');
$this->weekday_abbrev[__('Thursday')]  = /* translators: three-letter abbreviation of the weekday */ __('Thu');
$this->weekday_abbrev[__('Friday')]    = /* translators: three-letter abbreviation of the weekday */ __('Fri');
$this->weekday_abbrev[__('Saturday')]  = /* translators: three-letter abbreviation of the weekday */ __('Sat');

*Lo sustituimos por esto:

$this->weekday_abbrev[__('Domingo')]    = /* translators: three-letter abbreviation of the weekday */ __('Dom');
$this->weekday_abbrev[__('Lunes')]    = /* translators: three-letter abbreviation of the weekday */ __('Lun');
$this->weekday_abbrev[__('Martes')]   = /* translators: three-letter abbreviation of the weekday */ __('Mar');
$this->weekday_abbrev[__('Miércoles')] = /* translators: three-letter abbreviation of the weekday */ __('Mié');
$this->weekday_abbrev[__('Jueves')]  = /* translators: three-letter abbreviation of the weekday */ __('Jue');
$this->weekday_abbrev[__('Viernes')]    = /* translators: three-letter abbreviation of the weekday */ __('Vie');
$this->weekday_abbrev[__('Sábado')]  = /* translators: three-letter abbreviation of the weekday */ __('Sáb');

-Ahora la línea 140 a 151:

$this->month['01'] = /* translators: month name */ __('January');
$this->month['02'] = /* translators: month name */ __('February');
$this->month['03'] = /* translators: month name */ __('March');
$this->month['04'] = /* translators: month name */ __('April');
$this->month['05'] = /* translators: month name */ __('May');
$this->month['06'] = /* translators: month name */ __('June');
$this->month['07'] = /* translators: month name */ __('July');
$this->month['08'] = /* translators: month name */ __('August');
$this->month['09'] = /* translators: month name */ __('September');
$this->month['10'] = /* translators: month name */ __('October');
$this->month['11'] = /* translators: month name */ __('November');
$this->month['12'] = /* translators: month name */ __('December');

*Lo cambiamos por esto:

$this->month['01'] = /* translators: month name */ __('Enero');
$this->month['02'] = /* translators: month name */ __('Febrero');
$this->month['03'] = /* translators: month name */ __('Marzo');
$this->month['04'] = /* translators: month name */ __('Abril');
$this->month['05'] = /* translators: month name */ __('Mayo');
$this->month['06'] = /* translators: month name */ __('Junio');
$this->month['07'] = /* translators: month name */ __('Julio');
$this->month['08'] = /* translators: month name */ __('Agosto');
$this->month['09'] = /* translators: month name */ __('Septiembre');
$this->month['10'] = /* translators: month name */ __('Octubre');
$this->month['11'] = /* translators: month name */ __('Noviembre');
$this->month['12'] = /* translators: month name */ __('Diciembre');

-Por último la línea 157 a 168:

$this->month_abbrev[__('January')] = /* translators: three-letter abbreviation of the month */ __('Jan_January_abbreviation');
$this->month_abbrev[__('February')] = /* translators: three-letter abbreviation of the month */ __('Feb_February_abbreviation');
$this->month_abbrev[__('March')] = /* translators: three-letter abbreviation of the month */ __('Mar_March_abbreviation');
$this->month_abbrev[__('April')] = /* translators: three-letter abbreviation of the month */ __('Apr_April_abbreviation');
$this->month_abbrev[__('May')] = /* translators: three-letter abbreviation of the month */ __('May_May_abbreviation');
$this->month_abbrev[__('June')] = /* translators: three-letter abbreviation of the month */ __('Jun_June_abbreviation');
$this->month_abbrev[__('July')] = /* translators: three-letter abbreviation of the month */ __('Jul_July_abbreviation');
$this->month_abbrev[__('August')] = /* translators: three-letter abbreviation of the month */ __('Aug_August_abbreviation');
$this->month_abbrev[__('September')] = /* translators: three-letter abbreviation of the month */ __('Sep_September_abbreviation');
$this->month_abbrev[__('October')] = /* translators: three-letter abbreviation of the month */ __('Oct_October_abbreviation');
$this->month_abbrev[__('November')] = /* translators: three-letter abbreviation of the month */ __('Nov_November_abbreviation');
$this->month_abbrev[__('December')] = /* translators: three-letter abbreviation of the month */ __('Dec_December_abbreviation');

*La modificamos poniendo lo siguiente:

$this->month_abbrev[__('Enero')] = /* translators: three-letter abbreviation of the month */ __('Ene_Enero_abbreviation');
$this->month_abbrev[__('Febrero')] = /* translators: three-letter abbreviation of the month */ __('Feb_Febrero_abbreviation');
$this->month_abbrev[__('Marzo')] = /* translators: three-letter abbreviation of the month */ __('Mar_Marzo_abbreviation');
$this->month_abbrev[__('Abril')] = /* translators: three-letter abbreviation of the month */ __('Abr_Abril_abbreviation');
$this->month_abbrev[__('Mayo')] = /* translators: three-letter abbreviation of the month */ __('May_Mayo_abbreviation');
$this->month_abbrev[__('Junio')] = /* translators: three-letter abbreviation of the month */ __('Jun_Junio_abbreviation');
$this->month_abbrev[__('Julio')] = /* translators: three-letter abbreviation of the month */ __('Jul_Julio_abbreviation');
$this->month_abbrev[__('Agosto')] = /* translators: three-letter abbreviation of the month */ __('Ago_Agosto_abbreviation');
$this->month_abbrev[__('Septiembre')] = /* translators: three-letter abbreviation of the month */ __('Sep_Septiembre_abbreviation');
$this->month_abbrev[__('Octubre')] = /* translators: three-letter abbreviation of the month */ __('Oct_Octubre_abbreviation');
$this->month_abbrev[__('Noviembre')] = /* translators: three-letter abbreviation of the month */ __('Nov_Noviembre_abbreviation');
$this->month_abbrev[__('Diciembre')] = /* translators: three-letter abbreviation of the month */ __('Dic_Diciembre_abbreviation');

Y listo! Guardamos los cambios y volvemos a subir nuestro archivo locale.php a nuestra carpeta wp-includes/ reemplazando al locale.php que ya esta en el servidor y eso es todo ;) . Espero que les sirva y más que nada no le tengan miedo a moverle a su archivo locale.php para que así tenga una idea de que hacer en futuras versiones y así poder editarlo ustedes solitos ;) .

Descarga del Archivo

Por si no fui muy claro con esta explicación, les dejo el locale.php, lo comprimí en .rar y esta listo con la traducción nadamas para que lo suban a la carpeta wp-includes/ de su wordpress.

CLICK AQUÍ PARA DESCARGAR locale.php EN ESPAÑOL (Versión para WordPress 3.0.1)

Formatos de Fecha

Aquí les pondré como funciona y que significa cada letra en el tema de su WordPress para que le den formato a su gusto:

Ahora vamos a ver el significado de las letras mas básicas:

d=Día del mes, 2 dígitos con ceros iniciales: 01 a 31
D=Representación textual de un día, tres letras: Lun a Dom
j=Día del mes sin ceros iniciales: 1 a 31
l=Representación textual completa del día de la semana: Lunes a Domingo
S=Sufijo original EN INGLÉS del día del mes, 2 caracteres: st, nd, rd o th. No sale en español y no le veo la utilidad xD

F=Representación textual completa de un mes: Enero a Diciembre
m=Representación numérica de un mes, con ceros iniciales: 01 a 12
n=Representación numérica de un mes, sin ceros iniciales: 1 a 12
M=Representación textual corta de un mes, tres letras: Ene a Dic
Y=Representación numérica completa de un año, 4 dígitos: ejemplo, 1999 ó 2008
y=Representación de dos dígitos de un año: ejemplo, 99 ó 08
\=Escapa caracteres especiales: ejemplo, \h\o\l\a imprimiría hola

Bueno eso es lo básico, si quieren ver más formatos para fecha en php den click aquí. les dejo unos ejemplos recomendados:

l j \d\e F \d\e\l Y\. == día número_de_día de Mes del año.
Ejemplo de lo que devuelve: lunes 13 de Septiembre del 2010.

l j \d\e F \d\e Y\. == día número_de_día de Mes de año.
Ejemplo de lo que devuelve: lunes 13 de Septiembre de 2010.

F j \d\e\l Y\. == Mes número_de_día del año.
Ejemplo de lo que devuelve: Septiembre 13 del 2010.

F j \d\e Y\. == Mes número_de_día de año.
Ejemplo de lo que devuelve: Septiembre 13 de 2010.

Espero les sea de utilidad ;) . Cualquier duda, comentario y/o sugerencia pueden postearla en la seccion de comentarios.

Link Corto:

12 COMENTARIOS

  1. Andrés Borbón posteo el 29/09/2008 a las 2:48 am lo siguiente:

    Muy útil, aunque me confieso un haragán en estas cosas. Je, je. A ver si un día se me quita. Creo que mejor voy a instalar uno de esos packs en español de wordpress, que ya vienen con plugins y todo. Ja, ja.

  2. mlkrmn posteo el 26/11/2008 a las 8:21 pm lo siguiente:

    Muy buen post, ya seguí instrucciones tal cual comentas, pero aun sigue apareciendo en ingles :( , no hay otro archivo que cambiar, ya actualice y nada.

    Saludos

  3. León posteo el 26/11/2008 a las 8:25 pm lo siguiente:

    @mlkrmn: Para cambiar la fecha solo es el locale.php ahora que si quieres cambiar todo lo que este en el theme a español, tendrías que hacer la traducción tu mismo en tu theme, como los themes varian no se puede hacer una guía específica sobre traducción del theme, solo tienes que saber lo básico de php para que no vayas a cambiar alguna variable por error.

    A la hora de subir el locale.php dentro de la carpeta wp-includes/ debe de decirte que si quieres sustituir el locale.php anterior, le dices que si deseas reemplazarlo, vas a tu blog y actualizas, si no funciona intenta ctrl F5, puede que estes viendo el cache.

    Por cierto, yo veo que en tu blog ya esta la fecha en español, Saludos.

  4. Ayuda Celestial: Traducción al Español de K2 para Wordpress | jibarourbano.net posteo el 07/12/2008 a las 1:10 am lo siguiente:

    [...] en español. Fue una Ayuda Celestial!!! En el Blog de Reyson encontré K2 traducido y en el Web de León la tradución del formato de la fecha de cada post. Fácil! Casi, casi; pero lo [...]

  5. Matias posteo el 19/02/2009 a las 7:43 pm lo siguiente:

    Hola compa, te agradezco por este post, de verda me sirvio, pude cambiar la fecha que aparecia en los post en ingles.. al español.. gracias de verdad y sigue asi Saludos. lol

  6. León posteo el 20/02/2009 a las 2:43 pm lo siguiente:

    @Matias: de nada Matias :D que bueno que te haya servido ;)

    Saludos

  7. Illi.Pro posteo el 26/02/2009 a las 4:11 pm lo siguiente:

    Al fin algo productivo :3 !
    Nee mentira tío, gracias :D !

    lol

  8. León posteo el 26/02/2009 a las 7:08 pm lo siguiente:

    @Illi.Pro: De nada nab x3 :3 lol

  9. rodrigo posteo el 09/09/2009 a las 3:48 pm lo siguiente:

    reemplazé el locale.php y aun me aparece la fecha con el mes en inlges, ocupo wordpress 2.6.3, además el template está desarrollado con artisteer, ¿tal vez por eso no funciona?

  10. León posteo el 09/09/2009 a las 7:15 pm lo siguiente:

    @rodrigo: No importa como este el template, debe de funcionar igual. Asegúrate de descomprimir el archivo antes de ponerlo en el directorio wp-includes/ y sobreescribe en el otro archivo.

  11. guspelin posteo el 04/05/2010 a las 5:55 pm lo siguiente:

    Me cambia todo excepto lo más importante la fecha de la cabecera, por favor ayuda, ¿como lo arreglo?

    <div class="today">
    <span class="day"><?php echo date('j '); ?></span><br/>
    <span class="mony"><?php echo date(' F , Y '); ?></span><br/>
    <span class="dname"><?php echo date(' l '); ?></span>
    </div>

  12. León posteo el 12/07/2010 a las 5:09 pm lo siguiente:

    no entiendo, que es exactamente lo que quieres cambiar? el formato? el archivo locale solo te hace la traducción, las letras j, F, Y y l que ves tienen un significado, eso si lo tendrías que editar, que formato quieres que tenga la fecha?

Deja un comentario







(X)HTML: Puedes usar estas etiquetas en tu comentario: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> y además incrustar código [nombre_del_lenguaje]Código[/nombre_del_lenguaje]

sonrisa triste contento lengua sorprendido guiño llorar cool lol x3 :3 T_T xD neutral