All Projects → blueberryapps → translation-engine

blueberryapps / translation-engine

Licence: MIT license
A Rails engine for sending and receiving translations from Translation Server

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
coffeescript
4710 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to translation-engine

Abraham
Trackable application tours for Rails with i18n support
Stars: ✭ 52 (+271.43%)
Mutual labels:  i18n, rails-engine
translation-server
Stores translations with location and screenshot. Enable users to easily edit translations and then any rails/react application can use them.
Stars: ✭ 26 (+85.71%)
Mutual labels:  translation-server, blueberry-opensource
django-i18nfield
Store internationalized strings in Django models with full forms support
Stars: ✭ 32 (+128.57%)
Mutual labels:  i18n
bcp-47-normalize
Normalize, canonicalize, and format BCP 47 tags
Stars: ✭ 16 (+14.29%)
Mutual labels:  i18n
laravel-query-localization
Easy Localization for Laravel
Stars: ✭ 50 (+257.14%)
Mutual labels:  i18n
spring-javafx-material-design-admin
Aplicação desktop para Gerenciamento de estoque e vendas com Spring Boot, JavaFX e Material Design
Stars: ✭ 56 (+300%)
Mutual labels:  i18n
i18n-demo
A simple i18n demo app with Angular and expressjs
Stars: ✭ 12 (-14.29%)
Mutual labels:  i18n
simple-translator
Simple, universal translation with pure JavaScript.
Stars: ✭ 58 (+314.29%)
Mutual labels:  i18n
springboot-chapter
🚀Spring Boot 2.0基础教程。主流框架整合,实践学习案例。
Stars: ✭ 23 (+64.29%)
Mutual labels:  i18n
caffeinate
A Rails engine for drip campaigns/scheduled email sequences and periodic emails.
Stars: ✭ 216 (+1442.86%)
Mutual labels:  rails-engine
andaluh-js
Transliterate español (spanish) spelling to andaluz proposals using javascript
Stars: ✭ 22 (+57.14%)
Mutual labels:  i18n
generator-react-web
Yeoman generator for creating interactive web sites with React and Redux + Webpack, Flow, ES7+, Babel, Yarn, npm Scripts, i18n, Redux Saga, SCSS, CSS Modules
Stars: ✭ 35 (+150%)
Mutual labels:  i18n
mkdocs-static-i18n
MkDocs i18n plugin using static translation markdown files
Stars: ✭ 78 (+457.14%)
Mutual labels:  i18n
nuxt-i18n-example
nuxt-i18n showcase project based on nuxt-starter template
Stars: ✭ 67 (+378.57%)
Mutual labels:  i18n
svelte-intl
Internationalize your Svelte apps using format-message and Intl object
Stars: ✭ 48 (+242.86%)
Mutual labels:  i18n
webpay rails
WebpayRails is an easy solution for integrate Transbank Webpay in Rails applications
Stars: ✭ 16 (+14.29%)
Mutual labels:  rails-engine
lp-loader
Frictionless language packs for Webpack.
Stars: ✭ 14 (+0%)
Mutual labels:  i18n
arabic-mathjax
Beautiful Arabic Math on all browsers. An extension for MathJax v2.
Stars: ✭ 12 (-14.29%)
Mutual labels:  i18n
mobility-actiontext
Translate Rails Action Text rich text with Mobility.
Stars: ✭ 27 (+92.86%)
Mutual labels:  i18n
next-intl
A minimal, but complete solution for internationalization in Next.js apps. 🌐
Stars: ✭ 242 (+1628.57%)
Mutual labels:  i18n

TranslationEngine Dependency Status

gem 'translation_engine', git: 'https://github.com/blueberryapps/translation-engine.git'

Configuration

Default configuration is that all part are turned off, so for enabling you need to create file config/initializers/translation_engine.rb with this content:

# config/initializers/translation_engine.rb

TranslationEngine.config do |config|
  # key for user
  config.api_key  = 'API_KEY'

  # url to Translation Server
  config.api_host = 'http://127.0.0.1:3000'

  # enable screenshot functionality (default is false)
  config.use_screenshots  = true

  # enable to send translation after every request and receive translations
  # when something changed (default is false)
  config.use_catcher      = true

  # for production envs you don't want to send translations
  # so if use_catcher is true you can disable sending them by this option:
  config.disable_sending_translations = true

  # Timeout for connecting to translation server
  # config.timeout = 5

  # Set time between asking translation server for new data, (default is 0)
  config.cache_timeout = 60 # ask translation server every 60s for new data

  # If true TranslationEngine will throw exceptions on connection problems
  # If false TranslationEngine will just log exception to Rails.logger
  config.raise_exceptions = Rails.env.development?
end

Releases

# list all possible releases
I18n.backend.releases

# list all possible release which has same locale as I18n.locale
I18n.backend.current_locale_releases

Switch release on frontend

- I18n.backend.current_locale_releases.each do |release|
  = link_to release.version.upcase,
            { translation_release: release.version },
            class: ('active' if release.current?)

Screenshots Integration

Javascript

Require javascript by inserting app/assets/javascripts/application.js

//= require translation_engine/screenshots

or in views = javascript_include_tag 'translation_engine/screenshots' (this javascript is already precompiled, so you don't need to do anything else)

Ensure that you have jquery + coffeescript (or similar gems which provides same function)

gem 'coffee-rails'
gem 'jquery-rails'

Stylesheets

Require stylesheets by inserting app/assets/stylesheets/application.sass:

@import 'translation_engine/screenshots'

or in views = stylesheet_link_tag 'translation_engine/screenshots' (this stylesheet is already precompiled, so you don't need to do anything else)

Start translations screenshoting

Create element with class translation_engine_start. When you click on this element, Translation Engine will start screenshoting page and then sends all images + highlights to server /transaltion_engine which will be catched by ScreenshotsMiddleware and then send to TranslationServer.

or

Use callback window.TranslationEngine.start()

Show translations and keys + link to translation server

Create element with class translation_highlight_start.

When you click on this element, Translation Engine will show keys instead of text to all translated text in page and it will add link to translation server.

or

Use callback window.TranslationEngine.highlight()

Rake tasks

rake translation_engine:list:releases

List all available releases from Translations Server

rake translation_engine:pull:master

Download all master translations from Translations server and store them into config/locales/z_translation_engine.yml

rake translation_engine:pull:release RELEASE=en_v001

Download released translations from Translations server and store them into config/locales/z_releases/(release_locale).yml, will overwrite previous locale release, leaving allways only one release.

Architecture of service

Catcher

Catcher is middleware in rails APP which catches all used translations in page and then it sends them into Translation Server.

Screenshots

Screenshots middleware takes highlights and images which sends into Translation Server.

Publishing

gem build translation_engine.gemspec
gem push translation_engine-0.0.5.gem
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].