README.md in i18n-tasks-0.2.0 vs README.md in i18n-tasks-0.2.1

- old
+ new

@@ -1,28 +1,55 @@ # i18n-tasks [![Build Status](https://travis-ci.org/glebm/i18n-tasks.png?branch=master)](https://travis-ci.org/glebm/i18n-tasks) [![Code Climate](https://codeclimate.com/github/glebm/i18n-tasks.png)](https://codeclimate.com/github/glebm/i18n-tasks) Rails I18n tasks to find missing / unused translations and more. Works with slim / coffee / haml etc. -![i18n-screenshot](https://raw.github.com/glebm/i18n-tasks/master/doc/img/i18n-tasks.png "i18n-tasks output screenshot") +![i18n-screenshot](https://raw.github.com/glebm/i18n-tasks/master/doc/img/i18n-tasks.gif "i18n-tasks output screenshot") ## Usage Use `rake -T i18n` to get the list of tasks with descriptions. These are [the tasks](/lib/tasks/i18n-tasks.rake) available: - Rake Task | Summary - :---------------------------------------------- |:------------------------------------------------------------------ - i18n:missing | Show missing translations. - i18n:unused | Show unused translations. - i18n:normalize | Normalize translation data: sort by name and file. - i18n:fill:add_missing *[value = key.humanize]* | Add missing `key: value` to base locale. - i18n:fill:with_base *[locales = all - base]* | Add missing `key: base value` to each non-base locale. - i18n:fill:with_google *[locales = all - base]* | Add missing `key: Google Translated value` to each non-base locale. - i18n:fill:with_blanks *[locales = all]* | Add `key: ''` for missing keys to each locale. - -The `i18n:unused` task will detect pattern translations and not report them, e.g.: +There are reports for missing and unused translations: +```bash +rake i18n:missing +rake i18n:unused +``` +To add the keys that are not in the base locale data but detected in the source do: +```bash +# add missing keys to the base locale data (I18n.default_locale) +# values set to key.humanize +rake i18n:add_missing +# or set all values to the task argument +rake i18n:add_missing[OhNoesMissing] +``` + +Prefill empty translations using Google Translate: +```bash +rake i18n:fill:google_translate +# this task and the ones below can also accept specific locales: +rake i18n:fill:google_translate[es+de] +``` +Prefill using values from the base locale - `I8n.default_locale`: +```bash +rake i18n:fill:base_value +``` +Add just blank yaml keys - `key: ''` for all missing and untranslated keys: +```bash +rake i18n:fill:blanks +``` + +i18n-tasks sorts the keys and writes them to their respective files: +```bash +# this happens automatically on any i18n:fill:* task +rake i18n:normalize +``` + + +`i18n:unused` will detect pattern translations and not report them, e.g.: + ```ruby t 'category.' + category.key # 'category.arts_and_crafts' considered used t "category.#{category.key}" # also works ``` @@ -34,10 +61,10 @@ ## Installation Simply add to Gemfile: ```ruby -gem 'i18n-tasks', '~> 0.2.0' +gem 'i18n-tasks', '~> 0.2.1' ``` ## Configuration Configuration is read from `config/i18n-tasks.yml`.