<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>typo3.schloebe.de &#187; Mehrsprachigkeit</title>
	<atom:link href="http://typo3.schloebe.de/kategorie/mehrsprachigkeit/feed/" rel="self" type="application/rss+xml" />
	<link>http://typo3.schloebe.de</link>
	<description>TYPO3, TypoScript, Erweiterungen, Tipps</description>
	<lastBuildDate>Sat, 13 Aug 2011 18:18:12 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Textbasiertes Sprachmen&#252;</title>
		<link>http://typo3.schloebe.de/typoscript/textbasiertes-sprachmenue/</link>
		<comments>http://typo3.schloebe.de/typoscript/textbasiertes-sprachmenue/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 12:33:01 +0000</pubDate>
		<dc:creator>Oliver Schlöbe</dc:creator>
				<category><![CDATA[Mehrsprachigkeit]]></category>
		<category><![CDATA[Tweaks]]></category>
		<category><![CDATA[TypoScript]]></category>
		<category><![CDATA[sprachmenu]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://typo3.schloebe.de/typoscript/textbasiertes-sprachmenue/</guid>
		<description><![CDATA[Gerade habe ich beim Entmotten ein textbasiertes Sprachmen&#252; entdeckt, das ich hier einfach mal ver&#246;ffentliche. Das Men&#252; kommt ohne Flaggen aus, wird per PHP generiert und l&#228;sst sich per Klick umschalten. Ist eine Seite in einer alternativen Sprache nicht verf&#252;gbar, wird der Men&#252;punkt ausgegraut. Ansonsten verh&#228;lt es sich wie ein normales Sprachmen&#252;, in diesem Fall [...]]]></description>
			<content:encoded><![CDATA[<p>Gerade habe ich beim Entmotten ein textbasiertes Sprachmen&#252; entdeckt, das ich hier einfach mal ver&#246;ffentliche. <span id="more-38"></span></p>
<p>Das Men&#252; kommt ohne Flaggen aus, wird per PHP generiert und l&#228;sst sich per Klick umschalten. Ist eine Seite in einer alternativen Sprache nicht verf&#252;gbar, wird der Men&#252;punkt ausgegraut. Ansonsten verh&#228;lt es sich wie ein normales Sprachmen&#252;, in diesem Fall eben nur ohne Flaggen.</p>
<p>In Aktion sieht das Men&#252; so aus (nat&#252;rlich in ein Design eingepasst; in der Rohfassung erzeugt es einfach nur die Links f&#252;r die Sprachen):</p>
<p>[inspic=47,fullscreen,148]</p>
<p><strong>Die PHP-Datei <em>sprachmenu.inc</em>:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error: No parent object present.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TYPO3_DB'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_SELECTquery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pages_language_overlay'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pid='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enableFields</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pages_language_overlay'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sys_language_uid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$langArr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TYPO3_DB'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sys_language_uid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$pointer</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$flags</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'index.php'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'index.php?'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$langstrings</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;L=1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;L=0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langstrings</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$langtext</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'de'</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$langtext</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'de'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;L=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_top&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$langtext</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;0&quot;</span> OR <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langstrings</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;L=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_top&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'ru'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'ru'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;0&quot;</span> OR <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$langvar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'de'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$langvar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ru'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$langvar</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$flags</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Per TypoScript kann das ganze dann so inkludiert werden:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span> = PHP_SCRIPT
page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span>.<span style="color: #006600;">file</span> = fileadmin<span style="color: #66cc66;">/</span>sprachmenu.<span style="color: #006600;">inc</span></pre></td></tr></table></div>

<p>Wirklich flexibel ist es nat&#252;rlich nicht, aber als Ansatz ist es vielleicht hilfreich f&#252;r den einen oder anderen.</p>
]]></content:encoded>
			<wfw:commentRss>http://typo3.schloebe.de/typoscript/textbasiertes-sprachmenue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimiertes Sprachmen&#252; &#8211; Reloaded</title>
		<link>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue-reloaded/</link>
		<comments>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue-reloaded/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 19:08:05 +0000</pubDate>
		<dc:creator>Oliver Schlöbe</dc:creator>
				<category><![CDATA[Mehrsprachigkeit]]></category>
		<category><![CDATA[Tweaks]]></category>
		<category><![CDATA[TypoScript]]></category>
		<category><![CDATA[flagge]]></category>
		<category><![CDATA[sprachmenu]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue-reloaded/</guid>
		<description><![CDATA[Ich habe heute mehrere Stunden damit zugebracht, ein von mir optimiertes Sprachmen&#252; anzupassen, um auch weitere Sprachen zu unterst&#252;tzen. Irgendwann war dann das Ma&#223; voll, denn die Anahl der Abfragen wurde ab einem gewissen Punkt zu viel. Also, nochmal rangesetzt und in die TSRef geschaut&#8230; mit den Infos dort war es mir dann m&#246;glich, ein [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe heute mehrere Stunden damit zugebracht, ein von mir <a href="http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue/" target="_blank">optimiertes Sprachmen&#252;</a> anzupassen, um auch weitere Sprachen zu unterst&#252;tzen. <span id="more-27"></span> Irgendwann war dann das Ma&#223; voll, denn die Anahl der Abfragen wurde ab einem gewissen Punkt zu viel. <img src='http://typo3.schloebe.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Also, nochmal rangesetzt und in die TSRef geschaut&#8230; mit den Infos dort war es mir dann m&#246;glich, ein eigenes neues, nur auf <strong>TypoScript basierendes</strong> Sprachmen&#252; zu erstellen. Das Ergebnis nun hier:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span> = HMENU
page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span> <span style="color: #66cc66;">&#123;</span>
  special = <span style="color: #0066CC;">language</span>
  special.<span style="color: #006600;">value</span> = <span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span>
  special.<span style="color: #006600;">normalWhenNoLanguage</span> = <span style="color: #cc66cc;">0</span>
  <span style="color: #cc66cc;">1</span> = GMENU
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">NO</span> <span style="color: #66cc66;">&#123;</span>
    XY = <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span>.<span style="color: #006600;">w</span><span style="color: #66cc66;">&#93;</span>+<span style="color: #cc66cc;">4</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span>.<span style="color: #006600;">h</span><span style="color: #66cc66;">&#93;</span>+<span style="color: #cc66cc;">4</span>
    backColor = white
    transparentColor = white
    transparentBackground = <span style="color: #cc66cc;">1</span>
    <span style="color: #cc66cc;">5</span> = IMAGE
    <span style="color: #cc66cc;">5</span>.<span style="color: #006600;">file</span> = uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_de.<span style="color: #006600;">gif</span> <span style="color: #66cc66;">||</span> uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_en.<span style="color: #006600;">gif</span> <span style="color: #66cc66;">||</span> uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_ru.<span style="color: #006600;">gif</span>
    <span style="color: #cc66cc;">5</span>.<span style="color: #006600;">offset</span> = <span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">2</span>
  <span style="color: #66cc66;">&#125;</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">ACT</span> <span style="color: #66cc66;">&lt;</span> page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span>.1.<span style="color: #006600;">NO</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">ACT</span> = <span style="color: #cc66cc;">1</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">ACT</span>.<span style="color: #006600;">backColor</span> = <span style="color: #808080; font-style: italic;">#9C9A9C</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">ACT</span>.<span style="color: #006600;">transparentBackground</span> = <span style="color: #cc66cc;">0</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF1</span> <span style="color: #66cc66;">&lt;</span> page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span>.1.<span style="color: #006600;">NO</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF1</span> = <span style="color: #cc66cc;">1</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF1</span>.5.<span style="color: #006600;">file</span> = uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_de_d.<span style="color: #006600;">gif</span> <span style="color: #66cc66;">||</span> uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_en_d.<span style="color: #006600;">gif</span> <span style="color: #66cc66;">||</span> uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>flag_ru_d.<span style="color: #006600;">gif</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF1</span>.<span style="color: #006600;">noLink</span> = <span style="color: #cc66cc;">1</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF2</span> <span style="color: #66cc66;">&lt;</span> page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span>.1.<span style="color: #006600;">USERDEF1</span>
  <span style="color: #cc66cc;">1</span>.<span style="color: #006600;">USERDEF2</span>.<span style="color: #006600;">backColor</span> = <span style="color: #808080; font-style: italic;">#9C9A9C</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Wer die Flaggen mit einem wei&#223;en 2 Pixel breiten Rahmen versehen will, &#228;ndert folgende Zeile</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">transparentBackground = <span style="color: #cc66cc;">1</span></pre></td></tr></table></div>

<p>in</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">transparentBackground = <span style="color: #cc66cc;">0</span></pre></td></tr></table></div>

<p>&#220;ber die Zeile</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>18
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #cc66cc;">1</span>.<span style="color: #006600;">ACT</span>.<span style="color: #006600;">backColor</span> = <span style="color: #808080; font-style: italic;">#9C9A9C</span></pre></td></tr></table></div>

<p>l&#228;sst sich einfach die Hintergrund-Markierungsfarbe angeben.</p>
<p>Wie man die Pfade zu den Flaggen angeben muss, sieht man zudem oben. Diese k&#246;nnen platziert werden wo man will.</p>
]]></content:encoded>
			<wfw:commentRss>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue-reloaded/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Russische/kyrillische Inhalte in TYPO3</title>
		<link>http://typo3.schloebe.de/mehrsprachigkeit/russische-kyrillische-inhalte-in-typo3/</link>
		<comments>http://typo3.schloebe.de/mehrsprachigkeit/russische-kyrillische-inhalte-in-typo3/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 10:57:05 +0000</pubDate>
		<dc:creator>Oliver Schlöbe</dc:creator>
				<category><![CDATA[Mehrsprachigkeit]]></category>
		<category><![CDATA[convert2utf8]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[russisch]]></category>
		<category><![CDATA[tt news]]></category>
		<category><![CDATA[typo3]]></category>
		<category><![CDATA[TypoScript]]></category>
		<category><![CDATA[utf 8]]></category>

		<guid isPermaLink="false">http://typo3.schloebe.de/mehrsprachigkeit/russischekyrillische-inhalte-in-typo3/</guid>
		<description><![CDATA[Bei gr&#246;&#223;eren internationalen Webseiten ist nicht immer der Standard gesetzt, dass die Schriftzeichen den europ&#228;ischen entsprechen. Will man russische Inhalte einpflegen, gilt es einige Vorbereitungen zu treffen. Dieser Artikel widmet sich einem groben &#220;berblick &#252;ber russische Schriftzeichen, Zeichencodierungen und ASCII-Code. Werden bei standardm&#228;&#223;iger Konfiguration von TYPO3 russische/kyrillische Zeichen eingegeben, wandelt TYPO3 diese in entsprechende ASCII-Codes [...]]]></description>
			<content:encoded><![CDATA[<p>Bei gr&#246;&#223;eren internationalen Webseiten ist nicht immer der Standard gesetzt, dass die Schriftzeichen den europ&#228;ischen entsprechen. <span id="more-21"></span> Will man russische Inhalte einpflegen, gilt es einige Vorbereitungen zu treffen. Dieser Artikel widmet sich einem groben &#220;berblick &#252;ber russische Schriftzeichen, Zeichencodierungen und ASCII-Code.</p>
<p>Werden bei standardm&#228;&#223;iger Konfiguration von TYPO3 russische/kyrillische Zeichen eingegeben, wandelt TYPO3 diese in entsprechende ASCII-Codes um. Das h&#228;ngt mit der Zeichencodierung zusammen, die standardm&#228;&#223;ig auf ISO steht.</p>
<p>Aus:</p>
<blockquote><p>Услуги и решения</p></blockquote>
<p>wird dann bspw:</p>
<blockquote><p>&#038;a1806;&#038;a1806;&#038;a1806;&#038;a1806;&#038;a1806;&#038;a1806;&#038;a180 6;</p></blockquote>
<p><small>(<strong>Hinweis:</strong> Ich verstehe kein russisch, wei&#223; also nicht, was ich geschrieben habe. <img src='http://typo3.schloebe.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</small></p>
<p>Nun also zur Konfiguration.</p>
<h1>Vorbereitungen der TYPO3-Konfiguration f&#252;r russische Schriftzeichen</h1>
<p>Standardm&#228;&#223;ig ist in TYPO3 ISO-Codierung eingestellt. Um kyrillische (z.B. russische) Schriftzeichen darzustellen, muss die Zeichencodierung auf UTF-8 umgestellt werden. Dies geschieht folgenderma&#223;en, auf zwei Wegen.</p>
<ol>
<li><strong>Install Tool</strong><br />In der Option <em>forceCharset</em> muss der Wert <em>utf-8</em> eingetragen werden.</li>
<li><strong>localconf.php</strong><br />In der localconf.php (/typo3/typo3conf/localconf.php) muss Folgendes hinzugef&#252;gt werden:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">$TYPO3_CONF_VARS<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'BE'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'forceCharset'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">&quot;utf-8&quot;</span>;</pre></td></tr></table></div>

</li>
</ol>
<p>Nun muss noch folgender Code im Haupttemplate-Setup eingef&#252;gt werden:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">page.<span style="color: #006600;">config</span>.<span style="color: #006600;">metaCharset</span> = utf-<span style="color: #cc66cc;">8</span>
page.<span style="color: #006600;">config</span>.<span style="color: #006600;">additionalHeaders</span> = Content-<span style="color: #0066CC;">Type</span>:<span style="color: #0066CC;">text</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">html</span>;charset=utf-<span style="color: #cc66cc;">8</span></pre></td></tr></table></div>

<p><strong>Hinweis:</strong> Haben Sie bereits deutsche Texte eingef&#252;gt, werden aufgrund dieser &#196;nderungen alle vorhandenen Umlaute als Fragezeichen/K&#228;stchen angezeigt. Dies r&#252;hrt daher, dass die Sonderzeichen (noch) nicht f&#252;r UTF-8 erstellt werden. Um diesem Umstand Abhilfe zu schaffen, greifen wir auf eine Erweiterung zur&#252;ck, um nicht alle Umlaute nachtr&#228;glich manuell umwandeln zu m&#252;ssen.</p>
<h1>Die Anzeige russischer Schriftzeichen</h1>
<p>Die Erweiterung hei&#223;t <a href="http://typo3.org/extensions/repository/view/convert2utf8/" target="_blank"><em>convert2utf8</em></a> und kann &#252;ber das Extension Repository heruntergeladen werden.</p>
<p><strong>Hinweis:</strong> Erstellen Sie ein Backup der Datenbank, bevor Sie die Extension ausf&#252;hren! Mit SSH-Zugang folgenderma&#223;en, um den Dump in das aktuelle Verzeichnis abzulegen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">mysqldump --opt -Q -h servername -u dbusername -p databasename <span style="color: #66cc66;">&gt;</span> backupname.<span style="color: #006600;">sql</span></pre></td></tr></table></div>

<p>Nach Eingabe des Datenbank-Passwortes wird der Dump direkt auf den Server geschrieben.</p>
<p>Zur&#252;ck zur Erweiterung: Ist sie installiert, l&#228;sst sie sich &#252;ber das Kontext(-popup-)men&#252; der root-Seite der Webseite aufrufen &#252;ber &#8220;Convert to UTF8&#8243;. Hat man im ersten Schritt alle zu konvertierenden Seiten ausgefw&#228;hlt, stellt man im zweiten Schritt einfach &#8220;ISO-8859-1 (Western Europe)&#8221; ein, denn das ist die Standardcodierung von TYPO3. Im finalen Schritt beginnt die Extension die Umwandlung.</p>
<p>Ist diese abgeschlossen, empfiehlt es sich den Seitenbaum neu zu laden und den <strong>FE-Cache zu l&#246;schen</strong>.</p>
<h1>Die erfolgreiche Umstellung auf UTF-8</h1>
<p>Im FE werden nun die vormals als Fragezeichen/K&#228;stchen dargestellten Umlaute wieder korrekt angezeigt. Im BE werden eingegebene russische Zeichen auch als solche gespeichert und angezeigt. Mission erfolgreich. <img src='http://typo3.schloebe.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Werden externe Templatedateien verwendet, die einfach inkludiert werden (z.B. von Extensions), m&#252;ssen diese ebenfalls in UTF-8 konvertiert werden. Dazu m&#252;ssen die Dateien einfach in einem Editor unter UTF-8 gespeichert werden.</p>
<h1>Sonderfall tt_news</h1>
<p>Da die Datenbank-Tabellen der <em>tt_news</em>-Erweiterung nicht zum System geh&#246;ren, werden diese leider nicht mit durch die Erweiterung <a href="http://typo3.org/extensions/repository/view/convert2utf8/" target="_blank"><em>convert2utf8</em></a> in UTF-8 umgewandelt. Daher muss man diese Tabelle manuell umwandeln. Allerdings gestaltet sich das mit den entsprechenden Mitteln auch recht problemlos.</p>
<p>Zun&#228;chst sollte man die tt_news-Tabelle exportieren. Das geht per Kommandozeile oder einfach mit phpMyAdmin. Hat man den Dump in einer .sql-Datei auf dem Server, l&#228;sst sich diese mit dem Kommandozeilen-Befehl <em>recode</em> in UTF-8 umwandeln:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">recode latin..<span style="color: #006600;">utf8</span> sql-dump-datei.<span style="color: #006600;">sql</span></pre></td></tr></table></div>

<p>Diese Datei kann dann wieder mit Zeichencodierung UTF-8 in die TYPO3-Datenbank importiert werden.</p>
<h1>Weiterf&#252;hrende Links</h1>
<p>Folgende Links verfolgen jeweils andere Wege, um das selbe wie hier Beschriebene zu erreichen. Hilfreich, falls dieser Artikel nicht zu einer L&#246;sung beitragen kann.</p>
<ul>
<li><a href="http://blog.stefan-macke.de/2006/11/28/konvertieren-einer-typo3-installation-nach-utf-8/" target="_blank">Konvertieren einer TYPO3-Installation zu UTF-8</a></li>
<li><a href="http://wiki.stefan-macke.de/doku.php/typo3:start#auf_utf-8" target="_blank">Migration TYPO3 auf UTF-8</a></li>
<li><a href="http://blog.dopefreshtight.de/artikel/von-iso-8859-1-zu-utf-8-in-php-und-mysql/" target="_blank">Von ISO-8859-1 zu UTF-8 in PHP und MySQL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://typo3.schloebe.de/mehrsprachigkeit/russische-kyrillische-inhalte-in-typo3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Optimiertes Sprachmen&#252;</title>
		<link>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue/</link>
		<comments>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 20:54:13 +0000</pubDate>
		<dc:creator>Oliver Schlöbe</dc:creator>
				<category><![CDATA[Mehrsprachigkeit]]></category>
		<category><![CDATA[Tweaks]]></category>
		<category><![CDATA[TypoScript]]></category>
		<category><![CDATA[flagge]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[sprachmenu]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue/</guid>
		<description><![CDATA[Veraltet! F&#252;r diesen Snippet gibt es eine bessere L&#246;sung. Per Klick gelangen Sie zum Artikel&#8230; Das Standard Typo3 Sprachmen&#252; kennen mittlerweile die meisten, die multilinguale Webseiten mit Typo3 bauen. Aus Erfahrung ist es aber bei vielen &#8211; meist computerfremden &#8211; Menschen so, dass das Standardmen&#252; noch verwirrt, denn alle Flaggen sind jederzeit klickbar. Viele verwirrt [...]]]></description>
			<content:encoded><![CDATA[<div class="veraltet"><a href="http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue-reloaded/"><strong>Veraltet!</strong> F&#252;r diesen Snippet gibt es eine bessere L&#246;sung. Per Klick gelangen Sie zum Artikel&#8230;</a></div>
<p>Das Standard Typo3 Sprachmen&#252; kennen mittlerweile die meisten, die multilinguale Webseiten mit Typo3 bauen. Aus Erfahrung ist es aber bei vielen &#8211; meist computerfremden &#8211; Menschen so, dass das Standardmen&#252; noch verwirrt, denn alle Flaggen sind jederzeit klickbar. Viele verwirrt das insofern, dass man nun nicht wei&#223;, ob eine Sprache &#8211; trotz Ausgrauen der Flagge &#8211; verf&#252;gbar ist oder nicht. <span id="more-10"></span></p>
<p>Meine kleinen Anpassungen f&#252;r das Sprachmen&#252; st&#252;tzen sich vor allem auf 2 Dinge: </p>
<ul>
<li>Die Flaggen der nicht-verf&#252;gbaren Sprachen sind <em>nicht</em> klickbar</li>
<li>Die aktive Sprache wird, anders als im Standardmen&#252; mit einem kleinen roten Pfeil, mit einer farblichen Hinterlegung markiert</li>
</ul>
<p>Die Tatsache, dass nicht verf&#252;gbare Sprach-Flaggen nicht nur ausgegraut, sondern auch nicht klickbar sind, vermeidet Verwirrung.</p>
<p>Hier der Code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error: No parent object present.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TYPO3_DB'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_SELECTquery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pages_language_overlay'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pid='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enableFields</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pages_language_overlay'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sys_language_uid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$langArr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TYPO3_DB'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>	<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sys_language_uid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$pointer</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$flags</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;img src=&quot;uploads/tf/flag_de.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px;background:#667DAB; position:relative; top: 5px;&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;img src=&quot;uploads/tf/flag_de.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px; position:relative; top: 5px;&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'index.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;L=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_top&quot;&gt;&lt;img src=&quot;uploads/tf/flag_de.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px; position:relative; top: 5px;&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">2</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;img src=&quot;uploads/tf/flag_en'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'_d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px;background:#667DAB; position:relative; top: 5px;&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">2</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;img src=&quot;uploads/tf/flag_en'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'_d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px; position:relative; top: 5px;&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$flags</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sys_language_uid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">2</span>?<span style="color: #000088;">$pointer</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'index.php?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TSFE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;L=2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_top&quot;&gt;&lt;img src=&quot;uploads/tf/flag_en'</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langArr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">''</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'_d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.gif&quot; width=&quot;20&quot; height=&quot;10&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;padding: 2px 2px 5px 2px; position:relative; top: 5px;&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$flags</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;nbsp;&amp;nbsp;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h1>Implementierung</h1>
<p>Dieser Code wird, zusammen mit den Flaggendateien, als <em>sprachmenu.inc</em> im uploads/tf/-Ordner gespeichert und mittels TypoScript &#252;ber einen Marker aufgerufen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">page = PAGE
&nbsp;
page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span> = PHP_SCRIPT
page.10.<span style="color: #006600;">marks</span>.<span style="color: #006600;">SPRACHE</span>.<span style="color: #006600;">file</span> = uploads<span style="color: #66cc66;">/</span>tf<span style="color: #66cc66;">/</span>sprachmenu.<span style="color: #006600;">inc</span></pre></td></tr></table></div>

<p><strong>Hinweis:</strong> Dieses Men&#252; bedient die Sprachen Deutsch und Englisch, kann aber beliebig erweitert werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://typo3.schloebe.de/typoscript/optimiertes-sprachmenue/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

