Opened 14 years ago
Closed 14 years ago
#12351 closed defect (bug) (wontfix)
Date Localization is a pain with date() syntax
Reported by: | brodock | Owned by: | nbachiyski |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9.2 |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
Because Wordpress makes use of Date syntax, non english languages has to scape every single character it wants to print, so dates can make sense.
Here is a plain example of how things are done to get date in portuguese:
echo(date('j \d\e F \d\e Y'));
Will print:
23 de February de 2010
(also found that you guys make some magic to transform 'February' to 'Fevereiro')
If instead of date functions we use strftime syntax:
setlocale(LC_ALL, 'pt_BR.UTF-8');
echo(strftime('%d de %B de %Y')."\n");
it will print the right way:
23 de Fevereiro de 2010
Without messing up the input with escape characters that then, have to be dealed with php's addslashes, etc.
Also by the current implementation, sometimes at random (I believe it's related to "blog upgrade", blog default date format lose it's escaping characters printing instead:
23 de February de 201023 23America/Sao_Paulo February 23America/Sao_Paulo 2010
I don't think there would be any traction to move from date() to strftime().