|
1 | | -<% require './lib/i18n_tasks/js_erb_locale_matcher.rb' %> |
2 | | -<% require './lib/i18n_tasks/slim_row_locale_matcher.rb' %> |
3 | | - |
4 | | -# i18n_tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks |
5 | | - |
6 | | -# The "main" locale. |
7 | | -base_locale: en |
8 | | -## All available locales are inferred from the data by default. Alternatively, specify them explicitly: |
9 | | -# locales: [es, fr] |
10 | | -## Reporting locale, default: en. Available: en, ru. |
11 | | -# internal_locale: en |
12 | | - |
13 | | -# Read and write translations. |
14 | | -data: |
15 | | - ## Translations are read from the file system. Supported format: YAML, JSON. |
16 | | - ## Provide a custom adapter: |
17 | | - # adapter: I18n::Tasks::Data::FileSystem |
18 | | - |
19 | | - # Locale files or `Find.find` patterns where translations are read from: |
20 | | - read: |
21 | | - ## Default: |
22 | | - # - config/locales/%{locale}.yml |
23 | | - ## More files: |
24 | | - # - config/locales/**/*.%{locale}.yml |
25 | | - - config/locales/%{locale}/*.yml |
26 | | - - config/locales/%{locale}/**/*.yml |
27 | | - |
28 | | - # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: |
29 | | - # `i18n_tasks normalize -p` will force move the keys according to these rules |
30 | | - write: |
31 | | - - ['{application,breadcrumbs,locales,navigation,shared,will_paginate,activerecord.errors}.*', 'config/locales/%{locale}/meta/\1.yml'] |
32 | | - - ['activerecord.:.{admin,code_ocean}.{:}.*', 'config/locales/%{locale}/\1/\2.yml'] |
33 | | - - ['*.{*:}/:.*', 'config/locales/%{locale}/\1.yml'] |
34 | | - - ['activerecord.:.{*:}s?.*', 'config/locales/%{locale}/\1.yml'] |
35 | | - - ['{admin,code_ocean,linter,mailers}.{:}.*', 'config/locales/%{locale}/\1/\2.yml'] |
36 | | - - ['{*:}s?.*', 'config/locales/%{locale}/\1.yml'] |
37 | | - ## Catch-all default: |
38 | | - # - config/locales/%{locale}/unsorted.yml |
39 | | - |
40 | | - # External locale data (e.g. gems). |
41 | | - # This data is not considered unused and is never written to. |
42 | | - external: |
43 | | - ## Example (replace %#= with %=): |
44 | | - # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml" |
45 | | - |
46 | | - ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. |
47 | | - # router: conservative_router |
48 | | - |
49 | | - yaml: |
50 | | - write: |
51 | | - # do not wrap lines at 80 characters |
52 | | - line_width: -1 |
53 | | - |
54 | | - ## Pretty-print JSON: |
55 | | - # json: |
56 | | - # write: |
57 | | - # indent: ' ' |
58 | | - # space: ' ' |
59 | | - # object_nl: "\n" |
60 | | - # array_nl: "\n" |
61 | | - |
62 | | -# Find translate calls |
63 | | -search: |
64 | | - ## Paths or `Find.find` patterns to search in: |
65 | | - paths: |
66 | | - - app/ |
67 | | - - spec/ |
68 | | - - app/assets/javascripts/ |
69 | | - |
70 | | - ## Root directories for relative keys resolution. |
71 | | - # relative_roots: |
72 | | - # - app/controllers |
73 | | - # - app/helpers |
74 | | - # - app/mailers |
75 | | - # - app/presenters |
76 | | - # - app/views |
77 | | - |
78 | | - ## Directories where method names which should not be part of a relative key resolution. |
79 | | - # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key. |
80 | | - # Directories listed here will not consider the name of the method part of the resolved key |
81 | | - # |
82 | | - # relative_exclude_method_name_paths: |
83 | | - # - |
84 | | - |
85 | | - ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: |
86 | | - ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less |
87 | | - ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx |
88 | | - exclude: |
89 | | - - app/assets/images |
90 | | - - app/assets/fonts |
91 | | - - app/assets/videos |
92 | | - - app/assets/builds |
93 | | - - spec/fixtures |
94 | | - |
95 | | - ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: |
96 | | - ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. |
97 | | - # only: ["*.rb", "*.html.slim"] |
98 | | - |
99 | | - ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. |
100 | | - # strict: true |
101 | | - |
102 | | - ## Allows adding ast_matchers for finding translations using the AST-scanners |
103 | | - ## The available matchers are: |
104 | | - ## - RailsModelMatcher |
105 | | - ## Matches ActiveRecord translations like |
106 | | - ## User.human_attribute_name(:email) and User.model_name.human |
107 | | - ## |
108 | | - ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`. |
109 | | - # <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %> |
110 | | - |
111 | | - ## Multiple scanners can be used. Their results are merged. |
112 | | - ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. |
113 | | - ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example |
114 | | - |
115 | | -## Translation Services |
116 | | -# translation: |
117 | | -# # Google Translate |
118 | | -# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate |
119 | | -# google_translate_api_key: "AbC-dEf5" |
120 | | -# # DeepL Pro Translate |
121 | | -# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro |
122 | | -# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A" |
123 | | -# # deepl_host: "https://api.deepl.com" |
124 | | -# # deepl_version: "v2" |
125 | | -# # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/ |
126 | | -# deepl_options: |
127 | | -# formality: prefer_less |
128 | | -## Do not consider these keys missing: |
129 | | -ignore_missing: |
130 | | - - 'linter.*' |
131 | | - |
132 | | -## Consider these keys used: |
133 | 1 | ignore_unused: |
134 | | - - 'activerecord.{attributes,errors,models}.*' |
135 | | - - 'linter.*' |
136 | | - - 'will_paginate.*' |
137 | | - |
138 | | -## Exclude these keys from the `i18n_tasks eq-base' report: |
139 | | -# ignore_eq_base: |
140 | | -# all: |
141 | | -# - common.ok |
142 | | -# fr,es: |
143 | | -# - common.brand |
144 | | - |
145 | | -## Exclude these keys from the `i18n_tasks check-consistent-interpolations` report: |
146 | | -ignore_inconsistent_interpolations: |
147 | | - - 'shared.errors_one' |
148 | | - - 'shared.errors_other' |
149 | | - |
150 | | -## Ignore these keys completely: |
151 | | -# ignore: |
152 | | - |
153 | | - |
154 | | -## Sometimes, it isn't possible for i18n_tasks to match the key correctly, |
155 | | -## e.g. in case of a relative key defined in a helper method. |
156 | | -## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.: |
157 | | -# |
158 | | -# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', |
159 | | -# only: %w(*.html.haml *.html.slim), |
160 | | -# patterns: [['= title\b', '.page_title']] %> |
161 | | -# |
162 | | -# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.: |
163 | | -# |
164 | | -# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', |
165 | | -# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %> |
| 2 | +- 'local_time.*' |
0 commit comments