The WebTranslateIt Blog · Page 34

i18n news and Product Updates about WebTranslateIt · Page 34

i18next

By Edouard on December 22, 2011

i18next is a third-party i18n Javascript library you might find useful for localizing Javascript in your application.

Add the i18next.js after the jquery JavaScript.

<script type="text/javascript" src="jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="i18next-[version].js"></script>

Add your resourcefile under /locales/en-US/translation.json. Translations are stored in a JSON hash compatible with WebTranslateIt’s JSON.

{
    "app": {
        "name": "i18n"
    },
    "creator": {
        "firstname": "Jan",
        "lastname": "Mühlemann"
    }
}

Init and use the module:

$.i18n.init({}, function(t) { // will init i18n with default settings and set language from navigator
    var appName = t('app.name'); // -> i18n
    var creator = t('creator.firstname') + ' ' + t('creator.lastname'); // -> Jan Mühlemann
});

web_translate_it rubygem v1.9.2 released

By Edouard on December 21, 2011

I just released a new version of the web_translate_it gem, the open-source synchronization tool for Web Translate It.

This version 1.9.2 introduces a few bug fixes and improvements.

Improvements

  • wti now includes a library to connect to the String and Translation APIs. This improvement was contributed by @bray.

This greatly facilitates building tools around WebTranslateIt to manipulate strings and translations. Developers can have a look at WebTranslateIt::String and WebTranslateIt::Translation classes.

  • The configuration file lookup (the -c option) was improved. Configuration files can now be located in another directory, and wti commands don’t have to be executed in the root directory. It is now possible to execute:
$ wti pull
$ wti pull -c /Users/edouard/code/test/.wti
$ wti pull -c ../.wti
$ wti pull -c ~/code/.wti

Bug fixes

  • wti init was crashing on empty projects without a source locale. It now returns an error message.
  • wti pull was failing for requests made after a 102 Processing. This status code meant that the file was currently being processed and couldn’t be fetched. In order to fix this bug, the 102 Processing status code was replaced by 503 Service Unavailable server side. The client now handles 503 errors and wti pull doesn’t skip files after attempting to pull an unavailable file.
  • wti status wasn’t working properly.

Install or Upgrade

To install web_translate_it, please refer to the gem documentation.

To upgrade web_translate_it to its latest version, type in a terminal: gem install web_translate_it.

Update 21/12/2011: I just released wti v1.9.3, which fixes a small incompatibility with old versions of ruby (ruby < 1.9).

API Update

By Edouard on December 21, 2011

Following last month’s API update, I added a new endpoint to WebTranslateIt’s String API: String List.

This new endpoint lets you query your project and fetch strings. You can query by key name, label, category names, status, creation date and file.

The String Create endpoint was also improved: you can now create Translations while creating a String by passing an optional array of Translations. Check the documentation for more information.

Proofreading enhancements

By Edouard on December 8, 2011

I just improved the proofreading feature of WebTranslateIt. I added the ability to attribute proofreading rights to translators, and the ability to proofread empty translations in a very simple way.

Proofreading rights

When inviting a translator, you can now choose whether or not this translator has proofreading rights in the translation interface.

As usual, the translation interface with proofreading rights includes proofreading and unproofreading buttons:

Translators without proofreading rights won’t have access to these buttons:

Finally, when a translator without proofreading rights updates a proofread translation, the translation will automatically be set to “unproofread”:

After saving translation, the translation is flagged as “unproofread”:

Proofread empty translations

It is sometimes useful to proofread empty translations. For instance, a specific segment doesn’t need to be translated to other languages languages, and you want to validate this emptiness.

You can now easily proofread empty translations.

I hope you will find these improvements useful. Thank you for using WebTranslateIt.