[TYPO3-dev] How to set locale for backend?
Charles Brunet
charles.fmj at gmail.com
Mon Oct 27 12:07:11 CET 2014
Hello,
Thank you for your answers. However, this is not the point. I know how to
use config.locale_all, 'fr_CA.utf8' is the right locale on my system, and I
know how to use the format.date ViewHelper to handle localized dates. All
of this works very well for frontend plugins.
My question is: is there a way in TYPO3 to set _backend_ locale? IMHO, I
shouldn't do it inside my extension, but there should be a configuration
for this somewhere. However, I wasn't able to find it. I think there should
be a global way to set this (apart from setting it in php.ini), and also
per user. If really this doesn't exist, I will open a ticket.
Thank you,
Charles.
*Charles Brunet, B. Ing.*
Webmestre.
Étudiant au doctorat, génie électrique, Université Laval.
2014-10-27 3:58 GMT-04:00 bernd wilke <t3ng at bernd-wilke.net>:
> send to early :(
> Am 27.10.14 08:48, schrieb bernd wilke:
>
>> Am 26.10.14 16:29, schrieb Charles Brunet:
>>
>>> Hello,
>>>
>>> I wrote a backend module using extbase (TYPO3 6.2). I want to display
>>> localized date. If my fliud template, I have:
>>>
>>> <f:format.date format="%e %B %Y">{feuillet.date}</f:format.date>
>>>
>>> However, the date always is written in English, whatever the backend
>>> language is.
>>>
>>> I temporary solved the problem putting
>>>
>>> setlocale(LC_TIME, 'fr_CA.utf8');
>>>
>>> in the initializeAction function of my controller, but this is more a
>>> hack
>>> than a real solution.
>>>
>>>
>>> What is the proper way to set the locale for the backend?
>>>
>>>
>> have a look at the wiki[1]:
>> | Be aware: as the php function date() is not capable of localisation
>> | you have no chance to get local named times (weekday, month)
>> |
>> | Since Feb 2013 the functionality of this viewhelper is extended: you
>> | can use strftime-format-strings (recognized by the usage of '%' in
>> | the format-string) and use localisation for weekdays and month.
>>
>
> All language specific output which depends on useruserinput must be
> handled inside your programm.
> The server has only one setting, which can (and should) be set with
> setlocale as you do. so this should be done globaly than in the controller.
> therefore TYPO3 has the setting
> config.locale_all
> there you need to set a string, which is recognized by your server!
> maybe your server does not know 'fr_CA', then you must use 'fr_CA.utf8'
>
> you can get a list of available configuration on the command line with:
> locale -a
>
>
> [1] http://wiki.typo3.org/Fluid#f:format.date
>>
>
> bernd
> --
> http://www.pi-phi.de/cheatsheet.html
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>
More information about the TYPO3-dev
mailing list