using tr8n & translation exchange with ruby on rails
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.comTRANSCRIPT
Translation ExchangeCrowdsourced Translations as a Service
translationexchange.com
Using Tr8n & Translation Exchange
with Ruby on Rails
Internationalize and Translate quickly with Crowdsourced Translations as a Service
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
Tr8nSDK
Cache
Translation Exchange Approach
Your Application
.Files, Memcache, Redis, etc.
Shared Translation MemoryTranslation Management
UI Widgets
APITr8nSDK
Cache
Translation Exchange Approach
TranslationExchange.com
● 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
Shared Translation MemoryOur Shared Translation Memory is a massive database of
translated phrases shared across all applications connected to our platform.
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
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.
Installation & Configuration
Installation & Configuration
gem 'tr8n_client_sdk', '~> 4.1'
Add the following line to your Gemfile:
And run:
$ bundle
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:
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:
<%= tr("Hello World") %>
Translation MarkupLanguage
Translation Markup Language
Simple and extensible syntax
Platform and technology independent
Improves code readability
Code completion support (coming soon)
<%= 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
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
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}) %>
DEMO
Who is using Tr8n?
and many more
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)
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]