Project

General

Profile

Bug #16870 » ff_label_charset_change_only.txt

Administrator Admin, 2007-01-20 22:20

 
Index: t3lib/class.t3lib_tceforms.php
===================================================================
--- t3lib/class.t3lib_tceforms.php (revision 1891)
+++ t3lib/class.t3lib_tceforms.php (working copy)
@@ -2395,7 +2400,7 @@
if (!$value['TCEforms']['displayCond'] || $this->isDisplayCondition($value['TCEforms']['displayCond'],$editData,$vDEFkey)) {
$fakePA=array();
$fakePA['fieldConf']=array(
- 'label' => $this->sL(trim($value['TCEforms']['label'])),
+ 'label' => $this->sL_FF(trim($value['TCEforms']['label'])),
'config' => $value['TCEforms']['config'],
'defaultExtras' => $value['TCEforms']['defaultExtras'],
'onChange' => $value['TCEforms']['onChange']
@@ -5249,6 +5254,22 @@
}
/**
+ * Fetches language label for key from flexform. This function is also called for "plain" labels (not <code>LLL:</code>). Labels in flexforms are always in UTF-8, so this function temporarily alters $LANG->origCharSet to UTF-8 to correctly convert text.
+ *
+ * @param string Language label reference, eg. 'LLL:EXT:lang/locallang_core.php:labels.blablabla'
+ * @return string The value of the label, fetched for the current backend language.
+ */
+ function sL_FF($str) {
+ global $LANG;
+
+ $charset = $LANG->origCharSet;
+ $LANG->origCharSet = 'utf-8';
+ $result = $LANG->sL($str);
+ $LANG->origCharSet = $charset;
+ return $result;
+ }
+
+ /**
* Returns language label from locallang_core.php
* Labels must be prefixed with either "l_" or "m_".
* The prefix "l_" maps to the prefix "labels." inside locallang_core.php
(3-3/5)