WTF is a Resource Bundle?

I have friends who talk about and use “resource bundles”, internationalization, i18N, etc.

You need this when your site needs to support multiple languages. The company I work for is BIG into internationalization, since we support five countries – four languages per country. Wow!

As I delved into this new world of internationalization, I learned something — I was completely clueless as to WHAT a resource bundle and a resource bundle editor actually is, and does. See, I thought a resource bundle editor actually *translates* a string into whatever language you want it translated to. Heck, it’s 2008, right? Why not??

Well, it doesn’t quite work like that.

A resource bundle is a simple text file, with keys and values for those keys. It can be a simple as this

fname=Will
lname=Tomlinson
age=38

OK, looks simple enough, right? Well it is! You’ll have a base properties file, then you create different files per language.

So, what does a resource bundle editor really do? I can tell ya one thing … it does NOT translate a string into another language.

When working with internationalization, a resource bundle simply manages the entire set of files. What if you want to change the name of a key? Normally, you’d need to go into each file, and change the key name.

Not so with a resource bundle editor. You can change it in one file, and it’ll update all the other files for you. How nice!

Another key thing an editor does for you is it converts your characters to their appropriate entities, so they display properly on a webpage. When the editor generates your new resource files, open them up. You’ll see a lot of funky codes.

Here’s the editor I’ve been using with success:

www.attesoro.com

CFEclipse also has a built-in resource bundle editor. Nice work Mark!

So remember, resource bundles simply manage files. That’s all they do. You need to do the translations yourself.

If I’m the only dummy that didn’t realize this, please pardon my post!  :)

No comments yet

Leave a reply