277 lines
11 KiB
YAML
277 lines
11 KiB
YAML
# 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"
|
|
|
|
# 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
|
|
## - DefaultI18nSubjectMatcher
|
|
## Matches ActionMailer's default_i18n_subject method
|
|
##
|
|
## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
|
|
ast_matchers:
|
|
- 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
|
|
- 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
|
|
|
|
## 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:
|
|
# File: app/helpers/mailer_helper.rb
|
|
- comment_mailer.subject_for_commentable.subject.{chapter,other,tag}
|
|
# File: app/mailers/comment_mailer.rb
|
|
- mailer_helper.content_for_commentable_html.chapter.{titled,untitled}
|
|
- mailer_helper.content_for_commentable_html.content.{chapter,other,tag}.html
|
|
- mailer_helper.content_for_commentable_text.content.{other,tag}.text
|
|
- mailer_helper.content_for_commentable_text.content.chapter.{titled_text,untitled_text}
|
|
## 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/challenge_assignments_controller.rb
|
|
- challenge_assignments.assignments_not_sent
|
|
- challenge_assignments.assignments_sent
|
|
- challenge_assignments.no_challenge
|
|
- 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.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 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/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/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.erb
|
|
- 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}']] %>
|