Tml for Ruby on Rails
-
Upload
michael-berkovich -
Category
Technology
-
view
99 -
download
0
Transcript of Tml for Ruby on Rails
![Page 1: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/1.jpg)
translationexchange.com
Powered by Translation Exchange
Translation Markup Language for Ruby on Rails
![Page 3: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/3.jpg)
Localization is cumbersome
translationexchange.com
![Page 4: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/4.jpg)
There are many standards, but little guidance.
“
![Page 5: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/5.jpg)
Every i18n framework has its own “right way” of doing things, with a different syntax and file format.
Developers often hack together their own solutions to try and simplify the process.
No universality in the current standards
![Page 6: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/6.jpg)
Android .xmlApple .stringsApple .plistGettext .poGettext .potJava .properties Java .xmlMicrosoft .resxMicrosoft .reswMicrosoft .resjsonMicrosoft .aspx
FILE FORMATSLots of translation
Microsoft .rcPHP .iniPHP .confBabel Flash .xmlBlackberry .rrcNSIS .inshQT Linguist .tsLatex .latexDocbook .dbkTBX .tbxTMX .tmx
XLIFF .xliffYouTube .sbvRails YAML .yamlSubtitles .srtMicroDVD .subSubviewer .subMozilla Web L10NText .txtCSV SpreadsheetExcel SpreadsheetWord Document
![Page 7: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/7.jpg)
Extract content into files
Upload files to a TMS or an LSP
Wait... Download translated files
Put translations back in your app
Repeat when new content is added or changed
BOTTLENECKFile management is a
![Page 8: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/8.jpg)
File Management● Not DRY (Don’t Repeat Yourself)
● Requires content extraction, sync with a TMS or an LSP
● Mini “waterfalls” in the agile process
● Slows down development cycle and releases
● High upfront cost and maintenance
![Page 9: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/9.jpg)
How can we make itBETTER FOR EVERYONE
![Page 10: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/10.jpg)
What would an ideal solution look like?
● ConsistencyProvide tools that offer a clear and
consistent way for internationalizing
content across all frameworks
● AdaptabilityTools must be extensible and adaptable
and should be able to solve any arising
internationalization and localization
problem
● ContextualizationAllow translators to translate in context
from within the application
● AgilityKeep the development cycle agile -
localization must not add significant
overhead for developers - it must be done
in parallel to the development process
![Page 11: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/11.jpg)
あA
Translation Management Service
Global CDNLocal Cache
Application with SDK
A Better WayA truly automated and continuous localization
![Page 12: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/12.jpg)
Translation Cachingstatic and dynamic cache adapters for storing translations in your application
Inline Translation ToolsTranslation can be done in context of the application
Access Professional TranslatorsConnect your application to thousands of professional translators around the world
Open Sourceall SDKs are available on github
Multiple Platformssupport for Rails, Node, PHP, Python, iOS, Android and more
Universal Translation MemoryTranslations are shared across all applications
translationexchange.com
Core Benefits
![Page 13: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/13.jpg)
Getting Started
translationexchange.com
![Page 14: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/14.jpg)
gem 'tml-rails'
Integration
# Gemfile
translationexchange.com
![Page 15: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/15.jpg)
Configuration
# initializers/tml.rb
Tml.configure do |config|config.application = {
key: “YOUR_APPLICATION_KEY”}
end
translationexchange.com
# layouts/application.html.erb
<%= tml_scripts_tag %>
<%= tml_language_selector_tag(:flags) %>
![Page 16: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/16.jpg)
Translation Markup LanguageDeveloper friendly syntax for marking up application content. Supports language context rules and language cases, making translations significantly more accurate for any language.
translationexchange.com
![Page 17: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/17.jpg)
Hello World
<%= tr('Hello World') %>
translationexchange.com
Translation Markup Language
![Page 18: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/18.jpg)
tr('Eats shoots and leaves', 'a panda')
Eats shoots and leaves
tr('Eats shoots and leaves', 'a violent restaurant patron')
Translation Markup LanguageDescription & Context
![Page 19: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/19.jpg)
Hello Michael
translationexchange.com
Translation Markup LanguageData Tokens & Interpolation
<%= tr('Hello {name}', {name:'Michael'}) %>
![Page 20: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/20.jpg)
Hello Michael
<%= tr('Hello [bold: {user}]', { user: current_user
}) %>
translationexchange.com
Translation Markup LanguageDecoration Tokens
![Page 21: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/21.jpg)
Hello Michael
<%= tr('Hello <strong>{user}</strong>', { user: current_user }) %>
translationexchange.com
Translation Markup LanguageDecoration Tokens
![Page 22: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/22.jpg)
Hello Michael
<%= tr('Hello [bold: {user}]', { user: current_user,
bold: '<strong>{$0}</strong>' }) %>
translationexchange.com
Translation Markup LanguageDecoration Tokens
![Page 23: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/23.jpg)
You have 5 messages
<%= tr(You have {count || message}', { count: 5
}) %>
translationexchange.com
Translation Markup LanguagePluralization
![Page 24: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/24.jpg)
Michael uploaded 3 photos
<%= tr('{user} uploaded {count || photo}', { user: current_user, count: 3 }) %>
translationexchange.com
Translation Markup LanguagePluralization
![Page 25: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/25.jpg)
Michael liked Anna’s post
<%= tr('{actor} liked {target::pos} post', { actor: current_user, target: other_user }) %>
translationexchange.com
Translation Markup LanguageLanguage Cases
![Page 26: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/26.jpg)
This is your second warning
<%= tr(This is your {count::ord} warning', { count: 2}) %>
translationexchange.com
Translation Markup LanguageLanguage Cases
![Page 27: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/27.jpg)
Michael completed 3 miles on his last run.
<%= tr('[link: {user}] completed [bold: {count || mile}] on {user | his, her} last run.', { user: current_user, link: { href: user_path }, count: 3}) %>
translationexchange.com
Translation Markup Language
![Page 28: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/28.jpg)
Demo❏ Use TML SDK to localize an online recipes application❏ Demonstrate crowdsourced localization tools❏ Deploy translation release and update application realtime❏ Download release snapshot and run Foody independently from the
service
translationexchange.com
![Page 29: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/29.jpg)
How is Translation Done?
translationexchange.com
Machine Translationprovided by Google, Microsoft and Yandex. Translations are ranked to get the best result.
Crowdsourced TranslationSome developers may choose to use their own users to translate their content, similar to how Facebook and Twitter translated their sites.
Professional TranslationOrder are received and processed by our partners and are made available in our system within hours.
![Page 30: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/30.jpg)
Caching Options
translationexchange.com
Static CacheFile based cache. Loaded into the process memory and must be deployed with the source code. Each process contains the entire translation cache.
$ bundle exec rake tml:cache:generate
Dynamic CacheRedis, Memcached (and others) updated from CDN release. Cache is shared across all processes. Can be deployed without restarting servers.
$ bundle exec rake tml:cache:upgrade
![Page 31: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/31.jpg)
SDKs https://github.com/translationexchangeDocumentation http://translationexchange.com/docsBlog http://blog.translationexchange.comFoody Source https://github.com/translationexchange/tml-rails-samples-foodyFoody Live http://foody.translationexchange.comFacebook https://www.facebook.com/translationexchangeTwitter @translationxFeedback [email protected]
translationexchange.com
Resources
![Page 32: Tml for Ruby on Rails](https://reader033.fdocuments.in/reader033/viewer/2022051521/5878ea7f1a28abfa038b6755/html5/thumbnails/32.jpg)
Thank YouFind out more at translationexchange.com
translationexchange.com