Business as Mission requires localization.
Business as Mission
When I spend time with other business owners the topic of “Vision, Mission and Values” often comes up.
If an organization does not have a clear purpose and stated values, it can be easily tossed and turned by opportunities and obstacles that come along over time.
For an example, consider this vision held by the seemingly ubiquitous McDonald’s corporation:
"McDonald's vision is to be the world's best quick service restaurant experience. Being the best means providing outstanding quality, service, cleanliness, and value, so that we make every customer in every restaurant smile."
Personally, I prefer Mexican food, and you may or may not enjoy McDonald’s. Whatever our personal preferences, McDonald’s can judge their performance by not only their sales figures, but also by scanning the restaurant and looking for smiles. Having something as simple as a “smile meter” helps them operate their business day to day. Not a terrible idea.
But what about “Business as Mission”?
This is a term I learned from a friend not too long ago in speaking about work that his organization is doing on a global basis.
Business as Mission is where an organization looks to not only make a profit for shareholders and provide an income for its employees, but is intentionally working in a specific field to improve the lives of its clients.
This might look like bringing medical care to a dangerous and under-served market where no one else dares venture.
Or it might look like a micro-finance operation where relatively small monetary loans are made to farmers and merchants to help invigorate their businesses in an otherwise entirely stagnant economy.
Whatever its purpose or activity, Business as Mission is often global in nature. And global means multi-lingual, as I was soon to learn.
This same friend asked me if the software he owns and I help maintain could be easily translated into other languages beyond English. My first question was, are we talking about ‘EFIGS’, you know: English, French, Italian, German and Spanish? These are the languages that happily fit into an 8-bit character set. He said, “Sure, those are great, but can we start with Turkish and Russian?”
My response is a topic for another day and a tall glass of Dr. Pepper, but the thought occurred to me that it would be of value to discuss how to modify an Android application to support multiple languages — and that is the topic of this article.
We’re going to demonstrate translating a super simple application into Spanish. Why Spanish? Because I am not sure I know how to spell Turkish or Russian!
Hola Android
The world’s most popular software program is entitled: “Hello World”. So, let’s start with that familiar application and use it as a basis for examining the topic of localization.
First, here is the application in action in its default language of English.

Running the application
The only thing we are concerned with here are two strings: the title of the application and the value of “hello”.
The application code itself is nothing beyond the stock Android Activity code which loads the appropriate resources at runtime with a call to setContentView():
package com.msi.linuxmag.hola;
import android.app.Activity;
import android.os.Bundle;
public class HolaAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
If you are at all familiar with Android programming, you will note that there is absolutely nothing special about this code. In fact, I didn’t even modify it from the boiler-plate code generated by the “new project” wizard.
Let’s have a look at the project as shown in the image below:

The project in Eclipse
Note that under the /res folder there are two folders containing string values. The first is named simply “values”. In the absence of any further guidance on which language to use, an Android application uses the resources found in the values folder.
The second values folder is named “values-es”. The “es” stands for Espanol, or as I will refer to it from here on: “Spanish”.
In this simple application, the values folder contains a single file named “strings.xml”. As you can probably deduce, the strings.xml file contains string literals to be employed in the application.
Let’s have a look at the two strings.xml files in use in this application. First the default version found in /res/values/strings.xml.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello</string>
<string name="app_name">Frozen Yogurt</string>
</resources>
And now the Spanish file, /res/values-es/strings.xml.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hola</string>
<string name="app_name">Yogurt congelado</string>
</resources>
Clearly this is a simple example, but it is sufficient to convey the mechanics of how to proceed in translating an application from one language to another.
We have two strings. The first named “hello” has a value of either “Hello” or “Hola”.
The second string named “app_name” has a value of “Frozen Yogurt” in English and “Yogurt congelado” in Spanish. At least that is what Google’s translation widget suggested.
By the way, Google translates “Froyo” to “Froyo”, so I had to come up with something a little less hip and cool, like “Frozen Yogurt”.
Let’s have a look at the application in action.
Demo time
We have already seen what the application looks like in English. Here is a screen shot of the application’s launch icon in the Android home screen shown in the locale of “English-United States”, or “enUS”.

Home screen in English
Now, let’s change the locale on the device to Spanish.

Switching the locale
Once the locale is switched to Spanish, we can see that the home application screen has changed. Note the names of applications have changed, including our own. Also note the change in the time formatting in the upper right hand corner of the screen.

Home application screen in Spanish
Now let’s see the application running under the Spanish locale.

In Spanish!
Time for some Yogurt congelado!
So, what if we change the locale to something entirely different, like say German?

German applications screen
What do we get in the application?

Running under German locale
English? Was Los ist?
When Android does not find a string value which maps to the currently selected locale, it drops back to the default strings which are found in the /res/values folder.
Default resources
The “default” values are found in the base resource folders — and they don’t need to be in English. They can be in whatever language makes sense for you and your application. To have explicitly English values, the strings.xml folder would be located within the /res/values-en folder.
For distinguishing between English in the United States versus English in Australia, you would provider further refinement to the folder names. So, to offer both “Don’t worry about it” in the US and “No worries, mate.” for your Australian clients, place those strings in separate resource folders as follows:
- /res/values-en-rUS/strings.xml
- /res/values-en-rAU/strings.xml
We are not limited to just string values. We can have different images (drawables), screen layouts, or even raw resources based on locale. We can also have different resources based on things like screen size and mobile carrier codes but that is beyond our scope at present. To learn more, you can read about Android’s resource selection criteria in detail.
It is important that all of the strings (or any resources) used by an application be found in the default resources files. It is OK to “override” them in a particular language and only provide a subset of the entire list. You might want to do this for example for the title of your application if you want your name to be unique and cross-language, to build brand identity. However, your instructions on how to use your application should be localized.
Localizing an application goes beyond resources — you also need to consider handling dates and numbers in different locales, but we’ll tackle that another time.
Just for fun
I would like to conclude with a fun story shared by a friend of mine who went to Cornell decades before I spent my time far above Cayuga’s waters. He told me that when he matriculated, the university had recently instituted a language requirement for graduation. So, which language did he choose? Fortran! Happy computing.
Comments on "Localizing Android Applications"
http://fernbycooper.com/standard-insurance-limited.html http://inyectronicawc.com/stovall-marks-insurance.html http://maqme.com/look-auto-insurance-ecorse-rd-taylor-mi.html http://gpshousefinder.com/cheap-auto-insurance-quotes-mi.html http://maqme.com/progressive-auto-insurance-in-stockton-ca.html http://prairiecatering.com/auto-insurance-niagara-falls-ontario.html
http://maqme.com/cheap-car-insurances-in-nj.html http://inyectronicawc.com/chase-sapphire-preferred-car-rental-insurance.html http://prairiecatering.com/aaa-auto-insurance-whittier-ca.html http://maqme.com/finding-cheap-full-coverage-car-insurance.html http://maqme.com/car-insurance-muncie-indiana.html http://maqme.com/auto-insurance-ns.html http://fernbycooper.com/moran-insurance.html
http://prairiecatering.com/nfu-car-insurance-reviews.html http://fernbycooper.com/legal-insurance-services.html http://inyectronicawc.com/in-direct.html
http://maqme.com/no-car-insurance-ticket-ny.html http://fernbycooper.com/frontier-general-insurance.html http://inyectronicawc.com/is-there-a-way-to-find-out-if-a-car-has-insurance.html
http://fernbycooper.com/low-insurance-group-cars-list.html http://gpshousefinder.com/auto-insurance-companies-licensed-in-florida.html http://gpshousefinder.com/the-cheap-car-insurance-in-uk.html
http://fernbycooper.com/general-liabilities-insurance.html http://gpshousefinder.com/car-insurance-in-amherst-ny.html http://inyectronicawc.com/how-much-is-a-title-transfer-in-texas.html http://fernbycooper.com/cheap-car-listings.html http://prairiecatering.com/is-ecar-insurance-any-good.html http://prairiecatering.com/cheap-car-insurance-in-tulsa-oklahoma.html http://fernbycooper.com/specialist-porsche-insurance.html http://maqme.com/i-m-looking-for-cheap-car-insurance.html
http://inyectronicawc.com/best-auto-insurance-young-drivers.html http://prairiecatering.com/how-to-get-business-car-insurance.html http://fernbycooper.com/cheapest-car-insurance-in-minnesota.html
http://gpshousefinder.com/car-insurance-in-jacksonville-florida.html http://fernbycooper.com/insurance-accidental-damage.html http://inyectronicawc.com/cig-insurance-pay-online.html http://fernbycooper.com/under-21-insurance.html http://inyectronicawc.com/what-is-car-insurance-in-uk.html
http://inyectronicawc.com/classic-car-insurance-aaa.html http://prairiecatering.com/sheilas-wheels-car-insurance-quote.html http://fernbycooper.com/reliance-genral-insurance.html http://maqme.com/cheap-insurance-drift-car.html http://gpshousefinder.com/the-general-car-insurance-las-vegas.html
http://inyectronicawc.com/bareboat-charter-insurance.html http://prairiecatering.com/cheap-car-insurance-in-redford-mi.html http://inyectronicawc.com/how-to-buy-damaged-cars-from-insurance-companies.html http://fernbycooper.com/classical-car-insurance.html http://gpshousefinder.com/auto-insurance-fraud-statute-of-limitations.html http://gpshousefinder.com/auto-insurance-and-suspended-license.html
http://fernbycooper.com/vehicle-insurance-check-online.html http://maqme.com/which-recommended-car-insurers.html http://fernbycooper.com/farmers-insurance-san-francisco.html http://inyectronicawc.com/new-jersey-state-dept-of-insurance.html
insurance leads auto insurance update use them car insurance online expensive injured insurance auto time using insurance auto contents inside california including cheap car insurance credit
http://gpshousefinder.com/rating-factors-for-car-insurance.html http://maqme.com/auto-insurance-lexington-ky.html http://fernbycooper.com/trustees-insurance.html http://maqme.com/what-do-you-need-to-get-a-car-insurance-quote.html http://prairiecatering.com/cheap-auto-insurance-in-nc.html http://gpshousefinder.com/florida-state-auto-insurance-laws.html
http://gpshousefinder.com/auto-insurance-midland-tx.html http://maqme.com/low-cost-temp-car-insurance.html http://gpshousefinder.com/auto-insurance-agent-in-toronto.html http://fernbycooper.com/insurance-agent-recruitment.html http://maqme.com/car-insurance-cheap-quotes-uk.html http://fernbycooper.com/naperville-insurance.html
http://gpshousefinder.com/rules-of-car-insurance.html http://prairiecatering.com/asda-online-exclusive-car-insurance-cancellation.html http://inyectronicawc.com/breakdown-car-cover.html http://maqme.com/car-insurance-lancaster-sc.html http://prairiecatering.com/florida-car-insurance-rental.html http://inyectronicawc.com/auto-insurance-oxford-ms.html http://fernbycooper.com/auto-insurance-montclair-ca.html
http://inyectronicawc.com/what-is-the-average-car-insurance-for-a-17-year-old.html http://inyectronicawc.com/average-car-insurance-rates-in-detroit.html http://gpshousefinder.com/no-car-insurance-in-nj.html http://prairiecatering.com/nagico-car-insurance-bvi.html http://inyectronicawc.com/kemper-insurance-agent-login.html http://inyectronicawc.com/direct-auto-insurance-virginia-beach.html
http://fernbycooper.com/insurance-for-festivals.html http://fernbycooper.com/twin-city-insurance.html http://gpshousefinder.com/types-of-discounts-on-car-insurance.html http://inyectronicawc.com/insurance-agency-new-york.html http://fernbycooper.com/how-to-sell-a-insurance-policy.html http://gpshousefinder.com/insurance-regulation-in-a-nutshell.html http://inyectronicawc.com/car-insurance-quotes-hunter.html http://inyectronicawc.com/a-and-e-insurance.html
http://gpshousefinder.com/progressive-auto-insurance-robert-taylor.html http://fernbycooper.com/rio-national-insurance.html http://prairiecatering.com/auto-insurance-claims-adjuster.html http://inyectronicawc.com/cleaning-service-insurance.html http://inyectronicawc.com/cost-u-less-insurance-fresno.html http://inyectronicawc.com/insurance-to-use-a-gym.html http://inyectronicawc.com/logan-county-insurance-paris-ar.html http://fernbycooper.com/esquire-insurance.html
http://fernbycooper.com/bulding-insurance.html http://maqme.com/cheapest-car-insurance-jersey-city.html http://fernbycooper.com/home-insurance-nova-scotia.html
http://gpshousefinder.com/does-car-leasing-come-with-insurance.html http://maqme.com/auto-insurance-gloucester-va.html http://maqme.com/cheap-car-insurance-quotes-in-sc.html http://fernbycooper.com/auto-and-genral.html http://gpshousefinder.com/progressive-auto-insurance-hudson-ny.html http://inyectronicawc.com/hunt-insurance.html http://prairiecatering.com/car-insurance-qld-cgu.html http://fernbycooper.com/mid-check-car-insurance.html
http://maqme.com/cheap-auto-insurance-under-200.html http://maqme.com/how-do-i-cancel-my-auto-insurance-policy-and-get-a-refund.html http://fernbycooper.com/acceptance-quotes.html http://www.prairiecatering.com/ http://maqme.com/auto-insurance-code-426-in-n-j.html
http://maqme.com/progressive-auto-insurance-elyria.html http://inyectronicawc.com/cheap-health-insurance-for-full-time-students.html http://inyectronicawc.com/expert-views-of-auto-insurance-rate-regulation.html http://gpshousefinder.com/cheap-car-insurance-escondido-ca.html http://inyectronicawc.com/nj-auto-insurance-claims.html http://gpshousefinder.com/what-is-premium-on-car-insurance.html http://fernbycooper.com/insurance-for-mobiles.html
http://prairiecatering.com/what-is-the-best-car-insurance-in-hawaii.html http://www.gpshousefinder.com/ http://inyectronicawc.com/safe-auto-locations.html http://maqme.com/car-insurance-quotes-co.html http://inyectronicawc.com/buying-cars-from-insurance-companies.html http://inyectronicawc.com/argus-insurance-yakima.html http://maqme.com/vehicle-insurance-hawaii.html
http://maqme.com/santa-fe-auto-insurance-quotes.html http://prairiecatering.com/comprehensive-car-insurance-quotes-aami.html http://prairiecatering.com/guaranteed-auto-protection-insurance.html http://fernbycooper.com/d-o-insurance-quotes.html http://maqme.com/equity-auto-insurance-company.html http://gpshousefinder.com/the-apartment-insurance.html
http://maqme.com/cheap-insurance-in-mesquite-tx.html http://fernbycooper.com/kitten-insurance.html http://maqme.com/car-insurance-quote-telephone.html http://fernbycooper.com/sole-proprietor-insurance.html http://maqme.com/a-american-auto-insurance-winter-park-fl.html http://gpshousefinder.com/low-insurance-quotes.html http://inyectronicawc.com/cheap-insurance-companies-in-missouri.html
http://fernbycooper.com/success-insurance.html http://inyectronicawc.com/diamond-insurance-car.html http://inyectronicawc.com/car-rsa.html
http://maqme.com/vehicle-insurance-for-business-use.html http://fernbycooper.com/progresive-car-insurance.html http://fernbycooper.com/imsurance-quotes.html http://prairiecatering.com/gap-insurance-on-autos.html http://prairiecatering.com/auto-insurance-in-huntington-park-ca.html http://gpshousefinder.com/will-a-remap-affect-my-insurance.html
http://maqme.com/jacksonville-fl-auto-insurance-companies.html http://fernbycooper.com/car-insurance-boise.html http://gpshousefinder.com/car-lease-hire-with-insurance.html http://maqme.com/car-insurers-isle-of-man.html http://gpshousefinder.com/can-i-get-road-tax-with-temporary-car-insurance.html
http://fernbycooper.com/cheap-car-insurance-in-phoenix.html http://gpshousefinder.com/unitrin-auto-insurance.html http://gpshousefinder.com/the-universal-insurance-co–ltd.html
???CANopen???????????????????????CANopen?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????EDS??????????????? ugg ?? ???
Thanks again for the blog.Really looking forward to read more. Want more.
It’s an remarkable piece of writing in favor of all the internet users; they will get benefit from it I am sure.