[TYPO3-core] RFC: enable localization for section titles (bugfix)
Dmitry Dulepov
typo3 at accio.lv
Wed Jul 12 14:44:40 CEST 2006
Hi!
Bernhard Kraft wrote:
> Or even better: Let also the "NEW" come from an LL file:
Nice! one more vote and I can commit this change as well.
> http://lists.netfielders.de/pipermail/typo3-team-core/2006-February/002307.html
>
> I already suggested this in February but didn't have any further time to care about
> it and there wasn't much response except from Martin and Franz.
I like patch there (to use it not only with TV but with any flexform).
But I found more than one place where ['tx_templavoila']['title']
appears, so they all should be changed.
> And it is interesting that Martin had the same question (What does this tx_templavoila there)
> months again and now :)
Question is very reasonable :)
> Dmitry: Are you sure that when ->sL('Here whatever Text') get's called the same text as passed is
> returned when no label is found for it ?
> As far as i can extract from typo3/sysext/lang/lang.php line 300:
> - ----
> if (strcmp(substr($input,0,4),'LLL:')) { // Using obsolete 'language-splitted' labels:
> $t = explode('|',$input);
> $out = $t[$this->langSplitIndex] ? $t[$this->langSplitIndex] : $t[0];
> return $this->hscAndCharConv($out, $hsc);
> - ----
> it is doing the "obsolete" language splitting when no "LLL:" label is found.
>
> this would mean you break all labels of sections for different languages then the default one for
> old flexforms which do not use "LLL:" labels for the section title (downwards compatibility).
>
> But I may be wrong :)
This code checks if $t[$this->langSplitIndex] is not false (i.e. it is
set and not empty) and only than uses it, otherwise uses first element
of array, which is string itself if no pipe character present. So it
should work properly unless field's title contain pipe character.
> Have a look at the above link. I did a ?: operation to surely return a value and tended to not use
> [tx_templavoila][title]
> but rather
> [tx_templavoila][label]
Agree but this would be another bug and patch. I think each change
should correct one specific problem or it will be hard to understand
history of changes. For example, in TV I commit each time after I fix
one specific problem. Ver aeasy to revert if it was wrong.
> This is a new option - LLL labels for flexform sections. So we can choose a new place where it
> has to get added and simply let it overrule the previous way of setting [title].
...and loose compatibility with many existing TV installations :) +
update docs.
> We should even consider Masis suggestion and move it out of this "tx_templavoila" sub-structure -
> I think this was for historic reasons when flex-forms and TV was one and the same thing - which
> is not true anymore - FxF (as I would abbreviate FlexForm :) are part of the core.
I fully agree, I even thought about writing a bug report about it (which
I will write!). I want to support both ways:
- ['label']
- [$whatever]['title']
Dmitry.
--
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
More information about the TYPO3-team-core
mailing list