Steffen Müller's TYPO3 blog

September 30, 2008

Fixing locale problems for dates in TYPO3

Sometimes, localization of dates in TYPO3 seems not to work as expected. Of course it does, but finding the right configuration can be puzzling and time consuming. One reason can be the confusing variety of locale declarations.

Localization problems mostly emerge when moving a website from one server to another or when working with different environments at the same time.

Today, I did some tests on moving from outdated SuSE to Debian Etch. Cloning the database and the files was easy and went fine, but then I stumbled over wrong date localization of tt_news. The website comes with german as default language and english and french as secondary. Nevertheless, the fresh clone on the Debian server ignored all language settings, using english formats for all pages.

The reason was the config.locale_all setting in the TypoScript template. My configuration was:

config.locale_all = de_DE
[globalVar = GP:L = 1]
  config.locale_all = en_EN
[global]
[globalVar = GP:L = 2]
  config.locale_all = fr_FR
[global]

and this worked fine on SuSE. However, Debian does not come with any of these locales and TYPO3 switched to default (english). I found out, that the locales on Debian use a different naming scheme than SuSE does. Switching to the command line,

locale -a

revealed the names of all installed locales. That was de_DE.utf-8, en_US.utf-8 and fr_FR.utf-8. I changed my configuration accordingly and everything worked fine:

config.locale_all = de_DE.utf-8
[globalVar = GP:L = 1]
  config.locale_all = en_US.utf-8
[global]
[globalVar = GP:L = 2]
  config.locale_all = fr_FR.utf-8
[global]

Comments


Leave a comment:

(will not be published)

yes no

About this site

At the moment, T3node is a TYPO3 blog by Steffen Müller. Beside TYPO3, technical and nontechnical topics about free software and the internet are discussed.

This blog is also a personal survey about what motivates me to write this blog and what issues are worth writing. Statistically, my motivation to do this is probably to

1. express myself
2. connect with other people
3. share knowledge with other people

All contents are distributed under the Creative Commons Attribution - NonCommercial - ShareAlike 3.0 Unported licence.

About other sites