[TYPO3-dev] How to get language label for a custom table from plugin code?
Ricardo Scachetti Pereira
ricardo at tdwg.org
Fri Mar 10 19:23:12 CET 2006
Hi Tapio,
Sorry if I wasn't clear enough. Let me explain my case a little better.
I have a field called status in a custom table called
tdwg_standards. This field is defined in $TCA as having type select.
Here is its definition:
"status" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status",
"config" => Array (
"type" => "select",
"items" => Array (
Array("LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.0", "0",
t3lib_extMgm::extRelPath("tdwg")."selicon_tx_tdwg_standards_status_0.gif"),
Array("LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.1", "1",
t3lib_extMgm::extRelPath("tdwg")."selicon_tx_tdwg_standards_status_1.gif"),
Array("LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.2", "2",
t3lib_extMgm::extRelPath("tdwg")."selicon_tx_tdwg_standards_status_2.gif"),
Array("LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.3", "3",
t3lib_extMgm::extRelPath("tdwg")."selicon_tx_tdwg_standards_status_3.gif"),
Array("LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.4", "4",
t3lib_extMgm::extRelPath("tdwg")."selicon_tx_tdwg_standards_status_4.gif"),
),
"size" => 1,
"maxitems" => 1,
)
),
My question then is, how can I get the language label for the key
"LLL:EXT:tdwg/locallang_db.php:tx_tdwg_standards.status.I.0" inside a
plugin code?
There is a tslib_pibase::pi_getLL() function that gives back a
language label, but as I understand it, it is restricted to the labels
defined by the plugin.
Is the question a bit clearer now? I hope so.
Regards,
Ricardo
PS. While I was writing this reply I did another google search and found
this:
http://typo3.org/fileadmin/typo3api-3.8.0/d9/d7e/classlanguage.html. I
am probably looking for one of these functions: language::getLL() or
::getLLL(), right? Another question then is: how do I get an instance of
language class from my plugin code? Am I getting close?
Ricardo Scachetti Pereira wrote:
> Hello all,
>
> How can I get a set of language labels from a custom table from a
> plugin class function?
>
> More specifically, I'm coding a plugin and I'm trying to display
> the contents of a field that is select box (type select). The labels
> for each field valid value are defined on the LOCAL_LANG array in
> locallang_db.php file of my plugin.
>
> In other words, I wanted something equivalent to the function
> class.tslib_pibase::pi_getLL().
>
> Any help is greatly appreciated.
>
> Best regards,
>
> Ricardo
>
>
More information about the TYPO3-dev
mailing list