-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathi18n-tasks.yml
104 lines (85 loc) · 3.08 KB
/
i18n-tasks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
locales: [en, ru, de, es, it, pl, pt, fa, zh]
base_locale: en
internal_locale: en
data:
adapter: I18n::Tasks::Data::FileSystem
read:
- config/locales/%{locale}.yml
- config/locales/**/*.%{locale}.yml
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
# `i18n-tasks normalize -p` will force move the keys according to these rules
write:
- ["{activerecord, activemodel, admin, devise, form, pages}.*", 'config/locales/\1.%{locale}.yml']
- config/locales/%{locale}.yml
external:
- devise/config/locales/%{locale}.yml
router: conservative_router
yaml:
write:
line_width: -1
json:
write:
indent: ' '
space: ' '
object_nl: "\n"
array_nl: "\n"
search:
paths:
- app/
relative_roots:
- app/controllers
- app/helpers
- app/mailers
- app/presenters
- app/views
exclude:
- tmp/*
- app/assets/images
- app/assets/fonts
- 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.
# only: ["*.rb", "*.html.slim"]
## 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
## Translation Services
translation:
google_translate_api_key: <%= ENV['GOOGLE_TRANSLATE_API_KEY'] %>
deepl_api_key: <%= ENV['DEEPL_TRANSLATE_API_KEY'] %>
## Do not consider these keys missing:
ignore_missing:
- i18n.plural.keys
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
# - '{devise,simple_form}.*'
## Consider these keys used:
ignore_unused:
- 'activerecord.{attributes,models}.*'
- '{devise,formtastic,kaminari,will_paginate}.*'
# - 'simple_form.{yes,no}'
# - 'simple_form.{placeholders,hints,labels}.*'
# - 'simple_form.{error_notification,required}.:'
## Exclude these keys from the `i18n-tasks eq-base' report:
# ignore_eq_base:
# all:
# - common.ok
# fr,es:
# - common.brand
## 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}']] %>