Recently Loot’s iOS app had a bug which only occured on certain locale settings. As Loot only uses GBP at this time, we expect all payments the user makes from the app (some people call them transfers, but the accurate banking term is payments) to be formatted in the GBP way - GBP symbol immediately next to the pounds unit, period seperating pounds and pence - £23.42.
So it turned out that the bug was caused by an NSNumberFormatter taking on the locale settings of the user’s device rather then us setting it manually, which in turn caused us not to be able to read the amount of money that the user would like to make a payment in as we couldn’t read the format. Simple fix.
The interesting part was that we then started looking at how we can test against this problem in the future in our UI Tests. It turns out that running your UITests in multiple locales is very easy. It looks like this:
This is the exact same as setting the local settings on your Xcode scheme.
Next we wanted to be able to run every one of our UITests in a select few locales. Again, easy:
You can print out the availble language codes like this: