[Typo3-dev] $LANG is always NULL
Franz Holzinger
franz at fholzinger.com
Fri Aug 5 08:29:43 CEST 2005
Hello Brian,
> I had the same thing you did, and posted about an empty admin panel. Screwy things happen when you try to use $LANG from the front-end.
>
> $LANG is a backend-only object. You can't use it in the front-end.
>
> It's not completely clear in the 'Inside Typo3' document, that this is speaking to Backend only.
> http://typo3.org/documentation/document-library/doc_core_inside/How_to_acquire_label/
>
> I can't find the documentation on it, but you need to use the following lines:
>
> // This loads the locallang.php file located in EXT:ext_key/pi1/locallang.php
> $this->pi_loadLL();
>
> // Access labels through this function
> $label = $this->pi_getLL('missing_').$check;
>
> Example:
> http://typo3.org/documentation/document-library/form_extension_tut/class_user_test_pi1/?encryptionKey=&cHash=5aae6da5d0
>
Thanks for this info.
But I want to use the locallang file from another extension.
Unfortunately pi_loadLL() does not take any parameter (ext_key).
$label =
$LANG->sL('LLL:EXT:sr_feuser_register/pi1/locallang.php:missing_'.$check);
This shall be used in tt_products.
$this->langKey = $langKey =
strtoupper($TSFE->config['config']['language']); // TYPO3_languages
How can I use the language key $this->langKey to get the correct
language text for the item?
Franz
More information about the TYPO3-dev
mailing list