0:00:00Hello, and welcome to Developing Perspective.
0:00:03Developing Perspective is a podcast discussing news of note in Iowa's development, Apple,
0:00:07and the like.
0:00:08I'm your host, David Smith.
0:00:09I'm an independent iOS developer based in Herne, Virginia.
0:00:12This is show number 82, and today is Tuesday, September 25th.
0:00:16Developing Perspective is never longer than 15 minutes, so let's get started.
0:00:19All right, so this is going to be the next in the series of episodes that I'm going to
0:00:24be talking about the new app I'm working on.
0:00:26It's a weather app.
0:00:27I think I've never mentioned its name before, and I'm going to do that now.
0:00:33The app is called Check the Weather, so that's hopefully being a little bit playful, because
0:00:37I know what I do many times a day is I'm always like, "Oh, let me check the weather.
0:00:41Let me check the weather."
0:00:42So that's what I named the app.
0:00:43And so this is going to be the next thing in the series of posts I've been doing about
0:00:49how I've been building it, some of the considerations that go into that.
0:00:53And these are very developer-oriented, and hopefully I've gotten a lot of good feedback
0:00:56from people who say it's really great to kind of see the inner workings of how, how you
0:00:59actually go about building something like this.
0:01:02And so I'm going to keep doing that.
0:01:03And today I'm going to be talking about localization.
0:01:06And this is something that I've never done before.
0:01:08And if you're a long time listener of Developing Perspective, you'll know that about, I think
0:01:12about two months ago, a month and a half ago, it was something that I talked about and I
0:01:15did an episode about, talking about how I struggle with that.
0:01:19And it's something that I've sort of always thought, oh man, I really wish I did, or I
0:01:23really think I should, or those types of things.
0:01:25But the reality is I never have.
0:01:27And I've been doing this for four, four and a half years now.
0:01:30I mean, it's a long time I've been making apps.
0:01:32I've never done any localization work at all.
0:01:35And so it was kind of like, well, why isn't that?
0:01:37Why aren't I doing this?
0:01:38It seems like if I look at my sales,
0:01:40at least 25% of my users probably
0:01:45don't speak English as their first language.
0:01:47And that's just basically, you know, of app sales.
0:01:50Certainly the United States is the largest market.
0:01:52In my experience, it's at least 50 to 60% of app sales
0:01:55probably in the United States, at least of my apps.
0:01:58Obviously that's probably different for different types of apps.
0:02:02Then you have the next big ones are Canada, the United Kingdom, Australia, New Zealand,
0:02:06which all of course speak English.
0:02:08There are sort of slight differences in terms of spelling or terms or things like that.
0:02:14And then you start to get into all the rest of the world.
0:02:16And so you start to talk about other big countries like Germany, France, Spain, Italy.
0:02:22And so the list goes on from there.
0:02:23Japan.
0:02:24I mean, there are a lot of countries with a lot of phones and a lot of users who may
0:02:30struggle to use your app if you only are providing it in English.
0:02:33And so this is kind of a process of taking your application.
0:02:38I mean, I'm sort of starting from a place of that many of the people who listen to this
0:02:43are English speakers.
0:02:45And obviously that's based on the fact that I only ever do episodes in English.
0:02:48And so even if English is not your second language, in order for this to be useful to
0:02:52you, you probably speak English.
0:02:57But it's taking that sort of that basis of saying,
0:03:00here's an app that's in English,
0:03:03and I'm going to try and make it feel comfortable,
0:03:05to feel natural, and to be appealing to a user
0:03:07in another part of the world.
0:03:11And so this is sort of that process,
0:03:12and this is how it went.
0:03:14And at first, on the outset, I'll say,
0:03:16I was surprised, and pleasantly so,
0:03:17about how easy, or maybe easy is the wrong word,
0:03:18how straightforward it was to do a localization of this app.
0:03:22The app is fairly simple, and a lot of it's graphical and number-based, so it's not too
0:03:27hard.
0:03:28But overall, the tools and the process that I had to go through to actually make this
0:03:31happen was fairly straightforward.
0:03:33And so I was pretty happy with that.
0:03:36And so this is kind of how it worked.
0:03:38So to start with, the way you do localization, primarily in sort of cocoa development, iPhone,
0:03:45iPhone, Mac, I think it's the same,
0:03:50is there's a concept of an NS localized string.
0:03:52And this is basically just a key value store
0:03:56that you associate with your application,
0:04:01where rather than providing text in terms of a static string,
0:04:03so say this is a button called refresh,
0:04:07usually either in a NIMF file or in a source code,
0:04:10you would say, you know, button dot, you know, set title,
0:04:14you know, ampersand, quote, refresh, close quote,
0:04:19and you would give it that literal string.
0:04:21And all you do for localization is rather than
0:04:23hard coding that value directly, you pass in that,
0:04:27you can certainly do it this way,
0:04:28or you can do it in a variety of different ways,
0:04:30but the simplest way is you rather than passing
0:04:31that string indirectly, you pass that token
0:04:35to a function called NSLocalizeString.
0:04:37And what that does is at runtime, rather than just displaying that token directly, it'll
0:04:43run through sort of a key value store or a lookup table that you associate with your
0:04:49application that has a bunch of translations.
0:04:52So if you're in English, it will display whatever the value associated with that token is in
0:04:58English.
0:04:59And if you're in Japan, it will be Japanese.
0:05:00And if you're in France, it will be French.
0:05:02And it's actually not based on the country you're in.
0:05:04It's based on the language that the device is set to.
0:05:07So that's probably a subtle distinction,
0:05:09but it's important that it's not about where the user is,
0:05:11it's about what the user has told their phone
0:05:14or their iPad to display.
0:05:17And then it displays it, and that's really all you do.
0:05:20I mean, the process I went through is probably sort of,
0:05:22it's not great, but it works pretty well,
0:05:25is I just went through my app, I did a global search,
0:05:28and when I came to time to sort of go through
0:05:30and do the localization, I just did a global search
0:05:33for all my literal strings, and I just looked through them,
0:05:37and all the ones that made sense to actually localize.
0:05:40I just went in, changed the token.
0:05:42I changed that from doing a direct string literal
0:05:45to NSLocalizedString.
0:05:47And I did the sort of lazy approach
0:05:48where you make the token start off as the English string.
0:05:53So a lot of my string, my tokens are just literals.
0:05:56And then you give a comment.
0:05:58And the comment is important.
0:05:59It's the second parameter to the NSLocalizedString function.
0:06:02But the importance about the comment
0:06:04is that's an opportunity that you
0:06:05you have to tell the translator, to tell somebody who's looking at this token, what it means
0:06:10in context.
0:06:11And that's important often for localization because this translator is trying to give
0:06:16you not just like a raw translation, they're trying to give you a relevant translation.
0:06:21So it's not, you know, a lot of words in English especially can have multiple meanings in multiple
0:06:26contexts.
0:06:27And so you want to give as much context.
0:06:28So rather than necessarily it being refresh and then you just your comment is a refresh
0:06:33which is completely useless, you can say,
0:06:38"A button pressed when the user is trying to refresh
0:06:40the displayed information."
0:06:44And the translation for that may be different
0:06:46in a different language than if it was a different kind
0:06:48of refresh, than if it was, I don't even know.
0:06:51But it's like you're trying to give as much context
0:06:54to that as you can.
0:06:57And then basically that's it.
0:06:59And then you go into Xcode and you say,
0:07:00"I'm going to generate some strings files."
0:07:01And there's a little tool called Gen Strings that comes with Xcode or the developer tools.
0:07:06I think it may be part of the command line tools for a set, but it's pretty straightforward
0:07:09once you get Gen Strings, and that's G-E-N strings, that's one word.
0:07:13And you just run that over your source code or your nib files or all kinds of things,
0:07:18and it'll output what Xcode calls a strings file.
0:07:22And that's just a dot strings file as the extension.
0:07:26basically a look-up table of comment, token equals value.
0:07:30And that's it.
0:07:33And it's just in a very simple format
0:07:35that's machine parsable and all that.
0:07:38And basically that's it.
0:07:38Once you've got that, you've generated your strings file,
0:07:41you now have the basis of what you need
0:07:43to do your localization.
0:07:44That's what you're going to send to a translator.
0:07:46That's what you're going to work through.
0:07:48One thing I will say,
0:07:49just before I get too far ahead of myself,
0:07:52in an ideal world, you probably make your tokens
0:07:54more meaningful and more generic.
0:07:59I've run into this a little bit myself,
0:08:02where I have these very funny things
0:08:03because my tokens were just direct English words
0:08:05rather than actually being tokens
0:08:08in a more abstract sense.
0:08:10So rather than saying refresh,
0:08:15I could have said refresh button title as my token,
0:08:16which isn't what would be displayed to the user.
0:08:22And in the English localization,
0:08:20need to go and set the value of that.
0:08:25But the thing that's often what you'll end up with is,
0:08:27the lazy approach is just to use your English words as the tokens.
0:08:30But what that means is, of course,
0:08:33if you want to change the copy in your app,
0:08:35you're going to end up with these very strange things
0:08:38where the token isn't abstract.
0:08:39It's a very literal token, it's refresh,
0:08:43but it's actually going to turn into update.
0:08:45So you have this refresh equals update in your strings file,
0:08:46which is a little weird.
0:08:51So that's just in an ideal sense, in a true sense,
0:08:53which would probably be wise to do,
0:08:56is to make your tokens abstract.
0:08:58So then the next thing I did is you have your strings file,
0:09:00you just want to look at it, make sure it's good and clean
0:09:03and parsed, and you're ready to go.
0:09:05There's a great tool that I found for doing that.
0:09:08This is by Oliver Drobnik.
0:09:10You probably know him online as Coconetics,
0:09:12and he has a tool called Linguin,
0:09:14which I have a link to in the show notes.
0:09:12And basically, this is a tool for managing strings files.
0:09:15It doesn't do really much beyond that.
0:09:17But what it's really great for doing is it can look at your
0:09:22Xcode project file and look at the strings files that you
0:09:24have, tell you what tokens you're missing, what tokens
0:09:27you have, and kind of just lays them out in a nice grid
0:09:30format, which I find really helpful.
0:09:32So I highly recommend that if you're going to do any
0:09:33localization work.
0:09:34It's in the Mac App Store.
0:09:35It's pretty inexpensive.
0:09:37It's just a great little tool for kind of managing this.
0:09:40So the next process, once you have your strings files,
0:09:45is you're going to need to take those and get them translated.
0:09:48And there's a variety of ways you could do that.
0:09:50You could ask friends, customers, people you know.
0:09:52If you're a linguist yourself, maybe you can just do them yourself.
0:09:55But basically what you're going to be doing is trying to take all those tokens and translate them.
0:09:58What I ended up doing is I was looking for a variety of sources for services for doing this.
0:10:02And I posted on Twitter and I got a lot of recommendations and feedback.
0:10:06And there seems like there's maybe four main vendors for doing this.
0:10:11There's Applingua, WordCraft, iCanLocalize, and Tetris.
0:10:17And I'm not sure if that's how you say it, the T-E-T-H-R-A-S,
0:10:21which is actually the one I went with.
0:10:25And basically all of these services take in a strings file.
0:10:27They're very iOS oriented.
0:10:30So they take a strings file directly, they parse it,
0:10:32they manage it on their servers,
0:10:32and they help kind of work you through that process.
0:10:34They do different amounts of hand-holding, and what I ended up doing is I went with Tetris
0:10:40because they were a nice managed approach.
0:10:45And by that I mean I'm not interacting with my translators directly.
0:10:49I'm not trying to do quality assurance or project management or any of those types of
0:10:53things.
0:10:54You know, they're taking care of that for you, and you pay a slight premium for that.
0:10:57I think it's about 10 to 18 cents a word, which seemed pretty middle of the road.
0:11:02You can go a little bit cheaper if it's something like I can localize, but I feel like you're
0:11:06doing a bit more of that.
0:11:08You're deeper in the process, which for me, I'd rather spend a little bit of extra money.
0:11:12It's not a huge amount, and I'd rather spend that little bit of extra money to have someone
0:11:16manage that for me who's done this before, who can interact with translators in a way
0:11:19that makes sense.
0:11:20So I'm going to talk about my experience with them and how that went.
0:11:25And so basically, I created an account with them,
0:11:28pretty straightforward.
0:11:29I uploaded my strings file.
0:11:30I had written an app description that I also submitted.
0:11:33So they translated that, and I'll
0:11:34include that in my iTunes Connect
0:11:36when I submit it so that if you're in that country,
0:11:38you can read a description in your language, which I hope
0:11:41is kind of useful and nice to them.
0:11:43I'm probably also going to actually do the English one
0:11:45below it, just in case you also speak English
0:11:47or in case there's something funny in the translation
0:11:50that hopefully that'll help.
0:11:52But I submitted both of those.
0:11:54I had a pretty low word count, it wasn't too bad.
0:11:56The actual app itself only has 122 words
0:11:59for translation, which is not too bad.
0:12:02And like I said, a lot of that's just,
0:12:04the nature of the app isn't very word-based.
0:12:07And most of those are actually in the settings
0:12:08or tutorial areas of the app.
0:12:09They're not actually part of the functional part,
0:12:12because most of the functional part
0:12:14is either graphics or displaying numbers.
0:12:16It's 26 degrees and 18% chance of rain.
0:12:18And so basically I just went through,
0:12:21submitted them all, picked the languages I want.
0:12:23I just kind of did, I guess you could sort of call the big five or the big six, depending
0:12:28on how you want to look at it.
0:12:29I did German, French, Italian, Japanese, and Chinese, and submitted those.
0:12:36And Spanish, sorry.
0:12:37So those were my six.
0:12:39And just sort of submit them.
0:12:41You sort of go through, you buy it.
0:12:44You're paying by word.
0:12:45It's all upfront pricing, which was great.
0:12:47And you just kind of wait a day or two.
0:12:49I mean, I was very impressed by the turnaround time.
0:12:51It was only, I think the longest translation was my Japanese one and it took probably about
0:12:5548 hours from when I hit submit.
0:12:58A lot of them were coming in quicker than that and it was just great.
0:13:01I mean, the way they do it, which I think a lot of them do, there's this nice little
0:13:05kind of interactivity with the translators that's asynchronous and sort of low stress,
0:13:11but a lot of times the translators will find little questions or sort of questions or hiccups
0:13:15or things that they're not sure about.
0:13:17And so rather than just kind of guessing,
0:13:20they can create what they call discussion questions
0:13:23in their system, and I think a bunch of people
0:13:25do a similar kind of thing, where they'll ask you a question
0:13:27and they'll say, "Hey, so I see I can't find,
0:13:31"so if I'm translating this word,
0:13:32"there's like two or three different ways
0:13:34"I could translate it, which of these sort of meanings
0:13:36"or contexts will, you know, would work best for you
0:13:39"in this context?"
0:13:40And you can insert and go back and forth,
0:13:42or they'll sometimes be like, "Here's two options,
0:13:44"this one's shorter, but this one's,
0:13:46"this longer one's better."
0:13:47So if you have space, use the longer one.
0:13:49If it's, basically, a problem, use a shorter one.
0:13:51And that was basically it.
0:13:52Now I had my translated list of things,
0:13:56some things that made that process go better,
0:13:58really good comments, and submitting
0:14:00screenshots of your app.
0:14:01I think translators really like being able to see where
0:14:04that word is going in context.
0:14:05So two things you can really do to help them out,
0:14:08and having nice clean strings.
0:14:11So now I have my strings.
0:14:12I pop them into Xcode, and that's it.
0:14:15Now my app is localized into seven languages, I guess, six foreign and one English, and
0:14:20it's seemed to work pretty great.
0:14:22I can launch it in those apps and it looks great.
0:14:24I don't really speak those languages, so it's hard for me to know necessarily of the quality
0:14:27of the translation.
0:14:28But going through one of these managed vendors, the goal is that a lot of that quality has
0:14:33been taken care of because they've been QA'd internally by their linguists or by two linguists
0:14:38or by someone who at least knows what's going on.
0:14:39And so that's all.
0:14:41That's all I did, and it's great.
0:14:42and I look forward to seeing what that does for my sales abroad. Hopefully it increases them. That's certainly the goal.
0:14:47Alright, that's it for today's show. As always, if you have questions, comments, concerns, or complaints,
0:14:52I'm on Twitter @_DavidSmith. And otherwise, I hope you have a great week, happy coding, and I will talk to you soon. Bye.