diff options
| -rw-r--r-- | Gemfile.lock | 15 | ||||
| -rw-r--r-- | config/i18n-tasks.yml | 35 |
2 files changed, 33 insertions, 17 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 41ae70f56..2239cf853 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -267,8 +267,8 @@ GEM htmlbeautifier (1.3.1) httparty (0.14.0) multi_xml (>= 0.5.2) - i18n (0.8.1) - i18n-tasks (0.9.13) + i18n (0.8.6) + i18n-tasks (0.9.15) activesupport (>= 4.0.2) ast (>= 2.1.0) easy_translate (>= 0.5.0) @@ -313,7 +313,7 @@ GEM mime-types-data (3.2016.0521) mimemagic (0.3.2) mini_portile2 (2.2.0) - minitest (5.10.1) + minitest (5.10.2) multi_json (1.12.1) multi_test (0.1.2) multi_xml (0.6.0) @@ -406,7 +406,8 @@ GEM activesupport (= 4.2.8) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.2.1) + rainbow (2.2.2) + rake rake (12.0.0) ransack (1.6.5) actionpack (>= 3.0) @@ -515,8 +516,8 @@ GEM teaspoon-jasmine (2.3.4) teaspoon (>= 1.0.0) temple (0.7.7) - terminal-table (1.7.3) - unicode-display_width (~> 1.1.1) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@ -536,7 +537,7 @@ GEM uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) - unicode-display_width (1.1.3) + unicode-display_width (1.3.0) warden (1.2.7) rack (>= 1.0) webmock (3.0.1) diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index 88c02341b..bd3937938 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -1,9 +1,9 @@ # i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks # The "main" locale. -base_locale: en +base_locale: fr ## All available locales are inferred from the data by default. Alternatively, specify them explicitly: -# locales: [es, fr] +locales: [en, fr] ## Reporting locale, default: en. Available: en, ru. # internal_locale: en @@ -18,7 +18,6 @@ data: ## Default: - config/locales/%{locale}.yml ## More files: - - config/locales/*.%{locale}.yml - config/locales/**/*.%{locale}.yml ## Another gem (replace %#= with %=): # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml" @@ -27,13 +26,12 @@ data: # `i18n-tasks normalize -p` will force move the keys according to these rules write: ## For example, write devise and simple form keys to their respective files: - - ['{devise}.*', 'config/locales/devise.%{locale}.yml'] - - ['{simple_form}.*', 'config/locales/simple_form.%{locale}.yml'] + - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml'] ## Catch-all default: - config/locales/%{locale}.yml ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. - # router: convervative_router + # router: conservative_router yaml: write: @@ -67,14 +65,18 @@ search: exclude: - app/assets/images - app/assets/fonts - - app/assets/javascripts + - app/assets/videos ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. - # include: ["*.rb", "*.html.slim"] + # only: ["*.rb", "*.html.slim"] - ## Default scanner finds t() and I18n.t() calls. - # scanner: I18n::Tasks::Scanners::PatternWithScopeScanner + ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. + # strict: true + + ## Multiple scanners can be used. Their results are merged. + ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. + ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example ## Google Translate # translation: @@ -104,3 +106,16 @@ search: ## Ignore these keys completely: # ignore: # - kaminari.* + +## Sometimes, it isn't possible for i18n-tasks to match the key correctly, +## e.g. in case of a relative key defined in a helper method. +## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# only: %w(*.html.haml *.html.slim), +# patterns: [['= title\b', '.page_title']] %> +# +# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %> |
