1 # i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
5 ## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
7 ## Reporting locale, default: en. Available: en, ru.
10 # Read and write translations.
12 ## Translations are read from the file system. Supported format: YAML, JSON.
13 ## Provide a custom adapter:
14 # adapter: I18n::Tasks::Data::FileSystem
16 # Locale files or `Find.find` patterns where translations are read from:
19 - config/locales/en.yml
21 # - config/locales/**/*.%{locale}.yml
23 # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
24 # `i18n-tasks normalize -p` will force move the keys according to these rules
26 ## For example, write devise and simple form keys to their respective files:
27 # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
29 # - config/locales/%{locale}.yml
31 # External locale data (e.g. gems).
32 # This data is not considered unused and is never written to.
34 ## Example (replace %#= with %=):
35 # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
37 ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
38 # router: conservative_router
42 # do not wrap lines at 80 characters
53 # Find translate calls
55 ## Paths or `Find.find` patterns to search in:
59 ## Root directories for relative keys resolution.
67 ## Directories where method names which should not be part of a relative key resolution.
68 # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
69 # Directories listed here will not consider the name of the method part of the resolved key
71 # relative_exclude_method_name_paths:
74 ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
75 ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
76 ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
83 ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
84 ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
85 # only: ["*.rb", "*.html.slim"]
87 ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
90 ## Allows adding ast_matchers for finding translations using the AST-scanners
91 ## The available matchers are:
92 ## - RailsModelMatcher
93 ## Matches ActiveRecord translations like
94 ## User.human_attribute_name(:email) and User.model_name.human
96 ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
97 <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %>
99 ## Multiple scanners can be used. Their results are merged.
100 ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
101 ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
103 ## Translation Services
106 # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
107 # google_translate_api_key: "AbC-dEf5"
108 # # DeepL Pro Translate
109 # # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
110 # deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
111 # # deepl_host: "https://api.deepl.com"
112 # # deepl_version: "v2"
113 # # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
115 # formality: prefer_less
116 ## Do not consider these keys missing:
118 # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
119 # - '{devise,simple_form}.*'
121 ## Consider these keys used:
123 - 'geocoder.search_osm_nominatim.prefix.*'
126 - 'users.auth_failure.*' # OmniAuth provider callback error messages
127 - 'activerecord.attributes.*'
128 - 'activerecord.models.*'
129 - 'activerecord.help.*'
131 - 'datetime.distance_in_words_ago.*'
132 - 'reports.new.categories.*' # double interpolation in reports_helper
133 - 'shared.pagination.*'
135 # - '{devise,kaminari,will_paginate}.*'
136 # - 'simple_form.{yes,no}'
137 # - 'simple_form.{placeholders,hints,labels}.*'
138 # - 'simple_form.{error_notification,required}.:'
140 ## Exclude these keys from the `i18n-tasks eq-base' report:
147 ## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
148 # ignore_inconsistent_interpolations:
149 # - 'activerecord.attributes.*'
151 ## Ignore these keys completely:
155 ## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
156 ## e.g. in case of a relative key defined in a helper method.
157 ## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
159 # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
160 # only: %w(*.html.haml *.html.slim),
161 # patterns: [['= title\b', '.page_title']] %>
163 # The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
165 # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
166 # patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>