This past week we’ve been presented with quite a few reasons to make sure that when we develop, we’re thinking globally, not just locally in terms of who’s going to be using and downloading our app:
Certainly the analytics for my latest up – Upload to YouTube – also reflect this fact, which is especially surprising for an ignorant American:
I like to think if my app wasn’t translated for (most) of these languages, it probably wouldn’t get nearly the usage that it’s getting in these markets. Portuguese getting nearly the same usage as English? Pretty crazy.
That being said, I’m sure there are a lot of developers that know how to localize our applications using resx files for the strings. However there’s one part that a lot of us forget about in mobile land – our app in the app list.
There’s some argument for not translating the name, I suppose, things like “BizSaver” don’t exactly translate, but something like “Upload to YouTube” certainly would. As well as “Who Called Me?” and “Social Camera.” So how do we do this? Turns out it’s definitely not straightforward (and the MSDN doco could stand for some revision) – hence the reason I thought a blog post would benefit.
There’s an MSDN article that outlines how to do this quite well, but I thought I’d add in a couple of #protip-esque stuff on to the content there.
Firstly, disregard all the file name copying and all that jazz. Instead, do a little something like this when you configure the C++ projects:
Where my project’s directory structure looks like:
And my app solution looks like this:
So you can see that what this ends up doing w/ the C++ project, is drops the output right in to the WP App’s location so then you can just:
(I’m using a cool extension call File Nesting so I can nest the specific ones under neutral to clean up my Solution Explorer. Not required)
This makes managing the files a LOT easier, instead of doing all the copy-move-renaming alluded to in that MSDN article.
The other thing to note is that the files are NOT placed in the \Resources subdirectory as instructed in the MSDN article. I have commented on the doco in hopes they’ll fix this, but to date I don’t believe they have. If you DO place them in \Resources, it won’t work.
You can follow the instructions on testing your app in the new languages from that MSDN page to watch it in action. But here’s another added gem you get during development when you do this:
To make the above code work you have to add the special preprocessor directives to your C++ project’s configuration since they’re not automatic like they are w/ C# projects. We do this like so:
Yeah that’s right. How often have you deployed a debug version to your phone, had the version from the store installed, and gotten confused as to which was which? No more. Now when you build DEBUG, you can make it show up with “DEBUG” appended to the app name!
So hopefully you can see some usefulness in this. Obviously it doesn’t make sense for all apps, but certainly does if your app is effectively a “command” like my new one.
Enjoy! I’m also going to be doing a post on the Multilingual App Toolkit in the near future and how I’m using that to make Upload to YouTube more globally accessible so stay tuned!