using tr8n & translation exchange with ruby on rails

22
Translation Exchange Crowdsourced Translations as a Service translationexchange.com

Upload: tr8n

Post on 05-Dec-2014

215 views

Category:

Software


1 download

DESCRIPTION

Tr8n is a powerful and robust framework for internationalization. The technology enables developers to quickly offer their sites in hundreds of different languages and integrates with TranslationExchange.com, a cloud based translation service. Tr8n along with TranslationExchange provide for continuous localization. At its core Tr8n removes the need to maintain resource files, and instead uses Translation Markup Language (TML). TML provides a specific syntax for how text should be defined, and is used to identify dynamic data within the text. Tr8n and TML are currently being used by Microsoft, Yammer, MyHeritage, Kongregate and Playpass.To learn more about Tr8n and TranslationExchange visit our website: https://translationexchange.com

TRANSCRIPT

Page 1: Using Tr8n & Translation Exchange with Ruby on Rails

Translation ExchangeCrowdsourced Translations as a Service

translationexchange.com

Page 2: Using Tr8n & Translation Exchange with Ruby on Rails

Using Tr8n & Translation Exchange

with Ruby on Rails

Internationalize and Translate quickly with Crowdsourced Translations as a Service

Page 3: Using Tr8n & Translation Exchange with Ruby on Rails

[email protected]

@translationx

Michael BerkovichCo-founder of TranslationExchange.com

Page 4: Using Tr8n & Translation Exchange with Ruby on Rails

Traditional I18n Approach

Extract text from your app

Upload text to translation service

Wait for text to be translated

Download the translated text

Put the translated files back into your

app and deploy

Page 5: Using Tr8n & Translation Exchange with Ruby on Rails

Tr8nSDK

Cache

Translation Exchange Approach

Your Application

.Files, Memcache, Redis, etc.

Shared Translation MemoryTranslation Management

UI Widgets

APITr8nSDK

Cache

Translation Exchange Approach

TranslationExchange.com

Page 6: Using Tr8n & Translation Exchange with Ruby on Rails

● No need to manage resource files

● Support for over 300 languages

● Integrated & continuous solution

● Shared translation memory

● Translation markup language (TML)

● Advanced translation tools

● Mobile, desktop & web support

Features

Page 7: Using Tr8n & Translation Exchange with Ruby on Rails

Shared Translation MemoryOur Shared Translation Memory is a massive database of

translated phrases shared across all applications connected to our platform.

Page 8: Using Tr8n & Translation Exchange with Ruby on Rails

Tr8n = Tr[anslatio]n

A translation framework for internationalization and localization.

What does it do?

● Translation Markup Language (TML)

● Robust Language Rules Engine

● Translation Caching

● API Access to Shared Translation Memory

Page 9: Using Tr8n & Translation Exchange with Ruby on Rails

Translation Overview

Ranking

Monitoring

States

Both translations and translators have ranks. Developers can set thresholds to limit translations from lower ranking translators.

Bad translations are rejected and translators who submit them are put on a watch list.

Translations have 3 states; Accepted, Pending and Rejected. Translations are accepted if their rank is above the threshold and rejected if below 0.

Page 10: Using Tr8n & Translation Exchange with Ruby on Rails

Installation & Configuration

Page 11: Using Tr8n & Translation Exchange with Ruby on Rails

Installation & Configuration

gem 'tr8n_client_sdk', '~> 4.1'

Add the following line to your Gemfile:

And run:

$ bundle

Page 12: Using Tr8n & Translation Exchange with Ruby on Rails

Installation & Configuration

Tr8n.configure do |config|

config.application = {

:key => "<YOUR_APPLICATION_KEY>",

:secret => "<YOUR_APPLICATION_SECRET>"

}

config.cache = {

:adapter => 'memcache',

:host => 'localhost:11211',

:version => 1,

:timeout => 3600

}

end

Create config/initializers/tr8n.rb and add the following configuration:

Page 13: Using Tr8n & Translation Exchange with Ruby on Rails

Installation & Configuration

Add tr8n scripts to the head section of your main layout:

<head>…<%= tr8n_scripts_tag %>…

</head>

<%= tr("Hello World") %>

Now you can use Tr8n in your application:

Page 14: Using Tr8n & Translation Exchange with Ruby on Rails

<%= tr("Hello World") %>

Translation MarkupLanguage

Page 15: Using Tr8n & Translation Exchange with Ruby on Rails

Translation Markup Language

Simple and extensible syntax

Platform and technology independent

Improves code readability

Code completion support (coming soon)

Page 16: Using Tr8n & Translation Exchange with Ruby on Rails

<%= tr( label, description, tokens, options ) %>

● label - required string

● description - optional context of the label

● tokens - optional hash of tokens; required if tokens are used in the label

● options - optional array of options

TML

Page 17: Using Tr8n & Translation Exchange with Ruby on Rails

TML

Data TokensCurly brackets with a name of a token{token_name: type::case}Supports extensions (Pipes and Methods tokens)

Square brackets with a name of a decoration[token_name] value_to_be_decorated [/token_name][token_name: value_to_be_decorated]

Decoration Tokens

Page 18: Using Tr8n & Translation Exchange with Ruby on Rails

TML Examples

<%= tr("Welcome {user}", {user: @current_user}) %>

<%= tr("You have {count || message}", {count: @messages.size}) %>

<%= tr("{user1} uploaded {count || photo} of {user2}",

{user1: @user1, user2:@user2, count: @photos.size}) %>

<%= tr("[link: Click here] to get started.",

link: {href: new_user_path}) %>

<%= tr("[link1: {actor}] likes [link2: {target::pos}] post.",

link1: {href: actor_path}, link2: {href: target_path}) %>

Page 19: Using Tr8n & Translation Exchange with Ruby on Rails

DEMO

Page 20: Using Tr8n & Translation Exchange with Ruby on Rails

Who is using Tr8n?

and many more

Page 21: Using Tr8n & Translation Exchange with Ruby on Rails

Supported Platforms

● Ruby on Rails ● PHP, Smarty ● JavaScript, Node.JS, Ember, Angular,

Backbone● Objective C, iOS ● Java, J2EE, Struts, Swing, Android● Python (work in progress)● .Net, C# (work in progress)

Page 22: Using Tr8n & Translation Exchange with Ruby on Rails

To Learn More

● Register with Translation Exchange https://translationexchange.com

● Read our documentationhttps://translationexchange.com/docs

● Visit our blog: http://blog.tr8n.io

● Follow us on Twitter: @translationx

● Connect with us on Facebook:https://www.facebook.com/translationexchange

● Contact us:[email protected]