Actions
Feature #36514
closedTranslation of backendlayouts
Start date:
2012-04-24
Due date:
% Done:
0%
Estimated time:
PHP Version:
5.3
Tags:
Complexity:
easy
Sprint Focus:
Description
currently the title of a backend layout is not translatable but this is needed for multilingual pages (and editors).
A simple solution would be to use a hook
ext_tables.php
* Make backend-layout selector multilanguage aware
*/
t3lib_div::requireOnce(t3lib_extMgm::extPath($_EXTKEY) . 'Classes/Hooks/ItemsProcFunc.php');
$GLOBALS['TCA']['backend_layout']['ctrl']['label_alt_force'] = 1;
$GLOBALS['TCA']['backend_layout']['ctrl']['label_userFunc'] = 'Tx_Modernpackage_Hooks_ItemsProcFunc->getLabel';
Classes/Hooks/ItemsProcFunc.php
<?php
/***************************************************************
* Copyright notice
*
* (c) 2012 Georg Ringer <typo3@ringerge.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* ItemsProcFunc to make backend_layout fields
* multilanguage aware if the name starts with 'LLL:'
*
* @package TYPO3
* @subpackage tx_modernpackage
*/
class Tx_Modernpackage_Hooks_ItemsProcFunc {
/**
* Labels of a be_layout record
*
* @param array $params
* @return void
*/
public function getLabel(array &$params) {
if (t3lib_div::isFirstPartOfStr($params['row']['title'], 'LLL:')) {
$params['title'] = $GLOBALS['LANG']->sL($params['row']['title'], TRUE);
} else {
$params['title'] = $params['row']['title'];
}
}
}
?>
Updated by Gerrit Code Review about 12 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13815
Updated by Helmut Hummel about 12 years ago
- Status changed from Under Review to Rejected
RTFM :-P
PageTSConfig:TCEFORM.pages.backend_layout.altLabels.1 = LLL:fileadmin/fo.xml:fo
While 1 is the uid of the backend layout. So no need to hack the TCA for that.
Actions