Zum Inhalt springen

One Tree Konzept

Erstellt am 2. Juni 2007 · 3 Antworten · letzte Antwort am 4. Juni 2007

Tags: Frage

webbi ·

Hallo Leute,

ich habe eine Seite in deutsch erstellt und möchte nun zusätzlich die Seite auch gerne derzeit in Englisch vielleicht später noch in einer dritten Sprache anbieten.

Ich habe mich für das one tree fits all Konzept entschieden und bereits als zweite Sprache English angelegt. Für einige Seiten habe ich auch schon die Übersetzung erstellt.

Was mir nun noch so garnicht klar ist, was muss ich als Code noch in mein Template packen ´damit die User zwischen den beiden Sprachen Deutsch=UID3 und Englisch=UID4 wählen können.

Hier mal mein TS Template

# Use CSS Styled Content!
#######################################


# Cache Control Headers (TYPO3 3.8.0)
#######################################
#config.sendCacheHeaders = 1


# XHTML DOCTYPE
#######################################
config.doctype = <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
config.htmlTag_setParams =  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"


# Externalize CSS and JS
#######################################
config.removeDefaultJS = external
config.inlineStyle2TempFile = 1


# Spam Protection for Email
#######################################
config {
spamProtectEmailAddresses = 2
spamProtectEmailAddresses_atSubst = (at)
}


# Send UTF-8 Notification Email Headers
#######################################
config.notification_email_charset = utf-8
config.notification_email_encoding = quoted-printable
config.notification_email_urlmode = all


# Simulate static pages (uncomment/comment to configure)
#######################################
#config.simulateStaticDocuments = 1
#config.simulateStaticDocuments_noTypeIfNoTitle = 1
# config.simulateStaticDocuments_addTitle = 30
# config.simulateStaticDocuments_pageTitleFirst = 1
# config.pageTitleFirst = 1
# config.simulateStaticDocuments_pEnc = base64 
# config.simulateStaticDocuments_pEnc = md5
# config.simulateStaticDocuments_pEnc_onlyP = cHash,L,print,L,fD[_FIELDLIST],fD[disable],fD[usergroup],tx_srfeuserregister_pi1[aC],
tx_srfeuserregister_pi1[cmd],tx_srfeuserregister_pi1[rU],tx_srfeuserregister_pi1[sFK],tx_ttnews[backPid], tx_ttnews[tt_news], tx_ttnews[pS], tx_ttnews[pL], tx_ttnews[arc], tx_ttnews[cat], tx_ttnews[pointer], tx_ttnews[swords]
# config.simulateStaticDocuments = PATH_INFO
# config.absRefPrefix = http:// www.mydomain.com/


# Setting up 'page' to be the default PAGE object (type=0)
#######################################
lib.stdheader.10.stdWrap.wrap = 
tt_content.stdWrap.dataWrap = <a name="{field:uid}"></a>
 
page = PAGE
page.typeNum = 0
config.xhtml_cleaning = all
config.disablePrefixComment = 1
config.pageTitleFirst = 1
page.includeCSS { 
   file1 = fileadmin/templates/zenlight2col/css/style.css
}
page.headerData.10 = TEXT
page.headerData.10.value (
	<style type="text/css" media="all">
	@import url(fileadmin/templates/zenlight2col/css/Menu.css);
	</style>
	<!--[if lte IE 6]>
	<style type="text/css">
	@import url(fileadmin/templates/zenlight2col/css/Menu4IE.css);
	BODY {BEHAVIOR: url("fileadmin/templates/zenlight2col/css/ADxMenu.htc")}
	</style>
	<![endif]-->
)
page.bodyTag = <body>
page.1 = TEMPLATE
page.1.marks.PAGE_UID = TEXT
page.1.marks.PAGE_UID.field = uid
page.1  {
   template = FILE
   template.file = fileadmin/templates/zenlight2col/template.html   
   workOnSubpart = DOCUMENT_BODY
   subparts.RNDIMG < temp.rndImageTop
   subparts.CONTENT_LEFT < styles.content.getLeft
   subparts.CONTENT_RIGHT < styles.content.getRight
   subparts.CONTENT_BORDER < styles.content.getBorder
   subparts.CONTENT < styles.content.get


# Top horizontal dropdown menu
#######################################
subparts.TOPNAV = HMENU
subparts.TOPNAV.special = directory
#subparts.TOPNAV.special = list
subparts.TOPNAV.special.value = 1
#subparts.TOPNAV.excludeUidList = 1,2,3
subparts.TOPNAV {
wrap = <div id="menu"> | </div>
entryLevel = 0
1 = TMENU
1 {
expAll=1
noBlur = 1
wrap = <ul id="menuList" class="adxm"> | </ul> 
NO {
wrapItemAndSub = <li> | </li> 
}
}
2 = TMENU
2 {
expAll=1
noBlur = 1
wrap = <ul class="subList"> | </ul> 
NO {
wrapItemAndSub = <li class="submenu"> | </li> 
}
}
3 = TMENU
3 {
expAll=1
noBlur = 1
wrap = <ul class="subList"> | </ul> 
NO {
wrapItemAndSub = <li class="submenu"> | </li> 
}
}
4 = TMENU
4 {
expAll=1
noBlur = 1
wrap = <ul class="subList"> | </ul> 
NO {
wrapItemAndSub = <li class="submenu"> | </li> 
}
}
}


# Vertical Navigation
#######################################
subparts.VERTNAV = HMENU 
subparts.VERTNAV.1 = TMENU
subparts.VERTNAV.special = directory 
subparts.VERTNAV.special.value = 1
#subparts.VERTNAV.special = list 
#subparts.VERTNAV.excludeUidList = 1,2,3
subparts.VERTNAV.1 {

# Normal state properties
#######################################
   NO.allWrap =  <div class="vertnav1"> | </div>

# Enable active state and set properties:
#######################################
   ACT = 1
   noBlur = 1
   ACT.allWrap = <div class="vertnav1-act"> | </div>
}


# Second level menu-object
#######################################
   subparts.VERTNAV.2 = TMENU
   subparts.VERTNAV.2 {

# Normal state properties
#######################################
   NO.allWrap =  <div class="vertnav2"> | </div>

# Enable active state and set properties:
#######################################
   ACT = 1
   noBlur = 1
   ACT.allWrap = <div class="vertnav2-act"> | </div>
}


# Third level menu-object
#######################################
   subparts.VERTNAV.3 = TMENU
   subparts.VERTNAV.3 {

# Normal state properties
#######################################
   NO.allWrap =  <div class="vertnav3"> | </div>

# Enable active state and set properties:
#######################################
   ACT = 1
   noBlur = 1
   ACT.allWrap = <div class="vertnav3-act"> | </div>
   }

# Fourth level menu-object
#######################################
   subparts.VERTNAV.4 = TMENU
   subparts.VERTNAV.4 {

# Normal state properties
#######################################
   NO.allWrap =  <div class="vertnav4"> | </div>

# Enable active state and set properties:
#######################################
   ACT = 1
   noBlur = 1
   ACT.allWrap = <div class="vertnav4-act"> | </div>   
}
}

# Bottom Navigation
#######################################
   subparts.BOTTOMNAV = HMENU
# subparts.BOTTOMNAV.special = directory
# subparts.BOTTOMNAV.special.value = 1
   subparts.BOTTOMNAV.1 = TMENU
   subparts.BOTTOMNAV.1 {
   NO.allWrap = |*| <span class="bottomnav"> | |</span> |*|
   ACT = 1
   noBlur = 1
   ACT.allWrap = |*| <span class="bottomnav"> | |</span> |*|
}


# Enabling the admin panel for the 'page' PAGE object:
#######################################
'page.config.admPanel=1


#PREVENTS EXISTING USERGROUPS BEING LOST IF A USER EDITS THEIR PROFILE
#######################################
plugin.feadmin.fe_users.edit.evalValues.usergroup = unsetEmpty


#ASSIGNS DEFAULT USERGROUP UID=1 TO ALL NEW USERS
#######################################
plugin.feadmin.fe_users.create.overrideValues.usergroup = 1


# Click to enlarge popup
#######################################
tt_content.image.20.1.imageLinkWrap {
JSwindow.expand = 0,0
bodyTag = <body style="margin: 0; background: #000000;">
title = Page Popup #default(Image)
}

tt_content.textpic.20.1 < tt_content.image.20.1

Der Vollständigkeit halber hier auch noch mein html Template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">

<!-- 
	Zenlight v1.0
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	(c) 2005 - Gregory D. Remington, www.mediatech.net
	Some rights reserved, http://creativecommons.org/licenses/by-sa/2.0/
-->

<head>
<title>Zenlight 2 columns</title>
</head>

	<!-- ###DOCUMENT_BODY### START-->

	<div id="container">
	<div id="header">
	</div>

	<div id="wrapper">

	<div id="main-content">  
	<!-- ###CONTENT### START-->
	<h2>- Title -</h2>
	<p>this is the where center content goes</p>
	<!-- ###CONTENT### END-->
	</div> 

	</div>

	<!-- end #wrapper -->

	<div id="left-content">

	<!--###VERTNAV### START-->
	<div class="vertnav1"><a href="#">Level 1 item</a></div>
	<div class="vertnav1-act"><a href="#">Level 1 item active</a></div>
	<div class="vertnav2"><a href="#">Level 2 item</a></div>
	<div class="vertnav2-act"><a href="#">Level 2 item active</a></div>
	<div class="vertnav3"><a href="#">Level 3 item</a></div>
	<div class="vertnav3-act"><a href="#">Level 3 item active</a></div>
	<!--###VERTNAV### STOP-->
	<br />
	<!-- ###CONTENT_LEFT### START-->
	<h2 align="justify">- Title -</h2>
      <p>this is the where left content goes</p>
	<!-- ###CONTENT_LEFT### END-->

	</div>

	<div id="footer">
C</div>
	
	<form action="index.php?id=#" method="post">
	<input type="hidden" name="logintype" value="login" />
	<input type="hidden" name="pid" value="#" />

	</form>

	<!-- end #container --> 
	</div>

	<!-- ###DOCUMENT_BODY### END-->
</body>
</html>

Die Umschaltung der Sprachen würde ich gerne mit Flaggensymbolen im Bereich Content Left realisieren.
Für Eure Hilfe schon mal recht heftigen Dank.

cope ·

Hallo Webbi,

gibt wohl viele Möglichkeiten...
z.B.

page.20 = TEXT
page.20.field = uid
page.20.wrap = <a href="index.php?id=|&L=4">Englisch</a>

[globalVar = GP:L=1]
page.20.wrap = <a href="index.php?id=|&L=3">Deutsch</a>
[global]

Da kannst Du ja auch die Flaggen mit "wrappen".

LG
Cope

webbi ·

Danke cope für die schnelle Antwort aber irgendwie bringt mich das alleine auch nicht weiter. Irgendwie will ebi dieser Mehrsprachigkeit einfach der Knoten bei mir nicht platzen. #angry# #angry# #angry# #angry#

LG

webbi

Fabian-K ·
############################
######### Sprache ##########
############################

# Standart
config.linkVars = L
config.sys_language_uid = 0
config.sys_language_overlay = hideNonTranslated
config.locale_all = de_DE.utf8
config.language = de
config.htmlTag_langKey = de


# Deutsch = 0
[globalVar = GP:L= 0]||[globalVar = GP:L= de]
  config.sys_language_uid = 0
  config.locale_all = de_DE.utf8
  config.language = de
  config.htmlTag_langKey = de
[global]


# English
[globalVar = GP:L = 2]||[globalVar = GP:L = en]
  config.sys_language_uid = 1
  config.locale_all = en_GB.utf8
  config.language = en
  config.htmlTag_langKey = en-US
[global]


temp.langMenu = PHP_SCRIPT
temp.langMenu.file = media/scripts/example_languageMenu.php
page.1.marks.DEIN_MARKER < temp.langMenu

So muesste es gehen.
(Letzte Zeile anpassen..)

Eventuell musste es noch etwas anpassen ("config.sys_language_uid" usw..) aber im Grunde war's das schon.
(Es seih denn, du verwendest TemplaVoila. Ich weiss nicht, ob s da so funktioniert, da die Inhalte anders gehandelt werden. Einfach ausprobieren..)

Hier meine Komplettsammlung:

############################
######### Sprache ##########
############################

# Standart
config.linkVars = L
config.sys_language_uid = 0
config.sys_language_overlay = hideNonTranslated
config.locale_all = de_DE.utf8
config.language = de
config.htmlTag_langKey = de
config.metaCharset = utf-8
config.additionalHeaders = Content-Type:text/html;charset=utf-8
config.doctype = xhtml_trans
config.xhtml_cleaning = all


# Deutsch = 0
[globalVar = GP:L= 0]||[globalVar = GP:L= de]
  config.sys_language_uid = 0
  config.locale_all = de_DE.utf8
  config.language = de
  config.htmlTag_langKey = de
  
  config.metaCharset = utf-8
  config.additionalHeaders = Content-Type:text/html;charset=utf-8
  
  config.doctype = xhtml_trans
  config.xhtml_cleaning = all
[global]


# English
[globalVar = GP:L = 2]||[globalVar = GP:L = en]
  config.sys_language_uid = 2
  config.locale_all = en_GB.utf8
  config.language = en
  config.htmlTag_langKey = en-US
  
  config.metaCharset = utf-8
  config.additionalHeaders = Content-Type:text/html;charset=utf-8
  
  config.doctype = xhtml_trans
  config.xhtml_cleaning = all
  
  lib.tellFriend.wrap = <a href="#" onclick='window.open("/index.php?id=85&L=2|" , "tip", "width=800,height=300,left=0,top=0,scrollbars=no,menubar=no, resizable=1");' class="META_link">Tell A Friend</a><span class="META_pipe">|</span>
  lib.tellFriend.1.wrap = &tipUrl=http://www.nigrin.de/index.php?L=2&id=|
  lib.toTop.value = <a href="#top" class="linkTopArrow">To the top of page</a>
[global]

mfg
Fabian