-
Notifications
You must be signed in to change notification settings - Fork 523
/
Copy pathi18n-tasks.yml
320 lines (295 loc) · 12.7 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
# The "main" locale.
base_locale: en
## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
# locales: [es, fr]
## Reporting locale, default: en. Available: en, ru.
# internal_locale: en
# Read and write translations.
data:
## Translations are read from the file system. Supported format: YAML, JSON.
## Provide a custom adapter:
# adapter: I18n::Tasks::Data::FileSystem
# Locale files or `Find.find` patterns where translations are read from:
read:
- config/locales/**/en.yml
- config/locales/phrase-exports/%{locale}.yml
# - locales/views/zh-CN.yml # These are also in the phrase exports
# 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:
# - 'config/locales/phrase-exports/%{locale}.yml' # Cannot route by language, 'en' files end up in the wrong place
## For example, write devise and simple form keys to their respective files:
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
## Catch-all default:
# - config/locales/%{locale}.yml
# External locale data (e.g. gems).
# This data is not considered unused and is never written to.
external:
- <%= %x[bundle info rails-i18n --path].chomp %>/rails/locale/%{locale}.yml
## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
# router: conservative_router
yaml:
write:
# do not wrap lines at 80 characters
line_width: -1
## Pretty-print JSON:
# json:
# write:
# indent: ' '
# space: ' '
# object_nl: "\n"
# array_nl: "\n"
<% require "i18n/tasks/scanners/ast_matchers/rails_model_matcher.rb" %>
# Find translate calls
search:
## Paths or `Find.find` patterns to search in:
# paths:
# - app/
## Root directories for relative keys resolution.
# relative_roots:
# - app/controllers
# - app/helpers
# - app/mailers
# - app/presenters
# - app/views
## Directories where method names which should not be part of a relative key resolution.
# By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
# Directories listed here will not consider the name of the method part of the resolved key
#
# relative_exclude_method_name_paths:
# -
## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
# exclude:
# - app/assets/images
# - app/assets/fonts
# - app/assets/videos
# - app/assets/builds
## 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
## Allows adding ast_matchers for finding translations using the AST-scanners
## The available matchers are:
## - RailsModelMatcher
## Matches ActiveRecord translations like
## User.human_attribute_name(:email) and User.model_name.human
##
## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
<% I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %>
## 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
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
# google_translate_api_key: "AbC-dEf5"
# # DeepL Pro Translate
# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
# # deepl_host: "https://api.deepl.com"
# # deepl_version: "v2"
## Do not consider these keys missing:
ignore_missing:
## All of the following keys are using default values defined in the respective .rb files
## TODO: Move the default values to the .yml files
# File: app/controllers/admin/admin_invitations_controller.rb
- invites_created # should be admin.admin_invitations.grant_invites_to_users.invites_created
- no_email # should be admin.admin_invitations.create.no_email
- sent # should be admin.admin_invitations.create.sent
- user_not_found # should be admin.admin_invitations.find.user_not_found
# File: app/controllers/application_controller.rb
- ban_notice # should be application.check_user_status.ban_notice
- suspension_notice # should be application.check_user_status.suspension_notice
# File: app/controllers/challenge_assignments_controller.rb
- challenge_assignments.assignments_not_sent
- challenge_assignments.assignments_sent
- challenge_assignments.no_challenge
- challenge_assignments.not_owner
- challenge_assignments.signup_open
# File: app/controllers/challenges_controller.rb
- challenge.no_collection # should be challenges.no_collection
- challenges.no_challenge
# File: app/controllers/collection_items_controller.rb
- collection_items.create.invitation_not_sent # should not be using lazy lookup
# File: app/controllers/collection_participants_controller.rb
- applied_to_join_collection # should be collection_participants.applied_to_join_collection
- no_collection # should be collection_participants.no_collection
- collection_participants.accepted_invite
- collection_participants.destroy
- collection_participants.no_invitation
- collection_participants.owners_required
- collection_participants.update_failure
- collection_participants.update_success
# File: app/controllers/external_authors_controller.rb
- external_author_claimed # should be external_authors.complete_claim.external_author_claimed
# Files: app/controllers/external_works_controller.rb and app/controllers/languages_controller.rb
- successfully_updated # should be external_works.update.successfully_updated and languages.update.successfully_updated
# File: app/controllers/feedbacks_controller.rb
- failure_send # should be feedbacks.create.failure_send
- successfully_sent # should be feedbacks.create.successfully_sent
# Files: app/controllers/languages_controller.rb and app/controllers/locales_controller.rb
- successfully_added # should be languages.create.successfully_added and locales.create.successfully_added
# File: app/helpers/users_helper.rb
- users_helper.log_ban
- users_helper.log_email_change
- users_helper.log_lift_suspension
- users_helper.log_note
- users_helper.log_password_change
- users_helper.log_rename
- users_helper.log_role_added
- users_helper.log_role_removed
- users_helper.log_suspended
- users_helper.log_troubleshot
- users_helper.log_validated
- users_helper.log_warn
# Files: app/views/admin/_admin_nav.html.erb and app/views/admin_posts/show.html.erb
- admin.admin_nav.delete
# File: app/views/admin/admin_invitations/find.html.erb
- admin.admin_invitations.find.find_email
- admin.admin_invitations.find.find_token
- admin.admin_invitations.find.find_user_name
# File: app/views/admin/admin_invitations/new.html.erb
- admin.admin_invitations.new.email_address
- admin.admin_invitations.new.invite_user
- admin.admin_invitations.new.submit
# File: app/views/admin/skins/_navigation.html.erb
- skins.approval_queue
- skins.approved_skins
- skins.rejected_skins
# File: app/views/comments/show.html.erb
- comments.show.comment_on
# File: app/views/external_authors/_external_author_name.html.erb
- external_authors.external_author_name.label_external_author_name
# File: app/views/external_authors/edit.html.erb
- external_authors.edit.back
- external_authors.edit.edit_external_author
# File: app/views/gifts/_gift_search.html.erb
- gifts.gift_search.forms.gift_search
- gifts.gift_search.gifts.recipient_field
# File: app/views/home/site_map.html.erb
- home.site_map.ao3_news
- home.site_map.archive_faq
- home.site_map.bookmarks
- home.site_map.collections
- home.site_map.donate
- home.site_map.edit_user_profile
- home.site_map.fandoms
- home.site_map.freeform_tag_cloud
- home.site_map.homepage
- home.site_map.known_issues
- home.site_map.languages
- home.site_map.manage_pseuds
- home.site_map.my_bookmarks
- home.site_map.my_collections
- home.site_map.my_drafts
- home.site_map.my_history
- home.site_map.my_home
- home.site_map.my_inbox
- home.site_map.my_profile
- home.site_map.my_series
- home.site_map.my_subscriptions
- home.site_map.my_works
- home.site_map.people
- home.site_map.post_new
- home.site_map.recent_works
- home.site_map.report_abuse
- home.site_map.set_preferences
- home.site_map.site_map
- home.site_map.support_and_feedback
- home.site_map.terms_of_service
# File: app/views/invitations/index.html.erb
- invitations.index.choose_invite
- invitations.index.email address # should be invitations.index.email_address
- invitations.index.submit_invite
# File: app/views/languages/_form.html.erb
- languages.form.abuse_support_available
- languages.form.create
- languages.form.name
- languages.form.required_notice
- languages.form.short
- languages.form.sortable_name
- languages.form.support_available
- languages.form.update
# File: app/views/languages/edit.html.erb
- languages.edit.edit_language
# File: app/views/languages/new.html.erb
- languages.new.new_language
# File: app/views/languages/show.html.erb
- languages.show.work_count
# File: app/views/locales/_locale_form.html.erb
- locales.locale_form.actions_heading
- locales.locale_form.actions_legend
- locales.locale_form.create_button
- locales.locale_form.edit_button
- locales.locale_form.enable_email
- locales.locale_form.enable_interface
- locales.locale_form.iso
- locales.locale_form.language
- locales.locale_form.locale_heading
- locales.locale_form.locale_legend
- locales.locale_form.name
- locales.locale_form.required_notice
# File: app/views/locales/_navigation.html.erb
- locales.navigation.link_to_index
- locales.navigation.link_to_new
# File: app/views/locales/edit.html.erb
- locales.edit.edit_locale
# File: app/views/locales/index.html.erb
- locales.index.locale_table_caption
- locales.index.locale_table_summary
- locales.index.supported_locales
# File: app/views/locales/new.html.erb
- locales.new.add_new_locale
# File: app/views/orphans/index.html.erb
- orphans.index.orphaned_works
# File: app/views/orphans/new.html.erb
- orphans.new.links.cancel
- orphans.new.orphans_about
# File: app/views/pseuds/edit.html.erb
- pseuds.edit.forms.update
# File: app/views/pseuds/show.html.erb
- pseuds.show.edit_link
- pseuds.show.index_link
# File: app/views/series/manage.html.er
- series.manage.manage_series
## Consider these keys used:
ignore_unused:
- activerecord.attributes.*
- activerecord.errors.models.*
- activerecord.models.*
- devise.*
- errors.messages.*
- errors.attributes.ticket_number.{closed_ticket,invalid_department,required}
- attributes.ticket_number
## Exclude these keys from the `i18n-tasks eq-base' report:
# ignore_eq_base:
# all:
# - common.ok
# fr,es:
# - common.brand
## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
# ignore_inconsistent_interpolations:
# - 'activerecord.attributes.*'
## Exclude these keys from the newlines test task:
# ignore_newlines:
# - user_mailer.signup_notification.*
## 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}']] %>