KartikTalwar/gmail.js — pull request #40 by g8g3 (2014-03-02 03:37:53+00:00)
Title: Added api.tools.i18n() for internationalization.

Label strings depending on user's locale are referred inside that function.

I know this could be improved several ways, however this is the "cleanest" and easiest way I found for a quick solution to a locale handling need.

The actual dictionary could be declared statically (at least if locale changes are not supposed to make that dynamic), but at this point I didn't want to pollute the API and tried to keep everything inside my additional function.

I placed calls to this function were concerned labels were being matched.

Also the dictionary could be more complex and structured for more labels, but right now that's all that is used for DOM path reference.
I declared English and French strings.