Zum Inhalt springen

Label wird nicht in andere Sprache ausgegeben

Erstellt am 31. März 2011 · Noch keine Antworten

Tags: Frage

leibnitz ·

Hallo,

ich habe da ein kleines Problem.

Ich hab hier eine Extension und hier wollte ich ein neues Label hinzufügen.

ich hab ein

$markerArray['###LL_TYPEPLAN###'] = $this->pi_getLL('typeplan');

und ein

$typeplan = $this->pi_getLL('typeplan');

im Quelltext hinzugefügt.

In der locallang.xml haben ich die Daten folgendermaßen ergänzt:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
	<meta type="array">
		<type>module</type>
		<description>Language labels for plugin "tx_internslidingimages_pi1"</description>
	</meta>
	<data type="array">
		<languageKey index="default" type="array">
			<label index="addnote">Zur Merkliste hinzufügen</label>
			<label index="typeplan">Typenplan</label>
		</languageKey>
		<languageKey index="en" type="array">
			<label index="addnote">Add to my notes</label>
			<label index="typeplan">Typeplan</label>
		</languageKey>
		<languageKey index="fr" type="array">
			<label index="addnote">Add to my notes</label>
			<label index="typeplan">Type de régime</label>
		</languageKey>
		<languageKey index="nl" type="array">
			<label index="addnote">Add to my notes</label>
			<label index="typeplan">Plan Type</label>
		</languageKey>
		<languageKey index="dk" type="array">
			<label index="addnote">Add to my notes</label>
			<label index="typeplan">Plan Type</label>
		</languageKey>
	</data>
</T3locallang>

Im Template hab ich den Marker ###LL_TYPEPLAN### hinzugefügt.

Leider wird mir immer nur die default Sprache angezeigt.

Hab das Label mal in einer anderen Funktion eingebaut und dort funktionieren die verschiedenen Sprachen, nur in der Einzelansicht nicht.

Anbei mal das komplette Script, ich find einfach den Fehler nicht. vllt. kann mir ja jemand helfen.

Gruß Leibnitz

	/**
	 * Einzel-Ansicht
	 */
	function singleView($content, $conf) {
		$this->conf = $conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		
		$template = array();
		$template['template'] = $this->cObj->getSubpart($this->templateFile, "###TEMPLATE_SINGLE###");

		$markerArray = array();

		$uid = 0;
		if (is_numeric($this->piVars['showUid'])) {
			$uid = $this->piVars['showUid'];
		}
		else {
			return '';
		}
		$res = $this->pi_exec_query('tx_internslidingimages_items', 0, ' AND sys_language_uid="'.$GLOBALS['TSFE']->sys_language_uid.'"', ' AND uid="'.$uid.'"');
		
		// i18n
		$addNote = $this->pi_getLL('addnote');
		$typeplan = $this->pi_getLL('typeplan');
		
		$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
		
				// i18n
		$addNote = $this->pi_getLL('addnote');
		$typeplan = $this->pi_getLL('typeplan');
		
		// Zoom-Icon definieren
		$zoomIconConf = array();
		$zoomIconConf['file'] = $conf['icon_zoom'];
		$zoomIconConf['params'] = 'style="display:inline;"';
		
		$zoomIcon = $this->cObj->IMAGE($zoomIconConf);
		$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] .= '<script type="text/javascript">icon_zoom = \''.$zoomIcon.'\';</script>';
		
		// Vor/Zurueck Icons
		$leftIconConf = array();
		$leftIconConf['file'] = $conf['icon_left'];
		$rightIconConf = array();
		$rightIconConf['file'] = $conf['icon_right'];
		
		// Naechstes Bild
		$res = $this->pi_exec_query('tx_internslidingimages_items', 0, ' AND sorting > "'.$row['sorting'].'" AND sys_language_uid="'.$row['sys_language_uid'].'"', '', '', 'sorting asc');
		$next = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
		if (is_array($next) && count($next) > 0) {
			$markerArray['###ICON_RIGHT###'] = $this->pi_linkToPage($this->cObj->IMAGE($rightIconConf), $this->cObj->data['pid'], '', array($this->prefixId.'[showUid]' => $next['uid']));
		}
		else {
			$markerArray['###ICON_RIGHT###'] = '';
		}
		
		// Vorheriges Bild
		$res = $this->pi_exec_query('tx_internslidingimages_items', 0, ' AND sorting < "'.$row['sorting'].'" AND sys_language_uid="'.$row['sys_language_uid'].'"', '', '', 'sorting desc');
		$previous = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
		
		if (is_array($previous) && count($previous) > 0) {
			$markerArray['###ICON_LEFT###'] = $this->pi_linkToPage($this->cObj->IMAGE($leftIconConf), $this->cObj->data['pid'], '', array($this->prefixId.'[showUid]' => $previous['uid']));
		}
		else {
			$markerArray['###ICON_LEFT###'] = '';
		}
		
		// Image
		$imgConfig = array();
		$imgConfig['file'] = 'uploads/tx_internslidingimages/'.$row['image'];
		$imgConfig['file.']['maxW'] = $conf['single.']['img.']['maxW'] ? $conf['single.']['img.']['maxW'] : 350;
		$imgConfig['file.']['maxH'] = $conf['single.']['img.']['maxH'] ? $conf['single.']['img.']['maxH'] : 250;
		
		// Typenplan
		$typeplanConfig = array();
		$typeplanConfig['file'] = 'uploads/tx_internslidingimages/'.$row['typeplan'];
		
		$markerArray['###IMAGE###'] = $this->cObj->IMAGE($imgConfig);
		$markerArray['###TYPEPLAN###'] = $row['typeplan'];
		$markerArray['###TITLE###'] = $row['title'];
		$markerArray['###DESCRIPTION###'] = $row['description'];
		$markerArray['###LL_ADD_NOTE###'] = $this->pi_getLL('addnote');
		$markerArray['###LL_TYPEPLAN###'] = $this->pi_getLL('typeplan');

		
		// Hook
		// extKey: intern_slidingimages
		// prefixId: :tx_internslidingimages_pi1
		if (is_array ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processItems'])) {
			foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processItems'] as $classRef) {
				$hookObj = &t3lib_div::getUserObj($classRef,'hook_');
				if (method_exists($hookObj, 'addSingleMarkerItems')) {
					$hookObj->addSingleMarkerItems($markerArray, $row, $this);
				}
			}
		}
		
		return $this->cObj->substituteMarkerArrayCached($template['template'], $markerArray, $subpartArray);
	}