<?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>gouranga &#187; php</title>
	<atom:link href="http://www.gouranga.me/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gouranga.me</link>
	<description>ein wenig von fast allem</description>
	<lastBuildDate>Tue, 09 Mar 2010 19:15:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kostbare Software</title>
		<link>http://www.gouranga.me/2009/01/12/kostbare-software/</link>
		<comments>http://www.gouranga.me/2009/01/12/kostbare-software/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 23:29:27 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[opensearch]]></category>
		<category><![CDATA[opensourch]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[qucs]]></category>
		<category><![CDATA[shup]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.steffen-goertz.de/?p=403</guid>
		<description><![CDATA[Von Björn inspiriert hier mal eine Liste von toller Software die ich nicht missen möchte:
Basis

Firefox 3.0 &#8211; Sauber, schnell, einfach, sehr universell

Context Search &#8211; Mein Liebling! Integriert die Suchanbieter ins Contextmenu. So lassen sich markierte Wörter übersetzen (leo), nachschlagen (wikipedia, delicious), suchen (google).  Zweckentfremdet lassen sich so auch Youtube- oder Vimeo-Videos über eine eigenen OpenSearch-Suchanbieter [...]]]></description>
			<content:encoded><![CDATA[<p>Von <a href="http://www.bsnx.net/~bjoern/?page_id=97">Björn inspiriert</a> hier mal eine Liste von toller Software die ich nicht missen möchte:</p>
<p><strong>Basis</strong></p>
<ul>
<li>Firefox 3.0 &#8211; Sauber, schnell, einfach, sehr universell
<ul>
<li>Context Search &#8211; Mein Liebling! Integriert die Suchanbieter ins Contextmenu. So lassen sich markierte Wörter übersetzen (leo), nachschlagen (wikipedia, delicious), suchen (google).  Zweckentfremdet lassen sich so auch Youtube- oder Vimeo-Videos über eine <a href="http://www.searchplugins.net/generate.aspx">eigenen OpenSearch-Suchanbieter</a> via KeepVideo.com per Mausklick in AVI-Dateien umwandeln.</li>
<li>Delicious Bookmarks &#8211; Einfach alle Links vernünftig taggen, überall mithinnehmen und direkt per Shortcut Strg + B aufrufen  (Bookmarkleiste öffnen &#8211; Cursor springt auf Tagsuche &#8211; Tag eingeben, link mit Pfeiltasten auswählen, Enter, Seite lädt, Bookmarkleiste schließt)</li>
<li>Adblock Plus mit Cederics Liste + eigene Regeln &#8211; Wirkungsvoller Werbungs- und Trackingschutz</li>
<li>BugMeNot &#8211; Firefox Plugin zur BugMeNot-Logindaten-Datenbank</li>
</ul>
</li>
</ul>
<ul>
<li>Thunderbird mit Lightning und BirdieSync &#8211; Straight Forward Email- und Kalendarlösung.</li>
<li>Speedcommander &#8211; Mächtiger Dateimanager mit Automatisierungsfunktionen und diverser Protokollimplementationen(FTP, SFTP, DAV usw.)</li>
<li>Putty</li>
<li>VNC Viewer</li>
<li>IrfanView</li>
<li>UltraMon &#8211; Zeigt u.A. seperate Taskleisten für jeden Bildschirm an. Weitere sehr nützliche (und in Windows fehlende) Multi-Monitor-Funktionen.</li>
<li>ActiveSync</li>
<li>MPC für Videos und DVDs</li>
<li>Open Office</li>
<li>WinRAR</li>
<li>Foxit Reader (PDF Reader)</li>
<li>Winamp</li>
</ul>
<p><strong>Kommunikation</strong></p>
<ul>
<li>QIP &#8211; ICQ Client</li>
<li>mirC</li>
<li>Skype</li>
</ul>
<p><strong>Entwicklung</strong></p>
<ul>
<li>UltraEdit</li>
<li>Zend Studio for Eclipse</li>
<li>TopStyle Pro</li>
<li>VMware mit verschiedenen Rechnernetzen</li>
<li>DBDesigner in eigenem Build zum Datenbankdesign</li>
<li>PoEdit</li>
<li>Microsoft Visual Studio 2005 Pro &#8211; C# / C / C++</li>
<li>Adobe CS3</li>
<li>Tortoise Subversion</li>
<li>Firefox Plugins
<ul>
<li>FireBug</li>
<li>TamperData</li>
<li>Web Developer Toolbar</li>
</ul>
</li>
</ul>
<p><strong>Studium / Elektronik</strong></p>
<ul>
<li>QUCS</li>
<li>Matlab</li>
<li>Target 3001!</li>
<li>FunkyPlot</li>
<li>Open Office Math</li>
</ul>
<p><strong>Sonstiges, Praktisches, Nützliches</strong></p>
<ul>
<li>Perfect Disc &#8211; Defragmentierprogramm</li>
<li>µTorrent</li>
<li>Acronis True Image &#8211; Backup/Archivprogramm</li>
<li>MusicBrainz Picard</li>
<li>Album Art Downloader</li>
<li>Magic Disc &#8211; wie Daemon Tools nur mächtiger. Images umwandeln, verändern, erweitern usw.</li>
<li>Powertoys for Windows &#8211; Open Command Window Here</li>
<li>OpenVPN</li>
<li>Camtasia Studio</li>
<li>Shup</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2009/01/12/kostbare-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP I18n &amp; l10n</title>
		<link>http://www.gouranga.me/2008/05/09/cakephp-i18n-l10n/</link>
		<comments>http://www.gouranga.me/2008/05/09/cakephp-i18n-l10n/#comments</comments>
		<pubDate>Thu, 08 May 2008 22:51:37 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.steffen-goertz.de/?p=152</guid>
		<description><![CDATA[Internationalisierung von Internet-Anwendungen ist ein wichtiges Thema, auf das schon zu Beginn der Entwicklung ein Schwerpunkt gelegt werden sollte. Zwar ist nicht bei jeder Internetpräzens Internationalisierung notwendig, die Seiten sollte jedoch mindestens in Englischer Version vorliegen. Bei Internetanwendungen ist Internationalisierung absolut notwendig, möchte man nicht einen Großteil der potentiellen Nutzer ausschließen. Hier erfährst du, wie du deine CakePHP-Anwendung internationali- und lokalisierst.]]></description>
			<content:encoded><![CDATA[<p>Internationalisierung von Internet-Anwendungen ist ein wichtiges Thema, auf das schon zu Beginn der Entwicklung ein Schwerpunkt gelegt werden sollte. Zwar ist nicht bei jeder Internetpräzens Internationalisierung <em>notwendig,</em> die Seiten sollte jedoch mindestens in Englischer Version vorliegen. Bei Internetanwendungen ist Internationalisierung absolut notwendig, möchte man nicht einen Großteil der potentiellen Nutzer ausschließen. <span id="more-152"></span></p>
<p>Zuerst einmal sollten die zwei wichtigen Begriffe Internationalisierung und Lokalisierung geklärt werden.</p>
<p>Unter <strong>Internationalisierung </strong>(am. engl. <em>internationalization</em> Abk. <strong>i18n</strong>, wobei 18 für die 18 Buchstaben zwischen ersten und letztem Buchstaben steht) versteht man die technische Fähigkeit einer Anwendung, sich leicht in andere Sprachen/Sprachräume/Kulturen überführen zu lassen. Diesen Vorgang der Überführung an die lokalen Gegebenheiten nennt man <strong>Lokalisierung.</strong></p>
<p>Unter <strong>Lokalisierung </strong>(am. engl. <em>localization </em>Abk. <strong>l10n</strong>) verseht man die Überführung von Sprache, Zeit/Datumsstempel, Farben, Formatierungen usw. in einen anderen Sprachraum oder Kultur. Lokalisierung setzt (nicht zwingend) Internationalisierung vorraus.</p>
<p>Mit CakePHP 1.2 haben wir bereits ein weitesgehend internationalisiertes Werkzeug zur Hand. Alle Angaben beziehen sich auf CakePHP 1.2.0.6311.</p>
<h3>Struktur</h3>
<div class="inline">In eurem App-Ordner befindet sich bereits der Ordner <em>locale</em>. In diesem werden alle Lokalisationsdaten gespeichert. Da die I18n-Funktionen an GNU-gettext angelehnt sind wurde auch die Ordnerstruktur von gettext übernommen <em>(CakePHP implementiert die gettext-Funktionen übrings selbst, sodass keine gettext-Erweiterung installiert werden muss)</em>. In <em>locale</em> befinden sich die Ordner der verschiedenen Sprachen, abgekürzt durch den Sprachcode entsprechend <strong><a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">ISO-639-2</a></strong>. Es ist jeweils der Code für <strong>T</strong>erminology zu wählen. Für Deutsch wäre dies <em>deu</em>. In den Sprachordnern befinden sich die Ordner der jeweiligen <em><strong><a href="http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.nls/doc/nlsgdrf/locale_cat.htm">Locale Categorie</a></strong> (LC_*)</em>. Möglich sind</p>
<ul>
<li>LC_CTYPE</li>
<li>LC_NUMERIC</li>
<li>LC_TIME</li>
<li>LC_COLLATE</li>
<li>LC_MONETARY</li>
<li>LC_MESSAGES</li>
<li>LC_ALL</li>
</ul>
<p>.</p>
</div>
<p>In der Regel kommt man LC_MESSAGES aus. In nächster Zeit werden hoffentlich der TimeHelper und andere kritische Komponenten von CakePHP I18n. Dann könnten auch LC_TIME und der Rest eine Rolle spielen. Unterhalb der Categories befinden sich die Sprachdateien, wir werden sie als <strong>Domänen</strong> bezeichnen. Die <strong>Standard</strong>- und Fallback-Domäne ist <strong>default.mo</strong> bzw. <strong>default.po</strong>. Domänen werden im <strong>Portable-Object-Format</strong> <em>(.po)</em> bzw. in binärer Form im Maschine-Object-Format <em>(.mo)</em> gespeichert. Ich persönlich finde .mo&#8217;s unpraktisch, da sie das Editieren erschweren.</p>
<p>Der Pfad sieht also so aus: app/locale/{3-Stelliger-Sprachcode oder Dialekt wie de_at, de usw.}/{Kategoriename, LC_MESSAGES etc.}/{default.po, core.mo usw.}</p>
<p>Sie sind eher für Desktop-Anwendungen gedacht. Der Aufbau einer .po-Datei ist sehr simpel. Zunächst benötigt die Datei einen Header.</p>
<pre>msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=n==0?0:(n==1?1:2);\n"
"Project-Id-Version: 123 Projekt\n"
"Last-Translator: Steffen Görtz &lt;steffen.goertz@multicept.de&gt;\n"
"Language-Team: Multicept Gbr &lt;info@multicept.de&gt;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"</pre>
<p>Nach dem Header (der nicht zwingend vorhanden sein muss) folgen die Übersetzungen der einzelnen Strings</p>
<pre>msgid "untranslated-string"
msgstr "translated-string"</pre>
<p><em>(mehr Infos zum .po-Format gibt es in der offiziellen <a href="http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files">GNU-gettext Dokumentation</a>)</em></p>
<p>Besondere Bedeutung hat der Header &#8220;<a title="Pluralformen für verschiedene Sprachen" href="http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#Plural-forms">Plural-Forms</a>&#8220;. Er gibt an, wieviele Pluralformen in der Zielsprache vorkommen <span style="text-decoration: underline;"><em>können</em></span> und wann welche Form zu wählen ist. Im Beispiel (für Deutsch) folgt zuerst mit &#8220;<em>nplurals=%d</em>;&#8221; die Anzahl der  <a title="Pluralformen für verschiedene Sprachen" href="http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#Plural-forms">Pluralformen</a> in der zu übersetzenden Sprache, hier 2. Danach folgt ein C-Ausdruck in Abhängigkeit von n, dessen Ergebnis bestimmt, welcher Plural in Frage kommt.</p>
<p>An dieser Stelle sei leider gesagt, dass CakePHP in der aktuellen Version keinen validen Automaten implementiert, der jeden möglichen Ausdruck auswerten kann. Es können daher nur bestimmte Ausdrucke verwertet werden; zumindest ein paar die sich auf der <em><a href="http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files">GNU-gettext Dokumentation</a> </em>befinden. Ich habe bereits ein <a href="https://trac.cakephp.org/ticket/4607">Ticket </a>eröffnet, mal sehen wie Gwoo und Co. reagieren werden.</p>
<p>Die Plurale werden in der .po-Datei so angelegt</p>
<pre>msgid "Kommentar"
msgid_plural "%d Kommentare"
msgstr[0] "Keine Kommentare"
msgstr[1] "Ein Kommentar"
msgstr[2] "%d Kommentare"</pre>
<p>Die .po-Dateien lassen sich per Hand oder komfortabler mit freien Werkzeugen, wie etwa <a href="http://www.poedit.net/download.php">poEdit</a>, bearbeiten.</p>
<p>Es lassen sich beliebig viele Domänen anlegen und verwalten. In der Regel wird man mit einer auskommen, es sein denn man hat Komponenten mit sehr vielen Übersetzungen. In diesem Fall sollte man über eine Domäne nur für diese Komponente nachdenken.</p>
<h3>CakePHP I18n Funktionen</h3>
<p>Wie bereits gesagt kommt CakePHP mit allen benötigten Werkzeugen frei Haus. Folgende Funktionen sind überall verfügbar<em> (werden in basics.php definiert)</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Returns a translated string if one is found, or the submitted message if not found.
*
* @param string $singular Text to translate
* @param boolean $return Set to true to return translated string, or false to echo
* @return mixed translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __<span style="color: #009900;">&#40;</span><span style="color: #000088;">$singular</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></div></div>

<p>Die simpelste Funktion. Es werden lediglich Singulare unterstützt.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Returns correct plural form of message identified by $singular and $plural for count $count.
* Some languages have more than one form for plural messages dependent on the count.
*
* @param string $singular Singular text to translate
* @param string $plural Plural text
* @param integer $count Count
* @param boolean $return true to return, false to echo
* @return mixed plural form of translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __n<span style="color: #009900;">&#40;</span><span style="color: #000088;">$singular</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plural</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></div></div>

<p>Mit <em>__n(&#8230;)</em> können Ausdrücke wie <em>Keine Kommentare, Ein Kommentar, x Kommentare</em> übersetzt werden. Anhand von $n wird die richtige Form ausgewählt.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Allows you to override the current domain for a single message lookup.
*
* @param string $domain Domain
* @param string $msg String to translate
* @param string $return true to return, false to echo
* @return translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __d<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></div></div>

<p>Holt eine einfache Nachricht aus einer anderen Domäne als der derzeitg gewählten. Sowas ist für Komponenten nützlich.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Allows you to override the current domain for a single plural message lookup
* Returns correct plural form of message identified by $singular and $plural for count $count
* from domain $domain
*
* @param string $domain Domain
* @param string $singular Singular string to translate
* @param string $plural Plural
* @param integer $count Count
* @param boolean $return true to return, false to echo
* @return plural form of translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __dn<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$singular</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plural</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Plurale Übersetzung für andere Domäne.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Allows you to override the current domain for a single message lookup.
* It also allows you to specify a category.
*
* The category argument allows a specific category of the locale settings to be used for fetching a message.
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
*
* Note that the category must be specified with a numeric value, instead of the constant name.  The values are:
* LC_CTYPE     0
* LC_NUMERIC   1
* LC_TIME      2
* LC_COLLATE   3
* LC_MONETARY  4
* LC_MESSAGES  5
* LC_ALL       6
*
* @param string $domain Domain
* @param string $msg Message to translate
* @param integer $category Category
* @param boolean $return true to return, false to echo
* @return translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __dc<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Singulare Übersetzung einer anderen Domäne und Kategorie</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Allows you to override the current domain for a single plural message lookup.
* It also allows you to specify a category.
* Returns correct plural form of message identified by $singular and $plural for count $count
* from domain $domain
*
* The category argument allows a specific category of the locale settings to be used for fetching a message.
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
*
* Note that the category must be specified with a numeric value, instead of the constant name.  The values are:
* LC_CTYPE     0
* LC_NUMERIC   1
* LC_TIME      2
* LC_COLLATE   3
* LC_MONETARY  4
* LC_MESSAGES  5
* LC_ALL       6
*
* @param string $domain Domain
* @param string $singular Singular string to translate
* @param string $plural Plural
* @param integer $count Count
* @param integer $category Category
* @param boolean $return true to return, false to echo
* @return plural form of translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __dcn<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$singular</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plural</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Plurale Übersetzung einer anderen Domäne und Kategorie.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* The category argument allows a specific category of the locale settings to be used for fetching a message.
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
*
* Note that the category must be specified with a numeric value, instead of the constant name.  The values are:
* LC_CTYPE     0
* LC_NUMERIC   1
* LC_TIME      2
* LC_COLLATE   3
* LC_MONETARY  4
* LC_MESSAGES  5
* LC_ALL       6
*
* @param string $msg String to translate
* @param integer $category Category
* @param string $return true to return, false to echo
* @return translated string if $return is false string will be echoed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __c<span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Singulare Übersetzung einer anderen Kategorie</p>
<h3>Sprachen konfigurieren und I18n einsetzen</h3>
<p>Zunächst sollte man die Standardsprache seiner Anwendung einstellen. Hierzu definieren die Konstante <em>DEFAULT_LANGUAGE</em> in unserer App-Config.</p>
<p><strong>app/config/bootstrap.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* SVN FILE: $Id: bootstrap.php 6311 2008-01-02 06:33:52Z phpnut $ */</span>
<span style="color: #009933; font-style: italic;">/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) :  Rapid Development Framework
* Copyright 2005-2008, Cake Software Foundation, Inc.
*								1785 E. Sahara Avenue, Suite 490-204
*								Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright		Copyright 2005-2008, Cake Software Foundation, Inc.
* @link				http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package			cake
* @subpackage		cake.app.config
* @since			CakePHP(tm) v 0.10.8.2117
* @version			$Revision: 6311 $
* @modifiedby		$LastChangedBy: phpnut $
* @lastmodified	$Date: 2008-01-02 00:33:52 -0600 (Wed, 02 Jan 2008) $
* @license			http://www.opensource.org/licenses/mit-license.php The MIT License
*/</span>
<span style="color: #009933; font-style: italic;">/**
*
* This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
* This is an application wide file to load any function that is not used within a class define.
* You can also use this to include or require any files in your application.
*
*/</span>
<span style="color: #009933; font-style: italic;">/**
* The settings below can be used to set additional paths to models, views and controllers.
* This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
* $modelPaths = array('full path to models', 'second full path to models', 'etc...');
* $viewPaths = array('this path to views', 'second full path to views', 'etc...');
* $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
*
*/</span>
Configure<span style="color: #339933;">::</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'testapp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//EOF</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p><strong>app/config/testapp.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Spracheinstellungen</span>
<span style="color: #666666; font-style: italic;"># Standardsprache
</span><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DEFAULT_LANGUAGE'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'deu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;"># Sprache erzwingen
</span>
<span style="color: #666666; font-style: italic;">#Configure::write('Config.language','de');
</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'myapp'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Configure<span style="color: #339933;">::</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'myapp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">....</span></pre></div></div>

<p>Zunächst definieren wir unsere Standardsprache in 3-Stellen-Notation. Diese wird ausgewählt, wenn die bevorzugte Sprache des Benutzers nicht über HTTP_ACCEPT_LANGUAGE festgestellt werden kann <span style="text-decoration: underline;">oder</span> keine dieser Sprachen verfügbar ist. Danach können wir eine Sprache erzwingen. Diese Funktion kann man nutzen, wenn man ein Menu mit Sprachauswahl erstellen möchte. Soll eine ausgewählte Sprache dauerhaft erhalten bleiben kann man diese als Sessionvariable <em>Config.language</em> speichern.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  MyController <span style="color: #000000; font-weight: bold;">extends</span> AppController  <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">function</span> setLanguage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;;</span>Session<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Config.language'</span><span style="color: #339933;">,</span><span style="color: #000088;">$lang</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Viel Spaß beim ausprobieren!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2008/05/09/cakephp-i18n-l10n/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Neue Last.fm Post Ext Version</title>
		<link>http://www.gouranga.me/2008/05/05/neue-lastfm-post-ext-version/</link>
		<comments>http://www.gouranga.me/2008/05/05/neue-lastfm-post-ext-version/#comments</comments>
		<pubDate>Mon, 05 May 2008 14:34:26 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.steffen-goertz.de/?p=145</guid>
		<description><![CDATA[Gibt ne neue Last.fm Post Ext Version, nachdem mich Fabian dazu angeregt hat einen Check der PHP Umgebung einzubauen, damit der Nutzer auf bestehende Probleme hingewiesen wird und sich nicht darüber wundern muss, warum das Plugin nicht funktioniert. Überprüft wird, ob der HTTP Wrapper aktiviert ist und ob SimpleXML verfügbar ist. Die neue Version steht [...]]]></description>
			<content:encoded><![CDATA[<p>Gibt ne neue Last.fm Post Ext Version, nachdem mich <a href="http://blog.musicjunkie.de/">Fabian</a> dazu angeregt hat einen Check der PHP Umgebung einzubauen, damit der Nutzer auf bestehende Probleme hingewiesen wird und sich nicht darüber wundern muss, warum das Plugin nicht funktioniert. Überprüft wird, ob der HTTP Wrapper aktiviert ist und ob SimpleXML verfügbar ist. Die neue Version steht euch ganz normal über das <a href="http://wordpress.org/extend/plugins/lastfm-post-extension/">Wordpress.org Plugin Repository</a> zur Verfügung.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2008/05/05/neue-lastfm-post-ext-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lastfm Post Extension</title>
		<link>http://www.gouranga.me/2008/04/18/lastfm-post-extension/</link>
		<comments>http://www.gouranga.me/2008/04/18/lastfm-post-extension/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 09:43:43 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.steffen-goertz.de/?p=94</guid>
		<description><![CDATA[Woha Guys,
its me &#8211; back to buisness again. Today i serve you my new Lastfm Post Extension for Wordpress. It enables your Blog to automagically get the Song you listened to while posting your Stuff. If some Wolfmother Track is shown above, than it works like it should   You do not need to [...]]]></description>
			<content:encoded><![CDATA[<p>Woha Guys,</p>
<p>its me &#8211; back to buisness again. Today i serve you my new Lastfm Post Extension for Wordpress. It enables your Blog to automagically get the Song you listened to while posting your Stuff. If some Wolfmother Track is shown above, than it works like it should <img src='http://www.gouranga.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You do not need to enter your Last.fm Password, all we want and need is your Username (or a Username of any Lastfm User)</p>
<h3>Requirements</h3>
<p>Unfortunaly i&#8217;m a lazy guy. So there is no PHP4 support since it uses the SimpleXML Class, which is only included in PHP5. But PHP4 is obsolete anyway, so this is a good opportunity to get rid of it.</p>
<h2>Installation Guide</h2>
<ul>
<li>Go and get a fresh copy from <a href="http://wordpress.org/extend/plugins/lastfm-post-extension/">Wordpress.org Plugins Repository</a></li>
<li>Unpack the archive and follow the installation guidance included</li>
<li>If you like it, leave me a short comment or write a post about your new toys <img src='http://www.gouranga.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2008/04/18/lastfm-post-extension/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Shup Wordpress Plugin</title>
		<link>http://www.gouranga.me/2008/03/27/shup-wordpress-plugin/</link>
		<comments>http://www.gouranga.me/2008/03/27/shup-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 00:43:06 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.steffen-goertz.de/?p=20</guid>
		<description><![CDATA[Since Shup and Wordpress concerns many Users worldwide i&#8217;ll write this post in english.
Idea and Development
As i already mentioned in my earlier posting about Shup i was working on an  integration to bring Shup and Wordpress working together. The Plugin is essentially a bridge between Shup and Wordpress. It&#8217;s not integrated in Wordpress or [...]]]></description>
			<content:encoded><![CDATA[<p>Since Shup and Wordpress concerns many Users worldwide i&#8217;ll write this post in english.</p>
<h3>Idea and Development</h3>
<p>As i already mentioned in <a href="http://www.steffen-goertz.de/?p=16">my earlier posting about Shup</a> i was working on an  integration to bring Shup and Wordpress working together. The Plugin is essentially a bridge between Shup and Wordpress. It&#8217;s not integrated in Wordpress or Shup. But it glues the interfaces of both programms together. I started with the custom_uploader_example.phps which is shipped with Shup since it is the only way to write something Shup can interact with. Then i had three ideas to interact with Wordpress:</p>
<ol>
<li>Copy a new Image directly to Wordpress&#8217;es  Content Dir
<ol>
<li>The Problem is that a Image might do not pass Wordpress rules and will not be accepted or shown in the Writing View</li>
<li>Operating in an alien softwares directorys is not an good idea at all</li>
</ol>
</li>
<li>Using Wordpress Library Function wp_upload_image
<ol>
<li>Might be better because we are using an interface for what we plan to do</li>
<li>Internal APIs change from revision to revision</li>
</ol>
</li>
</ol>
<p>And finally 3. Using Wordpress XML Interface</p>
<p>Using an external api is a good idea because it is a fixed implementation and will not change as long as the interface is widespread used. Wordpress supports the <a href="http://www.xmlrpc.com/metaWeblogApi#metaweblognewmediaobject">metaWeblog.newMediaObject  </a>Method which perfectly matches our conception.</p>
<p>All to do was to receive an image via http post, read its content and send it to Wordpress as an newMediaObject.</p>
<h3> Download and Setup</h3>
<ul>
<li>First of all get a copy of the current version at <a href="http://www.steffen-goertz.de/wp-content/uploads/2008/03/shup.phps" title="shup.phps">shup.php.</a></li>
<li>Open  it and modfiy <strong>username, password</strong> and <strong>wordpressUsername, wordpressPassword</strong>
<ul>
<li>Username &amp; Password are used for identify your Shup Client</li>
<li>wordpressUsername &amp; wordpressPassword are your Wordpress Login Information</li>
</ul>
</li>
<li><a href="http://www.steffen-goertz.de/?attachment_id=22" rel="attachment wp-att-22" title="shup-preferences.png"><img src="http://www.steffen-goertz.de/wp-content/uploads/2008/03/shup-preferences.thumbnail.png" alt="shup-preferences.png" align="right" /></a>Upload shup.php to your Wordpress Root Directory to shup/shup.php</li>
<li>Open Shup and go to File -&gt; Preferences -&gt; File Uploading &amp; Network</li>
<li>Doubleclick Custom-Uploader</li>
<li><a href="http://www.steffen-goertz.de/?attachment_id=23" rel="attachment wp-att-23" title="shup-custom-uploader-configuration.jpg"><img src="http://www.steffen-goertz.de/wp-content/uploads/2008/03/shup-custom-uploader-configuration.thumbnail.jpg" alt="shup-custom-uploader-configuration.jpg" align="right" /></a>Select &#8220;Add new Profile&#8221; and populate the fields like shown in the screenshot. Click Save Changes and activate the profile as active profil.</li>
<li>Close the Dialog.</li>
<li>I recommend to disabled shup.com url tagification unless you know what it is and would like to use it</li>
<li>Have fun populating your blog with a bunch of photos <img src='http://www.gouranga.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2008/03/27/shup-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
