Zum Inhalt springen

Content wechselt nicht für die entsprechende Sprache

Erstellt am 27. Juni 2003 · 1 Antwort · letzte Antwort am 28. Juni 2003

Tags: Frage

manfredo ·

Hallo,

meine Website soll 3 Sprachen beinhalten und zwar Deutsch als Standard, Englisch und Spanisch.

Die Flaggen erscheinen auch in meinem Menue und je nach vorhandenen Inhalt in grau oder farbig, so weit gut. Leider wechselt typo3 den entsprechen Inhalt nicht aus bzw. zeigt diesen nicht an. Die UID der jeweiligen Sprache wird korrekt übergeben.

Unter dem Menuepunkt DAS PROJEKT sind alle Sprachen vorhanden.

Außerdem wechselt der rote Pfeil bei mir nicht, könnte mir vorstellen das einfach nicht auf die gewählte Sprache gewechselt wird.

Zur besseren Übersicht:

meine my_languagemenu.php

 // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language.
$query = "SELECT * FROM pages_language_overlay WHERE pid=".$GLOBALS["TSFE"]->id.$GLOBALS["TSFE"]->sys_page->enableFields("pages_language_overlay")." GROUP BY sys_language_uid";

$res = mysql(TYPO3_db,$query);
$langArr=array();
while($row=mysql_fetch_assoc($res))	{
	$langArr[$row["sys_language_uid"]]=$row["title"];
}

// Little red arrow, which is inserted to the left of the flag-icon if the TSFE->sys_language_uid equals the language uid (notice that 0=english, 1=danish and 2=german is SPECIFIC to this database, because these numbers refer to uid's of the table sys_language)
$pointer = '<img src="t3lib/gfx/content_client.gif" width="7" height="10" align=middle>';

// Set each icon. If the language is the current, red arrow is printed to the left. If the language is NOT found (represented by a pages_language_overlay record on this page), the icon is dimmed.
$flags = array();
$flags[] = ($GLOBALS["TSFE"]->sys_language_uid==0?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=0" target=_top><img src="fileadmin/shared_media/flag_de.gif" width="21" height="13" hspace=5 border="0"></a>';
$flags[] = ($GLOBALS["TSFE"]->sys_language_uid==1?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="fileadmin/shared_media/flag_uk'.($langArr[1]?"":"_d").'.gif" width="21" height="13" hspace=5 border="0"></a>';
$flags[] = ($GLOBALS["TSFE"]->sys_language_uid==2?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=2" target=_top><img src="fileadmin/shared_media/flag_es'.($langArr[2]?"":"_d").'.gif" width="21" height="13" hspace=5 border="0"></a>';

// Make the little menu. Notice, the menu does ONLY transfer the page-id and the "L" variable (which is also SPECIFIC for this website because "L" has been used in the extension template used to control the language setup)
$content = '<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=clear.gif width=30 height=1></td><td>'.implode("",$flags).'</td></tr></table>';

?>

mein Template / Setup

# *** links
config.linkVars = L

# *** language
#Standard language
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE

#German language, sys_language.uid = 0
[globalVAr = GP:L = 0]
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE
[global]

#Englisch language, sys_language.uid = 1
[globalVAr = GP:L = 1]
config.sys_language_uid = 1
config.language = uk
config.locale_all = uk_UK
[global]

#Spanisch language, sys_language.uid = 2
[globalVAr = GP:L = 2]
config.sys_language_uid = 2
config.language = es
config.locale_all = es_ES
[global]


# *** Language
temp.sprache = PHP_SCRIPT
temp.sprache {
                      file = fileadmin/scripts/kb_languagemenu.php
                     }


# *** content
temp.KBcontent = COA
temp.KBcontent {
                        10 = HTML
	        10.value = <table width="100%" align="left" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td>
                        20 < styles.content.get
      	        30 < styles.content.getRight
	        30.stdWrap.required = 1
	        30.stdWrap.wrap = </td><td><img src="fileadmin/shared_media/pixel.gif" border="0" width="10" height="1" alt="" /></td><td> |
	        40 = HTML
	        40.value = </td></tr></table>                       
                        }


# *** Page Content
temp.kbPage = TEMPLATE
temp.kbPage {
	      template = FILE
	      template.file = fileadmin/shared_html/t3.kb.tmpl
	      workOnSubpart = DOKUMENT
                      # marks.HEAD_IMAGE < temp.HeadImg
                      marks.MENU_LANG < temp.sprache
	      marks.MENU_TOP < temp.MenuTop
	      marks.MENU_LEFT < temp.MenuLeft
                      marks.KB_CONTENT < temp.KBcontent
                    }


#
# *** page definitions
page = PAGE
page.typeNum = 0

#
# *** body tag
page.bodyTag = <body bgcolor="{$kbCOL_bgpage}" leftmargin=0 topmargin=0 marginheight="0" marginwidth="0">
page.stylesheet = fileadmin/shared_html/kbglobal.css
page.10 = CONTENT
page.10 < temp.kbPage

Im Root mit List habe ich die entsprechen Sprachversion angelegt:
ES für Spanisch
UK für Englisch

Bild: test.issw.de/sprachversion.gif

Auf der Seite DAS PROJEKT habe ich die entsprechenden Seiten und Inhalte erstellt.

Bild: test.issw.de/seiteninhalt.gif

Eigentlich müsste alles stimmen, aber wie gesagt typo3 zeigt mir keinen Inhalt der ausgwählten Sprache an. Ich habe schon alle Einträge hier im Forum durch gelesen aber ich finde den Fehler nicht.

Vielleicht sieht ja einer von euch meinen Fehler in der Geschichte.

schon mal danke!

manfredo

manfredo ·

hi,

Ja, ja da hat man schon eine Brille und man sieht trotzdem nichts!

Wie so oft lag es an einem Tippfehler im Setup und zwar habe ich globalVAr geschrieben.

Richtig wäre ja:

# German language, sys_language.uid = 0
[globalVar = GP:L = 0]
config.sys_language_uid = 0

Da ich das für jede Sprache kopiert hatte konnte ja nichts gehen. Man wieder ein paar Stunden den Bach runter.

tschau
manfredo