{"id":18817316,"url":"https://github.com/blueberryapps/translation-engine","last_synced_at":"2025-04-13T23:00:26.294Z","repository":{"id":28551820,"uuid":"32069111","full_name":"blueberryapps/translation-engine","owner":"blueberryapps","description":"A Rails engine for sending and receiving translations from Translation Server","archived":false,"fork":false,"pushed_at":"2023-01-20T13:58:58.000Z","size":309,"stargazers_count":12,"open_issues_count":16,"forks_count":3,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-27T13:12:34.868Z","etag":null,"topics":["blueberry-opensource","i18n","rails","rails-engine","ruby","translation-engine","translation-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blueberryapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-12T09:43:10.000Z","updated_at":"2025-02-18T13:39:56.000Z","dependencies_parsed_at":"2022-08-09T08:36:35.554Z","dependency_job_id":null,"html_url":"https://github.com/blueberryapps/translation-engine","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Ftranslation-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Ftranslation-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Ftranslation-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Ftranslation-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blueberryapps","download_url":"https://codeload.github.com/blueberryapps/translation-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794565,"owners_count":21162614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blueberry-opensource","i18n","rails","rails-engine","ruby","translation-engine","translation-server"],"created_at":"2024-11-08T00:10:51.956Z","updated_at":"2025-04-13T23:00:26.266Z","avatar_url":"https://github.com/blueberryapps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TranslationEngine [![Dependency Status](https://dependencyci.com/github/blueberryapps/translation-engine/badge)](https://dependencyci.com/github/blueberryapps/translation-engine)\n\n```\ngem 'translation_engine', git: 'https://github.com/blueberryapps/translation-engine.git'\n```\n\n## Configuration\n\nDefault configuration is that all part are turned off, so for enabling you need\nto create file `config/initializers/translation_engine.rb` with this content:\n\n```ruby\n# config/initializers/translation_engine.rb\n\nTranslationEngine.config do |config|\n  # key for user\n  config.api_key  = 'API_KEY'\n\n  # url to Translation Server\n  config.api_host = 'http://127.0.0.1:3000'\n\n  # enable screenshot functionality (default is false)\n  config.use_screenshots  = true\n\n  # enable to send translation after every request and receive translations\n  # when something changed (default is false)\n  config.use_catcher      = true\n\n  # for production envs you don't want to send translations\n  # so if use_catcher is true you can disable sending them by this option:\n  config.disable_sending_translations = true\n\n  # Timeout for connecting to translation server\n  # config.timeout = 5\n\n  # Set time between asking translation server for new data, (default is 0)\n  config.cache_timeout = 60 # ask translation server every 60s for new data\n\n  # If true TranslationEngine will throw exceptions on connection problems\n  # If false TranslationEngine will just log exception to Rails.logger\n  config.raise_exceptions = Rails.env.development?\nend\n```\n\n## Releases\n\n```\n# list all possible releases\nI18n.backend.releases\n\n# list all possible release which has same locale as I18n.locale\nI18n.backend.current_locale_releases\n```\n### Switch release on frontend\n\n```slim\n- I18n.backend.current_locale_releases.each do |release|\n  = link_to release.version.upcase,\n            { translation_release: release.version },\n            class: ('active' if release.current?)\n```\n\n## Screenshots Integration\n\n### Javascript\nRequire javascript by inserting `app/assets/javascripts/application.js`\n```\n//= require translation_engine/screenshots\n```\nor in views `= javascript_include_tag 'translation_engine/screenshots'`\n(this javascript is already precompiled, so you don't need to do anything else)\n\nEnsure that you have jquery + coffeescript\n(or similar gems which provides same function)\n\n```ruby\ngem 'coffee-rails'\ngem 'jquery-rails'\n```\n\n### Stylesheets\nRequire stylesheets by inserting `app/assets/stylesheets/application.sass`:\n\n```\n@import 'translation_engine/screenshots'\n```\n\nor in views `= stylesheet_link_tag 'translation_engine/screenshots'`\n(this stylesheet is already precompiled, so you don't need to do anything else)\n\n### Start translations screenshoting\nCreate element with class `translation_engine_start`.\nWhen you click on this element, Translation Engine will start screenshoting page\nand then sends all images + highlights to server `/transaltion_engine` which\nwill be catched by `ScreenshotsMiddleware` and then send to TranslationServer.\n\nor\n\nUse callback `window.TranslationEngine.start()`\n\n### Show translations and keys + link to translation server\nCreate element with class `translation_highlight_start`.\n\nWhen you click on this element, Translation Engine will show keys instead of text to all\ntranslated text in page and it will add link to translation server.\n\nor\n\nUse callback `window.TranslationEngine.highlight()`\n\n## Rake tasks\n\n### `rake translation_engine:list:releases`\n\nList all available releases from Translations Server\n\n\n### `rake translation_engine:pull:master`\n\nDownload all master translations from Translations server and store them\ninto config/locales/z_translation_engine.yml\n\n### `rake translation_engine:pull:release RELEASE=en_v001`\n\nDownload released translations from Translations server and store them\ninto config/locales/z_releases/(release_locale).yml,\nwill overwrite previous locale release, leaving allways only one release.\n\n## Architecture of service\n\n![Catcher](./readme/catcher.png)\n\nCatcher is middleware in rails APP which catches all used translations in page\nand then it sends them into Translation Server.\n\n![Screenshots](./readme/screenshots.png)\n\nScreenshots middleware takes highlights and images which sends into Translation\nServer.\n\n## Publishing\n\n```\ngem build translation_engine.gemspec\ngem push translation_engine-0.0.5.gem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueberryapps%2Ftranslation-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueberryapps%2Ftranslation-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueberryapps%2Ftranslation-engine/lists"}