<?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>Codrops &#187; translation</title>
	<atom:link href="http://tympanus.net/codrops/tag/translation/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:30:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Easy PHP Site Translation</title>
		<link>http://tympanus.net/codrops/2009/12/30/easy-php-site-translation/</link>
		<comments>http://tympanus.net/codrops/2009/12/30/easy-php-site-translation/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 12:14:31 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=1059</guid>
		<description><![CDATA[Here&#8217;s an easy way to translate your web site using PHP. The idea is to have several files for each language you want to provide. Each one of these files have the name of the ISO code and the txt extension. For this demo I only use the german language as an alternative to the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-1062" title="PhpTranslate" src="http://tympanus.net/codrops/wp-content/uploads/2009/12/PhpTranslate1.png" alt="PhpTranslate" width="500" height="341" /></p>
<p>Here&#8217;s an easy way to translate your web site using PHP. The idea is to have several files for each language you want to provide. Each one of these files have the name of the ISO code and the txt extension. For this demo I only use the german language as an alternative to the default language of the site &#8211; english. The content of these files are the words / sentences with their translation in the form:</p>
<p>word=translation</p>
<p>The PHP class provided will parse this file, create an array which maps both word and it&#8217;s translation pair. You just need to insert the following in your php code :</p>
<pre class="brush:php">$translate = new Translator($outputlanguage);//$outputlanguage: ISO code (example: de,en,...) --&gt; these are the names of each file

$translate-&gt;__('word to translate');
</pre>
<p>An example:</p>
<pre class="brush:html">&lt;h2&gt;&lt;?php $translate-&gt;__('Registration'); ?&gt;&lt;/h2&gt;</pre>
<p>and in your de.txt file we would have:</p>
<p>Registration=Registrierung</p>
<p><a class="demo" href="http://tympanus.net/translation/register.php" target="_blank">View demo</a><a class="download" href="http://tympanus.net/translation/translation.zip">Download source</a></p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/12/30/easy-php-site-translation/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>jTextTranslate: A jQuery Translation Plugin</title>
		<link>http://tympanus.net/codrops/2009/11/30/jtexttranslate-a-jquery-translation-plugin/</link>
		<comments>http://tympanus.net/codrops/2009/11/30/jtexttranslate-a-jquery-translation-plugin/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 12:59:25 +0000</pubDate>
		<dc:creator>cody</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[google API]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=906</guid>
		<description><![CDATA[The double-click functionality in the New York Times was somehow fascinating but also highly discussed because it boldly used the browser functionality to get the definitions of words. Fortunately, the double click now causes not an immediate popout to appear but lets the user confirm by showing an interrogation mark. This inspired me to create [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-914" title="jTextTranslate copy" src="http://tympanus.net/codrops/wp-content/uploads/2009/11/jTextTranslate-copy.gif" alt="jTextTranslate copy" width="542" height="344" /></p>
<p>The double-click functionality in the <a href="http://www.nytimes.com/" target="_blank">New York Times</a> was somehow fascinating but also highly <a href="http://www.joshnichols.com/blog/entry/new-york-times-double-click-dictionary/" target="_blank">discussed</a> because it boldly used the browser functionality to get the definitions of words. Fortunately, the double click now causes not an immediate popout to appear but lets the user confirm by showing an interrogation mark.</p>
<p>This inspired me to create a new jQuery plugin for translating text. Imagine, how users that don&#8217;t have English as their first language could profit from an integrated functionality to translate e.g. an article.</p>
<p><span id="more-906"></span></p>
<p>The plugin works with the <a href="http://code.google.com/apis/ajaxlanguage/documentation/" target="_blank">Google Language API</a> and can be used to translate a text in all the languages provided by the API.</p>
<p>You can call the plugin like this:</p>
<p><code>$(element).translate()</code></p>
<p>And you can configure the plugin in the following way:</p>
<ol>
<li><strong>original</strong>: the language shortage of the initial language (default is &#8220;en&#8221;)</li>
<li><strong>notfound</strong>: the message shown when no translation was found</li>
<li><strong>title</strong>: The title of the translation overlay</li>
<li><strong>firstOptionText</strong>: the text shown as first option in the languages drop down</li>
</ol>
<p><a class="demo" href="http://tympanus.net/jTextTranslate/" target="_blank">Try the demo</a><a class="download" href="http://tympanus.net/jTextTranslate/jTextTranslate.zip">Download jTextTranslate</a></p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/11/30/jtexttranslate-a-jquery-translation-plugin/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Google API Showcase: The Live Translator</title>
		<link>http://tympanus.net/codrops/2009/09/30/google-api-showcase-live-translator/</link>
		<comments>http://tympanus.net/codrops/2009/09/30/google-api-showcase-live-translator/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:32:01 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google API]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=636</guid>
		<description><![CDATA[The API of Google has a lot of useful usage examples. This showcase demonstrates how we can use the Google AJAX Language API to build a live translator that allows us to translate text from one language into the other &#8211; and that almost on the fly. Check out the demo here: DEMO Here is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tympanus.net/codrops/wp-content/uploads/2009/09/livetranslator/translate.html" target="_blank"><img class="aligncenter size-full wp-image-1000" title="Live translator" src="http://tympanus.net/codrops/wp-content/uploads/2009/09/livetranslator/livetranslator.jpg" alt="" width="538" height="361" /></a></p>
<p>The API of Google has a lot of useful usage examples. This showcase demonstrates how we can use the <a href="http://code.google.com/apis/ajaxlanguage/">Google AJAX Language API</a> to build a live translator that allows us to translate text from one language into the other &#8211; and that almost on the fly.</p>
<p><span id="more-636"></span></p>
<p>Check out the demo here: <a href="http://tympanus.net/codrops/wp-content/uploads/2009/09/livetranslator/translate.html" target="_blank">DEMO</a></p>
<p>Here is the jQuery part:</p>
<pre class="brush: js">(function($) {
  $.fn.translate = function(options) {
		 var opts = $.extend({}, $.fn.translate.defaults, options);
		 return this.each(function() {
			$this = $(this);
			$("select#_from option[selected]").removeAttr("selected");
			$("select#_from option[value='en']").attr("selected", "selected");
			$("select#_to option[selected]").removeAttr("selected");
			$("select#_to option[value='es']").attr("selected", "selected");
			$('#content',$this).val("");

			$(document).keypress(function(e){
				if(e.which == 13){
					$.fn.translate.initialize();
					$("#content").val("");
				}
			});
			$('#_from',$this).change(function(e){
				$.fn.translate.defaults._from_lang = $(this).val();
			});
			$('#_to',$this).change(function(e){
				$.fn.translate.defaults._to_lang = $(this).val();
			});
		 });
  };
  $.fn.translate.initialize = function() {
	  var content = $('#content');
	  var text = $("#content").val();
	  google.language.translate(text, $.fn.translate.defaults._from_lang, $.fn.translate.defaults._to_lang, function(result) {
	    var translated = $("#translation");
		var translated_original = $("#translation_original");
	    if (result.translation) {
	      (translated.html() != "")?translated.append("
"+result.translation):translated.append(result.translation);
		  (translated_original.html() != "")?translated_original.append("
"+text):translated_original.append(text);
	    }
		else{
		  (translated.html() != "")?translated.append("
"+text):translated.append(text);
		  (translated_original.html() != "")?translated_original.append("
"+text):translated_original.append(text);
		}
	  });
  }
  $.fn.translate.defaults = {
    _from_lang	: 'en',
    _to_lang	: 'es'
  };
})(jQuery);</pre>
<p>Note that this is just a demo. Not all the languages that are supported by the Google AJAX Language API are included here.</p>
<p>Enjoy!</p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/09/30/google-api-showcase-live-translator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  tympanus.net/codrops/tag/translation/feed/ ) in 0.19723 seconds, on Feb 8th, 2012 at 5:48 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 8th, 2012 at 6:48 pm UTC -->
