Bug #18478
closedWorkariound for PHP-Bug with Locale tr_TR
0%
Description
Since 2005 php causes problems with the locale tr_TR (http://bugs.php.net/bug.php?id=35050). In Typo3 it is not posible to set the locale_all to tr_TR, because of the "I"-php bug.
I defined as locale_all only tr, but this causes problems in some extensions, bebause the date is not rendered right (tt_news).
I would propose to define for LC_MONETARY and LC_TIME the correct locale (tr_TR), if tr is set as locale_all. Then the date rendering is correct.
config.locale_all = tr_TR
extensions: realurl, tt_news
plugin.tt_news.displayList.date_stdWrap.strftime= %A %d. %B %Y
crashes;
config.locale_all = tr
doesn't crash
Got errors on:
Call to undefined method tslib_fe::setUrlIdToken() in /path-to-typo3_src/typo3_src-4.2/typo3/sysext/cms/tslib/index_ts.php on line 432
PHP Fatal error: Class 'tx_ccdebug_ErrorIterator' not found in /path-to-hp/typo3conf/ext/cc_debug/class.tx_ccdebug.php on line 323
(issue imported from #M7901)
Files
Updated by Andri Steiner almost 16 years ago
Patch "class.tslib_fe.php.patch" does not solve the problem for me.
As described above, the problem occur if LC_CTYPE (or LC_ALL) is set to tr_TR. In TYPO3 LC_ALL is not set so we only have to ensure that LC_CTYPE is not set if locale is tr_TR. Attached Patch "bug_7901_locale_tr_workaround.diff" does not set LC_CTYPE as soon as config.locale_all begins with tr. The only drawback: Because LC_CTYPE is not set maybe some functions like strtoupper or sorting does not work exactly as expected in turkish. But i think thats all right because other way anyway nothing is working.
Updated by Nils Hodyas about 15 years ago
for us worked setting:
config.locale_all = en_US
(don't know which time format would be closest to turkish)(did not need it)
Updated by Andri Steiner about 15 years ago
No option if you need localized week and month names.
Updated by Peter Murray about 15 years ago
The Turkish locale problem is supposed to be fixed in PHP 6, so modify the patch to test for the PHP version and Turkish locale.
// Setting locale
if ($this->config['config']['locale_all']) {
# Change by Rene Fritz, 22/10 2002
# there's a problem that PHP parses float values in scripts wrong if the locale LC_NUMERIC is set to something with a comma as decimal point
# this does not work in php 4.2.3
#setlocale('LC_ALL',$this->config['config']['locale_all']);
#setlocale('LC_NUMERIC','en_US');
- so we set all except LC_NUMERIC
- Change by Peter Murray, 16/9/2009
- there is a problem with Turkish locales in PHP 5 but fixed in PHP 6
if (version_compare(phpversion(), '6.0', '>') || substr($this->config['config']['locale_all'], 0, 2)!='tr') {
setlocale(LC_CTYPE,$this->config['config']['locale_all']);
}
setlocale(LC_COLLATE,$this->config['config']['locale_all']);
setlocale(LC_MONETARY,$this->config['config']['locale_all']);
setlocale(LC_TIME,$this->config['config']['locale_all']);
$this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);
}
Updated by Christian Kuhn over 14 years ago
- trunk rev. 8525
- 4.4 rev. 8526
- 4.3 rev. 8527