Upgrading Translation Exchange SDKs to the latest release

In this post we will walk you through the steps to upgrade your application to use the most recent Translation Exchange SDKs for Rails, Node.JS and PHP.

Choose the SDK you are using and follow the instructions below.

If you are integrating Translation Exchange SDK for the first time please follow our detailed instructions for Ruby on Rails, Node JS or PHP.

In all previous versions of the SDKs, project token was the only required parameter. Starting with the current SDK version, we are adding project key as an additional required parameter. This change is made to provide additional security features. Your new project key is now available in the integration section of Translation Exchange Dashboard. Your project token stays the same and you do not need to change it.

This SDK upgrade includes improved stability, security and numerous bug fixes. For more information please refer to our documentation section.

Ruby on Rails

Ruby on Rails SDK is distributed using rubygems.org and is available here:

tml-rails

The latest version is 5.0.1 as of September 2015.

Update your Gemfile with the following information:

[shell title=”Gemfile” class=”lang:bash”]
gem ‘tml-rails’, ‘~> 5.0’
[/shell]

In your tml.rb initializer file, please add the following information:

[ruby title=”config/initializers/tml.rb” class=”lang:ruby”]
Tml.configure do |config|
config.application = {
key: ‘PROJECT-KEY’,
token: ‘Existing PROJECT-TOKEN’,
}
end
[/ruby]

Then open your application directory in a terminal and run the following command:

[shell title=”bundler” class=”lang:bash”]
$ bundle install
[/shell]

This will effectively update the tml-rails gem version and its dependencies.

Node.JS

Node.JS SDK is distributed using npmjs.com and is available here:

tml-express

The latest version is 0.3.3 as of September 2015.

Update your package.json with the following information:

[shell title=”package.json” class=”lang:bash”]
“dependencies”: {
“tml-express”: “~0.3.0”
}
[/shell]

For Node JS, we updated the tml.init function to pass the additional project key parameter. Please update your app.js to be similar to the following code snippet:

[js title=”app.js”]
app.use(tml.init({
key: “PROJECT-KEY”,
token: “Existing PROJECT-TOKEN”
}));
[/js]

Under your application directory perform NPM update:

[shell title=”NPM” class=”lang:bash”]
$ npm install
[/shell]

You should see in above command output tml-express and it’s dependency tml-js were upgraded to latest version.

PHP

PHP SDK is distributed using packagist.org and is available here:

trasnlationexchange/tml

The latest version is 3.0.1 as of September 2015.

Update your composer.json file with the following information:

[js title=”composer.json”]
“require”: {
“translationexchange/tml”: “~3.0.0″
}
[/js]

For PHP, please follow code snippet to enter your Key and Token

[php title=”index.php” class=”lang:php”]

“YOUR-KEY”,
“token” => “Existing PROJECT-TOKEN”
)); ?>
[/php]

Please perform composer update under your application folder:

[shell title=”composer”]
$ composer update
[/shell]

Get Started Today!

Create an account to get started now! No credit card required.

Get Started