Hello all,
My manager, my DB and my site are all UTF8...
When I use something like "[[+editedon:strtotime:date=`%d %b %Y` ]]" it works fine, if I use something like
[[+editedon:strtotime:date=`%A %d %B %Y` ]]`it outputs the date in english (Monday 26 August 2010),
I would like to have the date displayed in french so I expect this output: "Lundi 26 Août 2010"
- if I put a snippet with "setlocale(’fr_FR.uf8’);" it does not work at all
- if I put a snippet with "setlocale(’fr_FR’, ’fra’);" it works but the date is displayed in ISO with squares and other funky characters...
After searching on the web it seems that the php "strftime()" return is in ISO (without taking into account the "setlocale").
I I use the date in a snippet I can do "$date= utf8_encode(strftime("%A %d %B %Y");", and then the date is displayed in french with accents etc, no problem... as I want it to be displayed
I would like to be able to do that with each date on my site (without the use of a snippet to encode in utf8) is there a way via the input/output filters something like :"[[+editedon:strtotime:utf8:date=`%A %d %B %Y` ]]" ?
Or is there another way to set all the dates in french and UTF8 ?
Thanks for your help
-
☆ A M B ☆
- 872 Posts
Maybe by setting the locale in your htaccess.
I don’t remember how, but i did it once on an evo site for a similar issue.
I’m not very familiar with the htaccess files...
Should I add "setlocale: fr_FR.UTF8" in my htaccess ? or is there a more specific instruction ?
Thanks for your help...
-
☆ A M B ☆
- 69 Posts
Bonjour,
perso, je fais pour ça un plugin, contenant une seule ligne :
setlocale(LC_ALL, ’fr_FR’);
- Je ne précise pas UTF-8 (c’est par défaut dans la configuration du système), et j’utilise la syntaxe exacte ci-dessus.
- comme événement, je choisis «OnLoadWebDocument».
et toute mes dates s’affichent bien en français correct.
... Does not work for me...
If i do the same with a plugin
setlocale(LC_ALL, ’fr_FR’); it does not work (date still in english), if I make "setlocale(LC_ALL, ’fra’)" date is in french but with funky chars...
PS - I test this on my local install (W7 and Wamp server), not tried yet on my live server (Linux)...