Bug #3134
locallang.php is not really working correctly with utf-8 as renderCharset
| Status: | New | Start date: | 2009-04-20 | ||
|---|---|---|---|---|---|
| Priority: | Must have | Due date: | |||
| Assignee: | - | % Done: | 90% |
||
| Category: | - | ||||
| Target version: | - | ||||
| Votes: | 0 |
Description
I have a version of the extension, which is based upon the latest on TER available version, which fixes this issue (includes a locallang.xml instead of the old locallang.php)
Probably someone may tell me, how to contribute in the right way.
(I have some more important changes on my disc, including the 'close by click on date' bug)
best regards, clemens
Associated revisions
[Bug 3134] Check line feeds for multiline registration CSV exports,r=oliver
History
Updated by Clemens Riccabona about 4 years ago
- File locallang.xml added
Updated by Clemens Riccabona about 4 years ago
This is the new function get_LL for including locallang.xml:
function get_LL($key,$alt='',$hsc=FALSE) {
// Load translations
// This is done kind of manually here, because we use this class
// without making an instance. That's why I don't use pi_loadLL etc.
// because we don't know in which scope we're currently in.
// Do you know a better way? Tell me ... ;-)
// Begin CHANGES by RICC
// Old code
// $basePath = t3lib_extMgm::siteRelPath('rlmp_dateselectlib').'/locallang.php';
// if (@is_file($basePath)) {
// include('./'.$basePath);
// }
$basePath = t3lib_extMgm::siteRelPath('rlmp_dateselectlib').'/locallang.xml';
if (@is_file($basePath)) {
$LOCAL_LANG = t3lib_div::readLLXMLfile($basePath,$this->LLkey);
}
// end CHANGES by RICC
if (isset($LOCAL_LANG[$this->LLkey][$key])) {
$word = $GLOBALS['TSFE']->csConv($LOCAL_LANG[$this->LLkey][$key], $this->LOCAL_LANG_charset[$this->LLkey][$key]); // The "from" charset is normally empty and thus it will convert from the charset of the system language, but if it is set (see >pi_loadLL()) it will be used.
} elseif ($this>altLLkey && isset($LOCAL_LANG[$this->altLLkey][$key])) {
$word = $GLOBALS['TSFE']->csConv($LOCAL_LANG[$this->altLLkey][$key], $this->LOCAL_LANG_charset[$this->altLLkey][$key]); // The "from" charset is normally empty and thus it will convert from the charset of the system language, but if it is set (see >pi_loadLL()) it will be used.
} elseif (isset($LOCAL_LANG['default'][$key])) {
$word = $LOCAL_LANG['default'][$key]; // No charset conversion because default is english and thereby ASCII
} else {
$word = $this>LLtestPrefixAlt.$alt;
}
$output = $this->LLtestPrefix.$word;
if ($hsc) $output = htmlspecialchars($output);
return $output;
}