Project

General

Profile

Actions

Bug #18478

closed

Workariound for PHP-Bug with Locale tr_TR

Added by Alexander Maringer about 16 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-03-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

class.tslib_fe.php.patch (998 Bytes) class.tslib_fe.php.patch Administrator Admin, 2008-03-19 06:53
bug_7901_locale_tr_workaround.diff (699 Bytes) bug_7901_locale_tr_workaround.diff Administrator Admin, 2008-11-28 10:19

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #76804: Deprecate GeneralUtility::strtoupper & strtolowerClosedGeorg Ringer2016-06-27

Actions
Actions #1

Updated by Andri Steiner over 15 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.

Actions #2

Updated by Nils Hodyas over 14 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)

Actions #3

Updated by Andri Steiner over 14 years ago

No option if you need localized week and month names.

Actions #4

Updated by Peter Murray over 14 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');

  1. so we set all except LC_NUMERIC
  1. Change by Peter Murray, 16/9/2009
  2. 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']);
}
Actions #5

Updated by Christian Kuhn over 13 years ago

Committed to:
  • trunk rev. 8525
  • 4.4 rev. 8526
  • 4.3 rev. 8527
Actions #6

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF