Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexplatteeuw/rosette
rosette
https://github.com/alexplatteeuw/rosette
i18n rails ruby
Last synced: about 3 hours ago
JSON representation
rosette
- Host: GitHub
- URL: https://github.com/alexplatteeuw/rosette
- Owner: alexplatteeuw
- License: mit
- Created: 2023-04-17T16:50:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-28T20:32:29.000Z (19 days ago)
- Last Synced: 2024-10-28T21:29:13.273Z (19 days ago)
- Topics: i18n, rails, ruby
- Language: Ruby
- Homepage:
- Size: 198 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Rosette
Rosette is a Ruby on Rails engine that helps you add missing translations to your application.
If your main app is configured to raise on missing translations, Rosette will catch any `I18n::MissingTranslationData` error and display a form to add the missing translations.
The form includes an input for each available locale set by `config.i18n.available_locales`.
## Installation
Add this line to your application's Gemfile:
```ruby
gem "rosette"
```And then execute:
```bash
$ bundle
```Make sure your app raises error for missing translations in development:
```ruby
# config/environments/development.rbconfig.i18n.raise_on_missing_translations = true
```and that you explicitly set the available locales:
```ruby
# config/application.rbconfig.i18n.available_locales = [:fr, :en]
```Whether you currently use or are interested in starting to use [i18n-task](https://github.com/glebm/i18n-tasks#normalize-data) to normalize your locales files, add this initializer:
```ruby
# config/initializers/rosette.rbRosette.normalize = true
```## Preview
This is how you will be able to add your missing translations for each available locale set in `config/application.rb`:
## CLI
This gem also provides a command line interface. Run `bundle exec rosette` to get the list of all the tasks:
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).