main
1# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
2
3# The "main" locale.
4base_locale: en
5## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
6# locales: [es, fr]
7## Reporting locale, default: en. Available: en, ru.
8# internal_locale: en
9
10# Read and write translations.
11data:
12 ## Translations are read from the file system. Supported format: YAML, JSON.
13 ## Provide a custom adapter:
14 # adapter: I18n::Tasks::Data::FileSystem
15
16 # Locale files or `File.find` patterns where translations are read from:
17 read:
18 ## Default:
19 # - config/locales/%{locale}.yml
20 ## More files:
21 # - config/locales/**/*.%{locale}.yml
22
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
25 write:
26 ## For example, write devise and simple form keys to their respective files:
27 # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
28 ## Catch-all default:
29 # - config/locales/%{locale}.yml
30
31 # External locale data (e.g. gems).
32 # This data is not considered unused and is never written to.
33 external:
34 ## Example (replace %#= with %=):
35 # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
36
37 ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
38 # router: conservative_router
39
40 yaml:
41 write:
42 # do not wrap lines at 80 characters
43 line_width: -1
44
45 ## Pretty-print JSON:
46 # json:
47 # write:
48 # indent: ' '
49 # space: ' '
50 # object_nl: "\n"
51 # array_nl: "\n"
52
53# Find translate calls
54search:
55 ## Paths or `File.find` patterns to search in:
56 # paths:
57 # - app/
58
59 ## Root directories for relative keys resolution.
60 # relative_roots:
61 # - app/controllers
62 # - app/helpers
63 # - app/mailers
64 # - app/presenters
65 # - app/views
66
67 ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
68 ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
69 exclude:
70 - app/assets/images
71 - app/assets/fonts
72 - app/assets/videos
73
74 ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
75 ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
76 # only: ["*.rb", "*.html.slim"]
77
78 ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
79 # strict: true
80
81 ## Multiple scanners can be used. Their results are merged.
82 ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
83 ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
84
85## Translation Services
86# translation:
87# # Google Translate
88# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
89# google_translate_api_key: "AbC-dEf5"
90# # DeepL Pro Translate
91# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
92# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
93
94## Do not consider these keys missing:
95# ignore_missing:
96# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
97# - '{devise,simple_form}.*'
98
99## Consider these keys used:
100ignore_unused:
101- 'activemodel.*'
102- 'activerecord.*'
103# - '{devise,kaminari,will_paginate}.*'
104# - 'simple_form.{yes,no}'
105# - 'simple_form.{placeholders,hints,labels}.*'
106# - 'simple_form.{error_notification,required}.:'
107
108## Exclude these keys from the `i18n-tasks eq-base' report:
109# ignore_eq_base:
110# all:
111# - common.ok
112# fr,es:
113# - common.brand
114
115## Ignore these keys completely:
116# ignore:
117# - kaminari.*
118
119## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
120## e.g. in case of a relative key defined in a helper method.
121## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
122#
123# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
124# only: %w(*.html.haml *.html.slim),
125# patterns: [['= title\b', '.page_title']] %>
126#
127# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
128#
129# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
130# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
131<% I18n::Tasks.add_scanner('I18n::Tasks::Scanners::PatternMapper', only: %w(*.js), patterns: [['i18n.translate\(%{key}\)', '%{key}']]) %>