Friday, October 10, 2008

Internationalization with Cocoa

So It looks like 2/5's of my downloads are from outside of the US, and the majority of my initial comments are Internationalization related. So, I looked to internationalize, and it is as easy as it should be! But most of the Documentation is Reference based, not examples. And well, I much prefer to steal and refactor examples than to understand and learn, so I put these forth for future Internationalization people to steal from!

This Document Is the official documentation for Internationalization. Good, dry reading.

These 3 steps are all I needed to do:

1) Convert XIB files:
- Internationalize XIB files. Select the XIB file in XCode, click the info button, and under general press 'Make Localized'
- Extract strings: ibtool -L MainWindow.xib > ./MainWindow.strings
- Translate: See Post below!
- Re-create new XIB File:ibtool -d de.lproj/MainMenu.strings English.lproj/MainMenu.nib -W French.lproj/MainMenu.nib
2) Use NSLocalizedString wherever you have a user-visible string to display
- Modify Code to use NSLocalizedString
- Generate a Localized.strings file auto-matically with: genstrings -o t1 *.m
This tool is very cool, it actually parses your code and looks for where you use NSLocalizedString and it generates your key/value pairs from the code!
- Translate and copy Localized.strings into the .lproj directories
3) Use the Localized interfaces on any API objects you have.
- For me, the only object was the NSNumberConverter. I was using a direct number converter, and I realized that it took care of things for all locales even easier!

formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setLocale:[NSLocale currentLocale]];




I applaud Apple in their toolchain. It's great that I can develop great user-friendly Apps in a developer-friendly environment!

Anyone else have any Internationalization Tips?

Internationalization Assistance!

Hi,
If you would like Tally Up to be localized for your language, please translate the following strings and post below! This is one problem that I never really thought I'd have to tackle, but almost 2/5ths of downloads are coming from outside the US!

That's a cool problem in my book!

Actions
Active Tallies
Name
Cost
Split By
Paid By
Expense Totals
Specify People
Create New Expense
Current Expenses
No Expenses
Tally Summary
Send Tally
Email Tally Summary
Add Person to Tally
People in Tally
No People Specified
Quick Add
Name or Initials
From Contacts
Nobody
Required
Must Enter Cost

The following I want to put some context around since a direct translation may not work:

<Name> owes <Amount>
<Name> is owed <Amount>
<Amount> for <Expense Name>
<Name> is out

Thanks for your help.

Wednesday, September 17, 2008

First iPhone App Submitted!

After a fair deal of wrestling with the submission process, Tally Up has been submitted to the App store. I hope that some people discover it and find it useful!

Many Thanks to:

David Russell
Steve Beckwith
Jamie Sutton