Monday, February 18, 2013

Early Feedback - Testing Global ready Apps - using pseudo-localization

I have been talking, preaching and practicing on how to bring testing early on in development cycle to help improve time to market and help build baked in quality.

Early Testing of apps for global readiness is one of my top learning goal for some time. Use of pseudo-localization techniques to test global readiness of app has caught my fancy recently. My colleague Priyanka's(priyaag@thoughtworks.com) enthusiasm has only added to my desire to learn even stronger.

Recent tool support in open source world for pseudo-localization has only fueled my goal of learning.
Google's Pseudolocalization tool makes testing early much easier. I found it difficult to understand the usage of tool with the available resources.Priyanka and myself put effort to understand the usage of tool.With some effort we were able to learn this tool and we would like to share our understanding of the tool for wider community.

I am going to showcase usage of this tool, using a simple application that we built from using the sample application InternationalizedMortgageCalculator.java on Java internationalization trail

Before I go there, below are some links that have some excellent guidelines, definitions, testcases and studies around i18n,l10n and pseudo-localization testing that i found very insightful.

Excellent introduction to Pseudolocalization on wikipedia

Helen Kask's thesis gives in depth understanding of various aspect of internationalization and pseudolocalization, options available and some pros and cons of various approaches - Pseudolocalization Realization for Skype Software

Google open source blog have some simple but excellent example to understand Pseudolocalization to catch i18n errors

Some excellent checklists and testcases below -

Lingotek Internationalization and Pseudo Localization data sheet

Localization and Internationalization testing knowledge paper - excellent test case and approach here Localization and Internationalization testing approach and testcases


Learning to use Google Pseudolocalization tool with Sample app -


1 : Build the sample app


create a java project in eclipse with sample java swing program InternationalizedMortgageCalculator.java

along with the resource files supplied
screenshot of the project in eclipse

2 : Play around with application


Run the application by right clicking the InternationalizedMortgageCalculator.java and selecting "Run As" -> "Java Application"

Use various "locales" using "Locale" drop down menu and see how selecting different locales and regional language setting changes the UI text and direction (for e.g. selecting ar-AR will make the direction of text and order and location of Menu items from Right to Left) , and locale sensitive information such as Currency etc.

3: Create Pseudo-localized resource file

 Lets create a pseudo localized file for the default locale using Google "Pseudolocalization tool"

Step1 Download

Download the following three in a folder of your choice from http://code.google.com/p/pseudolocalization-tool/downloads/list

pseudolocalization-0.2-deps.jar
pseudolocalization-0.2.jar
pseudolocalizer (command line script for using the tool)


I have downloaded under $Home/pseudolocalizationtool

Step2 Configure

edit the "pseudolocalizer" shell script and change the DIR variable to point to the folder contatining the above three files. Save

Below is the screenshot for edited pseudolocalizer file as per my setting -


Step3 Run the tool

 Open a terminal window.  cd to your pseudolocalization tool folder.

> sh pseudolocalizer  <path to your default Resources.properties file in your eclipse project>

like this:

note: you can find the full path to your Resource.properties by right clicking "Resources.properties" in the eclipse project explorer and selecting "properties" and copying location from the resulting window.

Once you refresh the project in eclipse , you will find a new file created by tool "Resources_psaccent.properties".

The default variant is "psaccent". You will notice that "Resource_psaccent.properties" has

1. All the US-ASCII characters in original "Resource.properties" are accented
2. There will be brackets around every messages coming from your "Resources.properties" file
3. All the messages have been made longer by adding more characters and spaces


Step5 :Run the application with pseudolocalized resource

In Eclipse, Rename the "Resource.properties" file to "Resource_original.properties" and  "Resources_psaccent.properties" to "Resources.properties".

Run application from eclipse

You will see the application UI populated with pseudo-localized text.


Step5 :Run the application with fakebidi (using Right to left pseudolocalization)

Run the pseudolocalization tool with --variant flag set to "psbidi" to create a fakebidi resource file



Refresh eclipse project

Rename "Resource.properties" to "Resource_psaccent.properties"

Rename "Resource_psbidi.properties" to "Resource.properties"

Rerun the app and you will see the UI populated with "fakebidi"

Below is the screenshot of the same app -


Hope you find this blog useful from the perspective of getting started with "pseudolocalization" tool.