Here we go again… Today is December 12, 2012 in the Gregorian calendar, and people are waxing poetic about how symmetrical, how repetitive and how unique this date is. (Even people who really should know better.) Some people are even getting married today. I wish them the best of luck.
But let me put my science hat on for a moment, and offer the following statement:
The symmetry / reflexivity / repetitiveness / uniqueness of a date expression such as 12/12/12, 11/11/11 etc. ad nauseam, is not axiomatic. It is an artefact of the presentation layer.
In layman’s terms:
It’s not really like that, it’s just written that way.
It all started with an idea, something to scratch a personal itch. I was learning elementary French, and realized that there is an algorithmic approach to generating the numbers. Not a very elegant algorithm, but one that could easily be turned into a computer program.
The idea turned into a function, and soon enough it turned into an iPhone app, now called Les Nombres and available from the App Store (and also for Windows Phone). My function takes a nonnegative integer and turns it into a French language string, which is displayed on the screen. It could be fed into a speech synthesizer, but in Les Nombres the numbers are recordings of a native French speaker, which I think is nice. (And I couldn’t use recordings of Apple’s “Virginie” voice from OS X anyway due to its license.)
To keep things simple, Les Nombres only deals with the numbers 0 to 100, even though my function could do up to 1,000 out of the box. It involves some 90 lines of Objective-C code, including two recursive calls. It was fun to write, and I learned something in the process, but ultimately I didn’t have to write it at all. Continue reading
If this blog entry was written 10–15 years ago, the title would have been “Unicode is in Your Future“. Luckily, the Unicode standard has been widely adopted during the last decade, so much so that it has almost become a part of the process and not something that you need to expend very much extra effort on. It is here Now, and has been for some time now.
However, Unicode still isn’t quite as widely understood as it needs to be, and it is often adopted as a black box that nobody can really fix when something goes wrong. Therefore it is not at all bad to try and bring it into perspective.
You need to understand at least why Unicode should be used, and how not to make it more complicated than it is (even though it can still be quite complicated). So keep reading.
For many of us, dates and times are absolutely essential in our daily lives. We make appointments, set deadlines, celebrate birthdays and anniversaries, and generally mark time using clocks and calendars.
What makes dates and times interesting from a programmer’s perspective is that while there is a standard time (the Coordinated Universal Time or UTC), there are multiple local time zones in use all over the world. A single instance in UTC has many local equivalents, and offsets between time zones and universal time are wild and wonderful.
Not only are time zones a little tricky, but there are also multiple local representations for an instance in local time. A representation in this context means the way it is printed in a daily newspaper, in the calendar, and indeed, on the screen of a computer or a mobile device. In the realm of internationalization (I18N) they are known as date and time formats.
The conventions for showing local time are well established, and the differences between them are significant enough to cause a lot of confusion if care is not taken. While it would be the most logical thing to do (thank you Mr. Spock), it is hardly practical to expect all the world’s population to adopt a single standard date and time format such as the ISO 8601 international standard notation in their daily lives. The national and linguistic conventions are very well established locally.
Just recently, Nokia launched new Windows Phone devices in their Lumia series. The company wanted to build anticipation before the announcement with short teaser videos which all marked the date of the launch: 05.09.2012. If you saw this date advertised early in the year, you might think it could mean either September 5th or May 9th this year. But which is it? Continue reading
When you have some numbers that you need to show in your user interface, you shouldn’t just stick them in a string using whatever old library function you happen to have. Especially
printf in C,
toString in Java, and others like these are only suitable for debugging, because they have no idea about how to format numbers properly according to the user’s regional settings. The ways to write numbers have differences across languages and countries, especially with the characters used to separate the whole part and the decimal part, and also with regard to how large numbers are grouped to make them easier to read. Luckily you don’t have to figure out the details yourself.
Instead of traditional programmer-style functions, use the convenient API methods provided by your platform. They do all the heavy lifting and work out the details for you. For example, in iOS you use
NSNumberFormatter class from the Foundation framework. Since iOS 4.0 it has offered a very nice way to get a locale-specific representation of a number so that it honors the current user settings.
NSNumberFormatter has a class method called
localizedStringFromNumber:numberStyle:, so you can use it without even creating an instance of the class.
Many of you know already that we make a little app called Les Nombres for iPhone and Windows Phone to help you learn French numbers. It was originally created in late 2010 for the iPhone, to help the author who was learning French for the first time. The realization that an algorithmic approach would work in generating textual representations of numbers in French led to a simple but delightful iPhone application. Since its initial publication in the App Store as a free, ad-supported app it has been downloaded a few thousand times.
With version 1.2 the name of the application was changed to a more suitable “Les Nombres”, with the numbers being read by a native French speaker. This update sparked most of those people who had originally downloaded the app to update it to the latest version. Starting with version 1.3 the app costs US $ .99 (0.79 €)—and stay tuned for a nice little update later this year. (EDIT: the update is now available)
We thought it would be interesting to take a closer look at where the app was being downloaded from. The iTunes Connect report data from between late April and mid-July 2012 was used as the basis of this chart (select it to view full-size).
Les Nombres for iPhone Downloads By Country
The UEFA EURO 2012, or the European football championship, is close to the end of group stage as I write this. (That would be “soccer” to U.S. readers.) As usual, I have been delighted to notice that UEFA has done a great job in getting the names of the various international players presented as accurately as possible, both on the UEFA.com website and in the mobile apps they’ve published.
UEFA’s good track record with names has been going on for a long time; I first noticed this when I started to follow the UEFA Champions League in 2000, when I was already working with software internationalization, and knew enough to pay attention to these things.
In this post I’ll examine what it takes to pull off a task like this – which you may also need to do. Continue reading
It’s summer in the Northern Hemisphere, and at Mobile Monday Tampere tonight we are launching our Summer Specials 2012 offer for developers:
- Free one-hour visit to your application project
- Free half-day introduction to internationalization
Get either one or both! See our Summer Specials 2012 page for terms and conditions.
For more information, to schedule a time and to secure your seat, contact us.
The theme of tonight’s Mobile Monday Tampere is multi-platform development, which is exactly what we do: if your project is based on iOS, Android or Windows Phone, we can advise you on how to make it world-ready.
Many introductory programming courses start with a very simple first program, the traditional “hello world”. It is intended to teach how to edit, compile and run a program in a new programming environment using a simplified context, and it serves its purpose quite well. Unfortunately, the simple practice used in storing and displaying the text is quite contrary to a basic principle of software internationalization. Continue reading