I18n Yaml Editor
I18n Yaml Editor is based on IYE. I18n Yaml Editor makes it easy to translate your Rails I18N files and keep them up to date. It uses YAML files directly, so you don't need to keep a separate database in sync. This has several benefits:
- Branching and diffing is trivial
- It does not alter the workflow for developers etc., whom can continue editing the YAML files directly
- If your YAML files are organized in subfolders, this structure is kept intact
Prerequisites
You need to understand a few things about I18n Yaml Editor for it to make sense, mainly:
- I18n Yaml Editor does not create new keys - keys must exist for at least one locale in the YAML files
- I18n Yaml Editor does not create new locales - at least one key must exist for each locale in the YAML files
Workflow
Install I18n Yaml Editor:
$ git clone [email protected]:Sage/i18n_yaml_editor.git $ cd i18n_yaml_editor $ gem build i18n_yaml_editor.gemspec $ gem install i18n_yaml_editor-1.3.1.gem
The
i18n_yaml_editor
executable is now available, use it wherever you want.$ i18n_yaml_editor path/to/i18n/locales [port]
At this point I18n Yaml Editor loads all translation keys for all locales, and creates any keys that might be missing for existing locales, the default port is 5050
Point browser at http://localhost:5050
Make changes and press 'Save' - each time you do this, all the keys will be written to their original YAML files.
Review your changes before committing files, e.g. by using
git diff
.
Development
Getting started
$ git clone [email protected]:Sage/i18n_yaml_editor.git
$ cd i18n_yaml_editor
$ gem install bundler
$ bundle install
$ SIMPLE_COV=true bundle exec guard
License
This gem is available as open source under the terms of the MIT licence.
Copyright (c) 2018 Sage Group Plc. All rights reserved.