README.md in i18n-tasks-0.2.3 vs README.md in i18n-tasks-0.2.4

- old
+ new

@@ -1,6 +1,6 @@ -# 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) +# i18n-tasks [![Build Status](https://travis-ci.org/glebm/i18n-tasks.png?branch=master)](https://travis-ci.org/glebm/i18n-tasks) [![Coverage Status](https://coveralls.io/repos/glebm/i18n-tasks/badge.png?branch=master)](https://coveralls.io/r/glebm/i18n-tasks?branch=master) [![Code Climate](https://codeclimate.com/github/glebm/i18n-tasks.png)](https://codeclimate.com/github/glebm/i18n-tasks) Tasks to manage translations in Rails. ![i18n-screenshot](https://raw.github.com/glebm/i18n-tasks/master/doc/img/i18n-tasks.gif "i18n-tasks output screenshot") @@ -92,9 +92,28 @@ write: # this would save all devise keys in it's own file (per locale): - ['devise.*', 'config/locales/devise.%{locale}.yml'] # this is the default catch-all: - 'config/locales/%{locale}.yml' # path is short for ['*', path] +``` + +Key matching syntax work this way: + +| syntax | description | +|:------------:|:----------------------------------------------------------| +| `*` | matches everything | +| `:` | matches a single key | +| `{a, b.c}` | match any in set, can use `:` and `*`, match is captured | + +Example: + +```yaml +data: + write: + # store sorcery and simple_form keys in the respective files: + - ['{sorcery,simple_form}.*', 'config/locales/\\1.%{locale}.yml'] + # write every namespace to its own file: + - ['{:}.*', 'config/locales/\1.%{locale}.yml'] ``` ### Translation Set `GOOGLE_TRANSLATE_API_KEY` environment variable, or specify the key in config/i18n-tasks.yml: