[TYPO3-dev] PI language labels

J. Lingott jbl at deweblop.de
Mon Aug 30 13:42:43 CEST 2010


  Hi again and thanks for taking the time Dmitry.

Dmitry Dulepov wrote:
> Hi!
> Well, you can continue doing it your way if you want but it is still
> incorrect for the reasons that I told you in the previous post.

So to make a point, you propose to get the config and load the language 
file inside the hook. As I mentioned that didn't work either (and is 
currently even done like that, but see below).

> Sorry, in one pof previous messages you told you XCLASS tt_news, now you
> talk about the hook. What do you use exactly: the hook or XCLASS? There are
> two different things.

Currently its just using the hook.

> Well... I would not let any such code into any of my systems for several
> reasons:

Guess I should explain or correct some things. The current code is more 
or less a mess, I have to admit, it does both BE and FE correction on 
the titles. That should be changed (i.e. broken into two separate 
classes) when finishing it. But before i can finish it I need to get 
this problem with language labels solved. If you got any proposals on 
how to improve the code concerning the issues you mentioned I would 
appreciate it very much.

> - it uses pibase but it is not a plugin. pibase is for plugins only.
> - pibase classes are not for BE

The reason for doing this was to be able to test the pibase functions 
for language fetching. As it does not work now anyways it can be removed 
again. Yet, I would need a method to extend the tt_news language file then.

> - it parses TypoScript on its own causing performance and compatibility issues

Is there a better way to get the extension's TS setup in BE?

> - your code will not work if tt_news is instantiated from TS with a
> customized config

Didn't think of that case yet, but as I said this extension is not yet 
finished and therefore can take in account any proposals. Thanks for 
that remark!

> - your manipulates RealURL tables, which do not belong to you. It is like
> going to your neighbour and taking his TV without his permission.

The reason for doing this concerned with the extension's goal. It is 
meant to extend tt_news in a way so you can write continuations and 
reviews of news articles, which are connected to them by their uid. They 
have their own types and everything in the BE works just fine. But to 
come back to the point, as those news articles do have the same title in 
the tt_news table as the connected/ original article, the RealURL alias 
has to be changed to the current title (which cannot be saved as it 
should always contain the right translation prefix/ postfix). As the 
concerning methods of RealURL are private I had to do it manually (if 
you got an improvement, head out with it please).

> - you use pi_loadLL() before setting $this->conf

As mentioned already, I would be okay with just extending the tt_news 
language file instead of using the whole procedure.

> - preg_match("/SINGLE/", $obj->config['code']

Determines if its any single code, don't get what's bad about that?

> - $TSO = t3lib_div::makeInstance('t3lib_tsparser_ext'); $TSO =
> t3lib_div::makeInstance('t3lib_tsparser_ext');

Doh! Removed the double line, thanks again.

> In other words: this code is a big mess :(

Give proposals to improve it please! :)




More information about the TYPO3-dev mailing list