Coding4Fun Blog

Translating for fun and... fun...

Description

Our world is a pretty small place and getting smaller. As a developer, I'd like to make it easier for my users to use my apps, to speak to them in their own language, so to speak.

But that's hard. Getting someone to translate your app, web page, etc can be a pain. And while the community has jumped in in many cases to help out some projects, that's still a hit or miss kind of thing.

That's why I wanted to highlight the Microsoft Translator and show you a couple ways it could be used...

Microsoft Translator - Developer Offerings

Translation is a tool, not a destination. Following up on this philosophy, Microsoft Translator developer offerings provide developers a wide spectrum of translation and language APIs for integration into their applications and services. ...

SNAGHTMLcff12b9

So okay, we have an API. Next? How can this help me, the "do I code or do I sleep" developer?

How about using this service, in part, to automatically translate your Resource files?

RESX Translator with Bing

Logo

This project is a .net Windows Form/Console Application that allows automatic translation of RESX files using Bing's translation web services.

This is a good example of how to use Bing web services and how to work with RESX files.

..."

Lets say we start with Resource file with English strings;

image

Now, let's translate this into Russian...

image

Done!

image

image

And of course you get all the source to see how it's all done...

SNAGHTMLd0d8d16

NOTE: To use this project you'll need to sign up, for free, your own AppID from  http://www.bing.com/developers/createapp.aspx which is really quick and easy;

SNAGHTMLd0f3122

Once you've got your AppID, you can use the API in your own, non-commercial, apps, in the RESX Translator with Bing, etc.

For example, just because I could and thought the API call "Speak" was interesting ("Returns a string which is a URL to a wave stream of the passed-in text being spoken in the desired language") I knocked some throw away code to play with it...

image

And that's it (plus a Service Reference to http://api.microsofttranslator.com/V2/Soap.svc )

What's hilarious is that there's an accent with each language. That if you feed it an English phrase and you set the language to French ("fr") you'll get it back as English, but with a French accent! Not sure if that's an easter egg, but it's pretty funny.

Anyway...

If you just want to play with it a bit and see the API in action, there's even an Microsoft Translator Interactive SDK available

image

You'd think that translation could seem a little boring but once I started playing with it it was actually kind of fun...

The Discussion

  • Ian2

    Cool, thank you!

  • barcode maker

    This is really helpful for programmers while coding on different platform. Thanks for sharing this useful info.

    bar code software
    www.barcodelabelsoftware.net

  • Larry

    I'm the author of a professional localization product for Visual Studio (http://www.hexadigm.com). Unfortunately, until AI is perfected, relying on automated translation isn't something a professional can rely on to translate their app. It's rife with too many problems (shoddy translation, cosmetic issues, incorrect translation of strings with formatting arguments, etc). Of course for those who want to rely on it in spite of the problems (and potential dangers), or who have a legitimate need for it, your post was a welcome introduction.

  • Gong

    You missed the most important thing, native .rc files.
    What about the native .rc files ?

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.