<?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>For Your Lungs Only &#187; javascript</title>
	<atom:link href="http://www.foryourlungsonly.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.foryourlungsonly.net</link>
	<description>Everything you wanted to know about web development, espresso, typography, nicotine, user interface design, whiskey, javascript, php, cascading style sheets, css hacks, beer, prototype, jquery, mysql, usability and accessiblity (but were afraid to ask)</description>
	<lastBuildDate>Mon, 14 Jun 2010 22:08:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP, Javascript and WordPress English to Spanish Language Translation Samples</title>
		<link>http://www.foryourlungsonly.net/2010/04/24/php-javascript-and-wordpress-english-to-spanish-language-translation-samples/</link>
		<comments>http://www.foryourlungsonly.net/2010/04/24/php-javascript-and-wordpress-english-to-spanish-language-translation-samples/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 03:13:16 +0000</pubDate>
		<dc:creator>Jonathan Harriot</dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[gnu gpl]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress plugins]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.foryourlungsonly.net/?p=117</guid>
		<description><![CDATA[First off, download the gTranslate PHP class and read about it. Now let&#8217;s start to play with it. Let&#8217;s start off simple: &#60;?php require("GTranslate.php"); try { $gt = new Gtranslate; echo "Translating [Hello World] from English to German =&#62; ".$gt-&#62;english_to_german("hello world")."&#60;br/&#62;"; echo "Translating [Ciao mondo] Italian to English =&#62; ".$gt-&#62;it_to_en("Ciao mondo")."&#60;br/&#62;"; } catch (GTranslateException $ge) [...]]]></description>
			<content:encoded><![CDATA[<p>First off, <a href="http://gtranslate-api-php.googlecode.com/files/gtranslate-api-php-0.7.5.zip">download the gTranslate PHP class</a> and <a href="http://code.google.com/p/gtranslate-api-php/">read about it</a>. Now let&#8217;s start to play with it.</p>
<p>Let&#8217;s start off simple:<span id="more-117"></span></p>
<pre><em>&lt;?php
require("GTranslate.php");
try {
	$gt = new Gtranslate;
	echo "Translating [Hello World] from English to German =&gt; ".$gt-&gt;english_to_german("hello world")."&lt;br/&gt;";
	echo "Translating [Ciao mondo] Italian to English =&gt; ".$gt-&gt;it_to_en("Ciao mondo")."&lt;br/&gt;";
} catch (GTranslateException $ge)  {
	echo $ge-&gt;getMessage();
}
?&gt;</em></pre>
<p><strong>Create a Function to Detect Language:</strong><br />
First Example for Ben&#8217;s Translator Plugin (Using a Session Variable):</p>
<pre><em>&lt;?php
function translateThis ($myText) {
	$pageURL = 'http';
	if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
		$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
		$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
	} else {
		$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	}
	//return $pageURL;
	$myVal = substr($pageURL, 0, 28);
	if ($myVal == "http://welovecakephp.com/es/") {
		$_SESSION['pLang'] = "ES";
	} else {
		$_SESSION['pLang'] = "EN";
	}
	if ($_SESSION['pLang'] == "ES") {
		require("GTranslate.php");
		/*
			these variable can be used in conjunction with JS dynamic content to make translated content easier
			ie: change image folders/forms/etc basically things that WordPress plugins might screw up
		*/
		$myLang = "es";
		$myLangDir = "/es";
		try {
			$gt = new Gtranslate;
			$gt-&gt;setRequestType('curl');
			echo $gt-&gt;en_to_es($myText);
		} catch (GTranslateException $ge) {
			echo $ge-&gt;getMessage();
		}
	} else {
		$myLang = "en";
		$myLangDir = "";
	}
}
?&gt;</em></pre>
<p><em>Second example (Using a Cookie):</em></p>
<pre><em>&lt;?php if ($_COOKIE['pLang'] != "English") { $_SESSION['pLang'] = "ES"; } else { $_SESSION['pLang'] = "EN"; }?&gt;</em></pre>
<p><strong>Sample Usage</strong></p>
<pre><em>&lt;?php
	$myVar = "This is a test of language translation, not word by word but instead this translates the intended meaning";
	translateThis($myVar);
?&gt;</em></pre>
<p>Of course you can change settings within this to suit your translation needs and this is a single use setup but it suited the purpose for which I needed it. I hope this helps you out, cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foryourlungsonly.net/2010/04/24/php-javascript-and-wordpress-english-to-spanish-language-translation-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slide N&#8217; Hide jQuery Navigation Accordion Slider</title>
		<link>http://www.foryourlungsonly.net/2008/11/12/slide-n-hide-jquery-navigation-accordion-slider/</link>
		<comments>http://www.foryourlungsonly.net/2008/11/12/slide-n-hide-jquery-navigation-accordion-slider/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 01:48:52 +0000</pubDate>
		<dc:creator>Jonathan Harriot</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[eff]]></category>
		<category><![CDATA[gnu gpl]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.foryourlungsonly.net/?p=37</guid>
		<description><![CDATA[View Example View Source Code A simple vertical jQuery accordion with much room for growth. In future version I would like to use a few additional lines of JS to create a cleaner structure but even if only as an example this is a good start. I made a horizontal accordion as well but all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.foryourlungsonly.net/experiments/slide_n_hide.php3">View Example</a><br />
<a href="http://foryourlungsonly.net/experiments/slide_n_hide.phps">View Source Code</a></p>
<p>A simple vertical jQuery accordion with much room for growth. In future version I would like to use a few additional lines of JS to create a cleaner structure but even if only as an example this is a good start. I made a horizontal accordion as well but all things will be made public in due time.</p>
<p>This script creates a cooking and remembers which section was last opened therefore making it a great homepage piece or miniature site navigation.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foryourlungsonly.net/2008/11/12/slide-n-hide-jquery-navigation-accordion-slider/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.247 seconds -->
<!-- Cached page served by WP-Cache -->
