<?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>blog.i18n.ro &#187; Programming</title>
	<atom:link href="http://blog.i18n.ro/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.i18n.ro</link>
	<description>Sorin&#039;s personal blog and website</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:05:02 +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>Apple failing to support high-DPI on iTunes</title>
		<link>http://blog.i18n.ro/apple-failing-to-support-high-dpi-on-itunes/</link>
		<comments>http://blog.i18n.ro/apple-failing-to-support-high-dpi-on-itunes/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 11:08:47 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[Output]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dpi]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/2010/11/02/apple-failing-to-support-high-dpi-on-itunes/</guid>
		<description><![CDATA[The irony is that Apple who created the smartphone with the greatest DPI ever, is unable to add high DPI support for their iTunes application. Here is how the latest iTunes 10 application under Windows 7 on a computer that &#8230; <a href="http://blog.i18n.ro/apple-failing-to-support-high-dpi-on-itunes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The irony is that Apple who created the smartphone with the greatest DPI ever, is unable to add high DPI support for their iTunes application.</p>
<p>Here is how the latest iTunes 10 application under Windows 7 on a computer that has the DPI setting set to 150% (&#8220;Larger&#8221;) also known as 144ppi.<span id="more-496"></span></p>
<p><img src="http://blog.i18n.ro/files/2010/11/110210_1108_Applefailin1.png" alt="" /></p>
<p>Steve, what kind of QA is the iTunes team doing? As you can see this is not a minor/cosmetic issue anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/apple-failing-to-support-high-dpi-on-itunes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Things you really should be knowing about Perforce</title>
		<link>http://blog.i18n.ro/things-you-really-should-be-knowing-about-perforce/</link>
		<comments>http://blog.i18n.ro/things-you-really-should-be-knowing-about-perforce/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 10:59:01 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[perforce]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=444</guid>
		<description><![CDATA[My 3 years experience with Perforce was not one of the best ones and I decided to share some things that you may not know about Perforce, ones that you are not going to find in any marketing document. Limited &#8230; <a href="http://blog.i18n.ro/things-you-really-should-be-knowing-about-perforce/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My 3 years experience with Perforce was not one of the best ones and I decided to share some things that you may not know about Perforce, ones that you are not going to find in any marketing document.<span id="more-444"></span><br />
<h2>Limited support for ignoring files or directories</h2>
<p>If you used Subversion, Git or others probably you are already used to mark some files or directories to be ignored. On these systems ignore patterns are stored on the server and they do apply for all the users. This does make perfectly sense for me, if you want to stop your SCM from looking for .pyc files or temp directories you add the rule and everybody will benefit from it.</p>
<p>Now if you try to obtain the same behavior in Perforce you will be surprised that what their support for ignoring files is not what you would expect.</p>
<p>First, you can define the ignoring patterns in your clientspec, so they will be available only to this clientspec, meaning that you will have to multiply them in all your clientspecs. Sharing them with others? &#8230; yep copy/paste.</p>
<p>Now lets try to have a deeper look on how they really work:</p>
<ul>
<li>partially supported only in GUI (p4v) &#8211; for example they will continue to show in file tree and even when you use the Reconcile Offline Files. In fact the only place where they are working is on Advanced Reconcile &#8211; a place that you probably do not need/want to use.</li>
<li>forking? &#8230;. you just have to recreate the ignore pattern in the view.</li>
</ul>
<p>Now imagine that I do work a lot with Python and that entire source tree is full with temporary .pyc files.</p>
<h3>Mapping the same repository file/directory to multiple locations on disk</h3>
<p>Nope, this is not something you can do &#8211; you can try but it will fail to work properly. Trust me, it will save you precious time.</p>
<h3>Having workspaces mapped to the same directory</h3>
<p>If you do not want troubles, do not forget to keep each workspace (clientspec) in its own directory and be sure that these directories do not overlap, even partially.</p>
<h3>Running as root under OS X, not quite</h3>
<p>The login is not working well on OS X if you run perforce as root, this is happening because the system does not have HOME environment variable for this user. Do you what what was the response from support: why do you run Perforce as root? WTF!</p>
<p>I don&#8217;t want to imply that perforce support in not good, in fact I have to confess that they are very well prepared and give well documented answers and really fast. In fact the above case was the only mistake they made.</p>
<p>Workspaces (clientspecs) that are too hard to maintain</p>
<p>Do you have a big projects with tens of developers if not hundreds, and you change the project structure &#8211; now each developer will have to update all his workspaces to match the new one.</p>
<p>It was so hard for Perforce to add something like an @import to the clientspec, so it could just base a workspace on another one?</p>
<p>Now another &#8220;cool&#8221;, feature is that it is not possible just to copy and paste the view definition from one workspace to another because you will have to do some find-n-replace on it to replace the original clientspec name from each line with your name.</p>
<p>It&#8217;s true that there is an option to clone a clientspec, but this will create a new clientspec and you will still be required to move your customizations to it.</p>
<h3>Personal conclusions</h3>
<p>First, I want to say that even with the problems presented above, Perforce is a very reliable tool and I am not aware about any open-source solution that would be able to deal with repositories of hundreds of gigabytes and a changelist history of 6 digits.</p>
<p>If you know other workarounds for Perforce let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/things-you-really-should-be-knowing-about-perforce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complete guide for installing Hudson CI on OS X 10.6</title>
		<link>http://blog.i18n.ro/complete-guide-for-installing-hudson-ci-on-os-x-10-6/</link>
		<comments>http://blog.i18n.ro/complete-guide-for-installing-hudson-ci-on-os-x-10-6/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 11:02:23 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=407</guid>
		<description><![CDATA[If you are one of the less lucky ones that do have to use OS X instead of Linux for installing a Hudson CI you could follow this guide because most of other resources I found were incomplete or obsolete, &#8230; <a href="http://blog.i18n.ro/complete-guide-for-installing-hudson-ci-on-os-x-10-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are one of the less lucky ones that do have to use OS X instead of Linux for installing a <a href="http://hudson-ci.org">Hudson CI</a> you could follow this guide because most of other resources I found were incomplete or obsolete, even the ones referring to tomcat.  So here is my small contribution to the community.<span id="more-407"></span></p>
<h2>Installing Tomcat</h2>
<p>Here is the quick guide:</p>
<ul>
<li>install <a rel="nofollow" href="http://www.macports.org/">macports</a>
<ul>
<li><code>suport port upgrade</code></li>
<li><code>sudo port upgrade outdated</code>.</li>
</ul>
</li>
<li><code>sudo port install tomcat6</code>, or if you want other version check <code>port list|grep tomcat</code></li>
<li>config is now at: <code>/opt/local/share/java/tomcat6/conf</code></li>
<li>startup script: <code>/opt/local/share/java/tomcat6/bin/tomcatctl</code></li>
</ul>
<pre><span style="font-family: Georgia, 'Bitstream Charter', serif; color: #444444;"><span style="line-height: 22px;">cp /opt/local/share/java/tomcat6/conf/tomcat-users.xml.sample /opt/local/share/java/tomcat6/conf/tomcat-users.xml
</span></span><span style="color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; font-size: 16px;">nano /opt/local/share/java/tomcat6/conf/tomcat-users.xml</span></pre>
<p>Activate at least the tomcat user and make it a manager.</p>
<p>For running tomcat as a <strong>daemon</strong> on port 8080 but enable also port 80 by using a firewall redirection edit <code>/opt/local/share/java/tomcat6/conf/server.xml</code> and add <code>proxyport="80" URIEncoding="UTF-8"</code> inside <code>&lt;Connector .../&gt;</code>.</p>
<p>For <strong>forwarding port</strong> 80 to 8080 run this line and add it do <code>/bin/catalina.sh</code>:</p>
<pre><code>ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
</code></pre>
<p>Set proper <strong>memory limits</strong> for Java machine running tomcat or you may be in trouble later. Inside<code>/opt/local/share/java/tomcat6/conf/local.env</code></p>
<pre><code>export JAVA_JVM_VERSION=CurrentJDK
export JAVA_OPTS="-Xmx3000M -Xms3000M -Djava.awt.headless=true -Duser.timezone=UTC"
</code></pre>
<p>In my example, I allocated ~3Gb or RAM but you can adapt this, anyway don&#8217;t put less than 1GB if you are running <code>hudson</code> inside tomcat.</p>
<h1>Running as a service (daemon)</h1>
<p>Run <code>nano /Library/LaunchDaemons/org.apache.tomcat.plist</code> and paste the code below:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"     "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.apache.tomcat&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
            &lt;string&gt;/opt/local/share/java/tomcat6/bin/catalina.sh&lt;/string&gt;
            &lt;string&gt;run&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>
<p>Check that launchd detected your new daemon, if not reboot <img src='http://blog.i18n.ro/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<pre><code>launchctl list|grep tomcat
</code></pre>
<p>Start tomcat manually.</p>
<pre><code>launchctl start org.apache.tomcat
</code></pre>
<p>If the status is something else than <code>-</code>, you have a problem and you should investigate it: <code>launchctl log level debug</code> and check <code>/var/log/system.log</code>.</p>
<p>Adding hudson to tomcat<br />
This is the easy part, just do:</p>
<pre>
<pre><code>cd /opt/local/share/java/tomcat6/webapps
wget http://hudson-ci.org/latest/hudson.war
chown _www:_www hudson.war</code></pre>
</pre>
<p>Now go to <a href="http://localhost/manager/">http://localhost/manager/</a> and start hudson.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/complete-guide-for-installing-hudson-ci-on-os-x-10-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using msdev resource editor to create Unicode dialogs that will not display well</title>
		<link>http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/</link>
		<comments>http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 08:08:25 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Output]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Readiness]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?page_id=233</guid>
		<description><![CDATA[I was surprised to discover that creating Unicode UI elements in the resource editor of Microsoft Visual Studio 2008 (SP1) does work, BUT when you compile your application they will fail to display well. I created two test Win32/Unicode native &#8230; <a href="http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was surprised to discover that creating Unicode UI elements  in the resource editor of Microsoft Visual Studio 2008 (SP1)  does work, BUT when you compile your application they will fail to display well.<span id="more-233"></span></p>
<p>I created two test Win32/Unicode native applications one using MFC and one without MFC &#8211; the issue appear on both. I didn&#8217;t bothered to test .NET because I&#8217;m not interested in it.</p>
<p>Take a look at my screenshots below. It&#8217;s really simple to reproduce it yourself: just use the MSDEV Wizard to create a new application and paste some Unicode text into one of the dialogs.</p>
<p>Some interesting thing to consider:</p>
<ul>
<li>I didn&#8217;t change the font in the dialog &#8211; it&#8217;s using the default value: &#8220;MS Shell Dlg&#8221;</li>
<li>If you modify the language of dialog from the default &#8220;English (United States)&#8221; to a language that does contains the testing characters they will display &#8211; but this is insane! It does mean that is still using codepages?! and worse that you cannot create a dialog containing characters from different scripts?</li>
<li>Isn&#8217;t Windows supposed to do font face substitution?</li>
<li>I tested only on Windows XP SP3.</li>
</ul>
<p>Sad but this does look like a <span style="color: #ff0000;">What You See is What you WON&#8217;T Get</span>.</p>
<p><span style="font-size: 23px; color: #000000; line-height: 35px;">Later, same &#8230; day
<a href='http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/vc_unicode_application/' title='vc_unicode_application'><img width="150" height="126" src="http://blog.i18n.ro/files/2009/04/vc_unicode_application-150x126.png" class="attachment-thumbnail" alt="vc_unicode_application" title="vc_unicode_application" /></a>
<a href='http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/vc_unicode_reseditor/' title='vc_unicode_reseditor'><img width="150" height="150" src="http://blog.i18n.ro/files/2009/04/vc_unicode_reseditor-150x150.png" class="attachment-thumbnail" alt="vc_unicode_reseditor" title="vc_unicode_reseditor" /></a>
</p>
<p></span></p>
<p>&nbsp;</p>
<p>Let&#8217;s see the list of bugs I&#8217;ve just discovered on Microsoft Connect using it&#8217;s &#8220;very sad&#8221; search feature</p>
<ul>
<li>By default the RC Files are not Unicode, even on Unicode projects, duh!</li>
<li><span style="color: #ff0000;">Resource editor doesn&#8217;t tell you to save the files as Unicode when you have Unicode characters on it. So you loose them without knowing it!</span></li>
<li>Resource editor doesn&#8217;t support UTF-8 &#8211; sad!</li>
<li>Resource compiler doesn&#8217;t support UTF-8 &#8211; sad!</li>
</ul>
<p>Bugs found on Microsoft Connect: <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=176612">176612</a>, <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100833">100833,</a> <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=162872">162872</a>. Some of them being submitted 3 years ago for Visual Studio 2005: None of them solved even in newer versions like  2008.</p>
<h2>And the DIY formula</h2>
<p>Open the RC file using text editor and save it using <strong>File &gt; Advanced Save Options</strong> and select <strong>Unicode &#8211; Codepage 1200</strong>. It took me quite some time to figure it out just because several people considered that Unicode related bugs are not so important. Maybe we can suggest to rename the Unicode option from the Application Wizard to &#8220;Partially Unicode&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/using-msdev-resource-editor-to-create-unicode-dialogs-that-will-not-display-well/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Selecting the right language on web applications</title>
		<link>http://blog.i18n.ro/selecting-the-right-language-on-web-applications/</link>
		<comments>http://blog.i18n.ro/selecting-the-right-language-on-web-applications/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 11:31:22 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=149</guid>
		<description><![CDATA[Choosing the right language for web applications is not quite an easy task. There are many source of information and you have to figure a good algorithm for making the best decision. As I didn&#8217;t found yet the &#8220;right&#8221; implementation &#8230; <a href="http://blog.i18n.ro/selecting-the-right-language-on-web-applications/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Choosing the right language for web applications is not quite an easy task. There are many source of information and you have to figure a good algorithm for making the best decision. As I didn&#8217;t found yet the &#8220;right&#8221; implementation I decided to describe the algorithm.</p>
<p><span id="more-149"></span>First we should identify the source of language related data we could use for making a decision:</p>
<ol>
<li>HTTP_ACCEPT_LANGUAGE &#8211; included in any HTTP request. Something like:
<pre>en-ca,en-gb;q=0.7,en;q=0.3
"q" parametter indicates the quality (higher is better).</pre>
</li>
<li><span class="code-string">user preference: a cookie or user preference if the user is already logged in<br />
</span></li>
<li>your list of supported languages</li>
<li>(optional) Your list of language fallback preferences, in case you do not have one we can consider that it is &#8220;en&#8221;</li>
<li>(optional) <span class="code-string">HTTP_ACCEPT_CHARSET.</span></li>
<li><span class="code-string">(optional) IP address &#8211; this can be converted to a country or language.<br />
</span></li>
</ol>
<h3>Basic rules</h3>
<ol>
<li>If user had a preference (cookie/profile) and it&#8217;s a valid we use it &#8211; return</li>
<li>We try to match all language variants existing in HTTP_ACCEPT_LANGUAGE with our list of supported languages and select first match &#8211; return</li>
<li>If we have language fallback list we choose the first language from it &#8211; return</li>
<li>We&#8217;ll choose &#8216;en&#8217; if it is present in the supported language list &#8211; return.</li>
<li>We&#8217;ll choose first available language from the supported language list &#8211; return.</li>
</ol>
<h3>Remarks</h3>
<ul>
<li>I ignore the requested charset because I prefer to use UTF-8 everywhere. I don&#8217;t want to convince you it&#8217;s the necessary best choice but from my point of view it is pretty good. I&#8217;m aware that there are still mobile devices on the market without UTF-8 support.</li>
<li>I ignore the IP information because I consider it not so relevant &#8211; there are many people traveling and you&#8217;ll get his current location, also it&#8217;s harder to implement.</li>
<li>Possible future improvements: create a small list of languages user may know (probability). Let&#8217;s say I have an website in 50 languages and I want to show to the users only the first 2-3 languages and a selection control (combobox) for the entire list. Here it could be very useful to use the information provided by the IP address.</li>
</ul>
<h3>Questions still to be answered</h3>
<p>Could we figure a way of displaying combined content based on user preference? It&#8217;s high likely that your website may not contain all articles in all languages and that some users will want to real articles in several languages.</p>
<p>How can we display this option to the user? Remember that you can&#8217;t display a huge list of checkboxes to the user &#8211; it should be something small and intuitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/selecting-the-right-language-on-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>i18n mistake #1: Using images for representing languages</title>
		<link>http://blog.i18n.ro/i18n-mistake-1-using-images-for-representing-languages/</link>
		<comments>http://blog.i18n.ro/i18n-mistake-1-using-images-for-representing-languages/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 01:32:53 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[mistakes]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=145</guid>
		<description><![CDATA[Clearly adding images for representing languages is not the most important internationalization issue someone can make. In fact I added #1 because this is the first internationalization mistake I decided to blog about and I want to document many more &#8230; <a href="http://blog.i18n.ro/i18n-mistake-1-using-images-for-representing-languages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Clearly adding images for representing languages is not the most important internationalization issue someone can make. In fact I added #1 because this is the first internationalization mistake I decided to blog about and I want to document many more mistakes in the future.<span id="more-145"></span>As a quick solution would be to use images with <a href="http://en.wikipedia.org/wiki/ISO_639-1">ISO 639-1</a> language codes like: en, fr, de, es, ja. But you should be aware that not all languages can be represented using ISO 639-1 and you may be required to use ISO-639-3 or simpler to add a two-letter subcode using country code <a class="normref" rel="biblioentry" href="http://www.w3.org/TR/html401/references.html#ref-ISO3166">[ISO3166]</a>  like en-us or en-gb</p>
<p>Also check the list every time you add a language because it&#8217;s <strong>another common mistake to assume that two letter domain names or country codes are the same as the language codes</strong>.</p>
<p>An even a better idea could be to not use images at all <img src='http://blog.i18n.ro/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You may find additional resources at: <a href="http://www.sil.org/iso639-3/codes.asp?order=639_1">sil.org</a> or at <a href="http://www.sil.org/iso639-3/codes.asp?order=639_1">W3C &#8211; using lang<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/i18n-mistake-1-using-images-for-representing-languages/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Keyboard shortcuts and mnemonics or accelerators are not the same thing!</title>
		<link>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/</link>
		<comments>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 15:30:27 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mnemonics]]></category>
		<category><![CDATA[shortcuts]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=121</guid>
		<description><![CDATA[Over the time I&#8217;ve found that there are misunderstandings between the concept of the keyboard shortcuts and mnemonics. I will try to clarify this problem because the differences are important specially from the point of view of software localization. The &#8230; <a href="http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the time I&#8217;ve found that there are misunderstandings between the concept of the <strong>keyboard shortcuts</strong> and <strong>mnemonics</strong>. I will try to clarify this problem because the differences are important specially from the point of view of software localization.<span id="more-121"></span></p>
<div id="attachment_125" class="wp-caption alignright" style="width: 270px"><img class="size-full wp-image-125" src="http://i18n.poi.ro/files/2008/12/keyboard_shortcuts_mnemonics.png" alt="Keyboard shortcuts in green and mnemonics in yellow." width="260" height="288" /><p class="wp-caption-text">Keyboard shortcuts in green and mnemonics in yellow.</p></div>
<p>The best keyboard related definition I&#8217;ve found for mnemonic it was on <a href="http://java.sun.com/products/jlf/ed2/book/HIG.Glossary.html#51661">Sun Java glossary</a>:</p>
<blockquote><p><strong>mnemonic</strong> &#8211; An underlined alphanumeric character, typically in a menu title, menu item, or the text of a button or component. A mnemonic shows the user which key to press (in conjunction with the Alt key) to activate a command or navigate to a component.</p></blockquote>
<p>If you had Win32 experience you may call them &#8220;menu accelerators&#8221;. They define the letter used for triggering them by using Ampersand (&amp;) inside the menu text. I would not recommend the usage of &#8220;accelerator&#8221; term because looking over the net I&#8217;ve found that in many cases it does refer to keyboard shortcuts.</p>
<p>If you are wondering why it&#8217;s important to clearly distinguish between them: it&#8217;s because the mnemonics are changing when the UI language is localized but the keyboard 	<a href="http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/">shortcuts are not supposed to be localized</a>.<br />
.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/keyboard-shortcuts-and-mnemonics-or-accelerators-are-not-the-same-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web content, code pages and UTF-8 Unicode encoding</title>
		<link>http://blog.i18n.ro/web-content-character-encodings-code-pages-and-utf-8-unicode/</link>
		<comments>http://blog.i18n.ro/web-content-character-encodings-code-pages-and-utf-8-unicode/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 10:21:58 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[Readiness]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[code page]]></category>
		<category><![CDATA[encodings]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=114</guid>
		<description><![CDATA[If you want to minimize the number of bugs reported for your web application you should know that codepages are domain of the past. If you want to create multi-language web content all you have to remember is that you &#8230; <a href="http://blog.i18n.ro/web-content-character-encodings-code-pages-and-utf-8-unicode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you want to minimize the number of bugs reported for your web application you should know that codepages are domain of the past. If you want to create multi-language web content all you have to remember is that you should use <strong>UTF-8 encoding everywhere</strong>. <span id="more-114"></span></p>
<p>Also if you encounter pages in other encodings you should convert them into <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a>.</p>
<p>What you should know about UTF-8:</p>
<ul>
<li>Any character can be encoded in UTF-8, converting any other encoding to UTF-8 can be done without loosing data</li>
<li>UTF-8 is the de facto standard on all internet related protocols.</li>
<li>Any ASCII text is a valid UTF-8 text</li>
<li>UTF-8 is the most simple Unicode encoding and it&#8217;s the only one that is not dependent of the byte-ordering.</li>
<li>It&#8217;s best to mark UTF-8 as the default encoding for any page you create.</li>
</ul>
<p>The only real disadvantage I&#8217;ve discovered when using UTF-8 encoding is that the encoded text is larger than for some languages like the Asian ones. Still this should be no problem if you enable <a href="http://en.wikipedia.org/wiki/HTTP_compression">HTTP compression</a>.</p>
<p>When the usage of UTF-8 can break things:</p>
<ul>
<li>If the text is going to be used on ancient devices that are able to use only 8-bit characters. Like: TV related equipments, or old mobile phones.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/web-content-character-encodings-code-pages-and-utf-8-unicode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Are we supposed to localize keyboard shortcuts?</title>
		<link>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/</link>
		<comments>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 14:37:32 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[shortcuts]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=85</guid>
		<description><![CDATA[When I&#8217;m talking about keyboard shortcuts to things like Ctrl-S or even one key shortcuts like &#8216;A&#8217; (used to Archive an email on Gmail). On the other side the mnemonics, known as hotkeys or the underlined letters in menus or &#8230; <a href="http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m talking about keyboard shortcuts to things like Ctrl-S or even one key shortcuts like &#8216;A&#8217; (used to Archive an email on Gmail). On the other side the mnemonics, known as hotkeys or the underlined letters in menus or other GUI controls are clearly something that should be localized and I not going to argue about this.<span id="more-85"></span></p>
<p>I&#8217;ve did some research to see how different companies are dealing with the shortcuts when people are using different languages and different keyboard layouts. Here are a short list of my results:</p>
<ul>
<li>If possible the shortcut is not changed</li>
<li>If a key is not available on a specific layout we should try to use the same physical position</li>
<li>There should be no link between application language and keyboard layouts. It&#8217;s a mistake to consider that application language will match the keyboard layout. I&#8217;ll give you just an example: in Romania over 95% of the computers are using US keyboard layout and the other 5% are using one of the 4-5 different Romanian keyboard layouts.</li>
<li>some people are using multiple keyboard layouts &#8211; usually they are power users and we can&#8217;t ignore them</li>
<li>keyboard layouts can be switched anytime</li>
<li>characters are safe to be used only if they are Latin</li>
</ul>
<h3>Physical position rules</h3>
<p>I think that the physical position of a key is more important than the letter printed on it. Here are my arguments:</p>
<ul>
<li>human brain is learning the shortcuts by hand movements (see <a href="http://en.wikipedia.org/wiki/Classical_conditioning">Pavlov&#8217;s dog experiment</a>)</li>
<li>it&#8217;s compatible with the usage of multiple keyboard layouts</li>
</ul>
<p>But it&#8217;s not always so simple: we can&#8217;t expect that the French users would swap the usage of Ctrl-Q with Ctrl-A ( Quit vs Select All) just because they are using different layouts. So a basic rule would be to stick to the layout for letters and numbers BUT try to use the physical position for other keys.</p>
<p>Anyway is high likely that people using multiple layouts would choose alike layouts (derived from the same root).</p>
<h2>One-to-one key matching</h2>
<p>Because the number of keys is the same we have to find a way of remapping the keys so all shortcuts working on US to be usable on other layouts. When I&#8217;m referring to keys, I&#8217;m referring to the hardware keys.</p>
<h2>Case study</h2>
<table border="0">
<tbody>
<tr>
<th>key category</th>
<th>US</th>
<th>French</th>
<th>Turkish</th>
<th>Arabic</th>
<th>Details</th>
</tr>
<tr>
<td>letters</p>
<p>(26)</td>
<td>Q</td>
<td>swapped to A</td>
<td>moved where = was</td>
<td>same pos.<br />
diff char</td>
<td>We should follow layout movements for all letter keys.</td>
</tr>
<tr>
<td>signs (OEMs)</p>
<p>(11-12)</td>
<td>-_ (minus after 0)</td>
<td>now -_ is moved where =+ was</td>
<td>obtained with Shift-/</td>
<td>-</td>
<td rowspan="2">Some of the OEM keys are used in pairs and it&#8217;s more important to keep key-pairs together than keeping the symbols on them.</td>
</tr>
<tr>
<td>signs (OEMs)</p>
<p>(11-12)</td>
<td>=+ (plus before backspace)</td>
<td>=+ is moved where / was.</p>
<p>note1: as you can observe these keys are no longer in pairs.</td>
<td>moved in the place of &#8216;&#8221;</p>
<p>note1: as you can observe these keys are no longer in pairs.
</td>
<td>-</td>
</tr>
<tr>
<td>numeric</p>
<p>(10)</td>
<td>1</td>
<td>1 (produced with Shift)</td>
<td>1</td>
<td>1</td>
<td>We should not request French users to press Ctrl+Shift+1 instead of Ctrl+1 just because their keyboard are producing numbers only with shift pressed.</td>
</tr>
<tr>
<td>others</p>
<p>(&#8230;)</td>
<td colspan="4">F1, Backspace, Space, numpad ones, &#8230;.</td>
<td>We should have no problems with these if we are using virtual keys/scan codes.</td>
</tr>
</tbody>
</table>
<blockquote><p>Question: <strong>How do I make OS X tell me that the key pressed by the user was &#8216;q&#8217; when current layout is Arabic?</strong></p>
<p>Rules:</p>
<ul>
<li>we are not allowed to assume it&#8217;s a &#8216;q&#8217; just because the key code is the same, maybe it&#8217;s a Arabic DVORAK keyboard!.</li>
<li>the shortcuts cannot be hardcoded (user can edit them)</li>
</ul>
</blockquote>
<p>On Windows it does work 98% using virtual key codes and you can use them to extract this info, but on OS X the key codes (even Apple call them sometimes virtual key codes) they are some kind of scan codes. For the rest of 2% you have to do some small hacks with the OEMs.</p>
<h2>Current code</h2>
<p><code><br />
case kEventRawKeyDown:<br />
  {<br />
    unsigned char macChar;<br />
    unsigned int keycode;<br />
    unsigned int modifiers;<br />
    unsigned int keyboardtype;</p>
<p>    OSStatus eventParamStatus = GetEventParameter( inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(macChar), NULL, &amp;macChar);<br />
    GetEventParameter(inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keycode), NULL, &amp;keycode);<br />
    GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(modifiers), NULL, &amp;modifiers);<br />
    GetEventParameter(inEvent, kEventParamKeyboardType, typeUInt32, NULL, sizeof(keyboardtype), NULL, &amp;keyboardtype);</p>
<p>   // kEventParamKeyMacCharCodes<br />
   // for Latin characters it does behaves like Windows<br />
   // for !Latin it does not return consistent data: on Arabic it does return the same as on US but on French it does return French specific characters for the OEM keys.<br />
...<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual key codes on Apple OS X</title>
		<link>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/</link>
		<comments>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:20:47 +0000</pubDate>
		<dc:creator>sorin</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[virtual key]]></category>

		<guid isPermaLink="false">http://blog.i18n.ro/?p=30</guid>
		<description><![CDATA[On Windows, keyboard events are reporting scan codes, virtual key codes and characters. If you want to deal with keyboard shortcuts and be able to use them in an international context you have to use the virtual key codes. Let’s &#8230; <a href="http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On Windows, keyboard events are reporting scan codes,  virtual key codes and characters. If you want to deal with keyboard shortcuts and be able to use them in an international context you have to use the virtual key codes.<span id="more-30"></span><br />
Let’s say that we want to implement <code>Ctrl+A</code> shortcut. In this case all we have to do is to look after <code>VK_A</code> virtual key.</p>
<ul>
<li>VK_A code is present on any keyboard layout even if the character produced is not A</li>
</ul>
<ul>
<li> usually is on the same position, it does move only on some layouts like French <a href="http://en.wikipedia.org/wiki/AZERTY">AZERTY</a>, and it’s  logical to be moved – if the keyboard has an &#8220;A&#8221; printed on it user is supposed to press this button – we can’t request French users to switch <code>Ctrl-Q</code> and <code>Ctrl-A</code> just because they have a different keyboard layout.</li>
</ul>
<ul>
<li> we can’t rely on the characters because many layouts do not produce Latin characters or some keys are not even producing a character (dead keys).</li>
</ul>
<ul>
<li> it’s not safe to use the scan codes because they will break on AZERTY, <a href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard">DVORAK </a>and other layouts.</li>
</ul>
<p>I think I do not have to explain more why virtual keys are the way we must store and process keyboard shortcuts.<br />
And now let’s try the same thing on Apple OS X platform. It does seem that apple has only 2 properties for keyboard events: key codes (<code>kEventParamKeyCode</code>) and characters. They consider key codes to be some sort of virtual keys, but in fact they are just physical key positions and this does mean that they are some sort of hardware independent scan codes.<br />
So now I’m stuck with this big question:</p>
<blockquote><p><strong><span style="color: #ff6600"><em>How do I detect that the user pressed <code>Command+A</code> under OS X in a way that will work with any keyboard layout?</em></span></strong></p></blockquote>
<p>I should add that the user can have multiple keyboard layouts installed.</p>
<h3>External links</h3>
<ul>
<li><a href="http://blog.janik.cz/archives/2006/08/02/T23_14_53/">Carbon keyboard events</a></li>
<li><a href="http://blakeseely.com/blog/archives/2006/09/26/virtual-keys/">Virtual keys on Apple</a></li>
<li><a href="http://rentzsch.com/macosx/virtualKeyCodes">http://rentzsch.com/macosx/virtualKeyCodes</a> &#8211; Article about Virtual Key Codes on OS X</li>
<li><a href="http://developer.apple.com/documentation/Carbon/Reference/Carbon_Event_Manager_Ref/Reference/reference.html">Carbon Event Manager Reference</a></li>
<li><a href="http://developer.apple.com/documentation/Carbon/Conceptual/UnderstandTextInput_TSM/tinptsm_concepts/chapter_2_section_3.html">Text Input Event Handling for Applications With Carbon</a></li>
<li><a href="http://developer.apple.com/qa/qa2005/qa1446.html">Losing the character code when using the control key</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.i18n.ro/virtual-key-codes-on-apple-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc

Served from: blog.i18n.ro @ 2012-02-07 17:03:51 -->
