# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
translation:
  backend: deepl
  deepl_api_key: <%= ENV.fetch("DECIDIM_DEEPL_API_KEY", "") %>
  deepl_host: <%= ENV.fetch("DECIDIM_DEEPL_HOST", "https://api.deepl.com") %>
  deepl_version: <%= ENV.fetch("DECIDIM_DEEPL_VERSION", "v2") %>

  deepl_options:
    formality: prefer_less
  deepl_locale_aliases:
    en: en-us
    pt: pt-br


# The "main" locale.
base_locale: en

## 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 `File.find` patterns where translations are read from:
  read:
    <% 
      gem_paths = `bundle list --name-only`.split("\n")
        .select { |gem| gem.start_with?("decidim") }
        .map { |gem| [gem, `bundle info #{gem} --path`.strip] }
    -%>
    <% gem_paths.each do |gem, path| -%>
    <%= "- #{path}/config/locales/%{locale}.yml" %>
    <%= "- #{path}/config/locales/*.%{locale}.yml" %>
    <% end -%>

  # 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/%{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"

locales:
  <% (ENV["ENFORCED_LOCALES"].presence&.split(",") || []).each do |locale| -%>
  <%= "- '#{locale}'" %>
  <% end -%>

# Find translate calls
search:
  ## Paths or `File.find` patterns to search in:
  paths:
    <% gem_paths.each do |gem, path| -%>
    <%= "- #{path}/app" %>
    <%= "- #{path}/lib" %>
    <% end -%>

  # Root directories for relative keys resolution.
  relative_roots:
    <% gem_paths.each do |gem, path| -%>
    <%= "- #{path}/app/controllers" %>
    <%= "- #{path}/app/helpers" %>
    <%= "- #{path}/app/mailers" %>
    <%= "- #{path}/app/presenters" %>
    <%= "- #{path}/app/services" %>
    <%= "- #{path}/app/views" %>
    <%= "- #{path}/app/cells" %>
    <% end -%>

  ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
  ##   %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
  exclude:
    - decidim-dev/lib/decidim/dev/assets/iso-8859-15.md
    - decidim-dev/lib/decidim/dev/assets/import_participatory_space_private_users_iso8859-1.csv
    - decidim-comments/app/assets/javascripts/decidim/comments/bundle.js
    - decidim-comments/app/assets/javascripts/decidim/comments/bundle.js.map
    - "*.jpeg"
    - "*.odt"
    - "*.docx"
    - "*.xls"
    - "*.xlsx"
    - "*.csv"
    - "*.md"

  ## 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: false

  ## 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

## Google Translate
# translation:
#   # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
#   api_key: "AbC-dEf5"

# Do not consider these keys missing:
ignore_missing:
  - components.*
  - browse_resource
  - email_subject
  - email_intro
  - email_outro
  - follows.create.participatory_space
  - notification_title
  - decidim.wizard_step_form_cell.*
  - decidim.proposals.application_helper.activity_filter_values.*
  - decidim.meetings.application_helper.activity_filter_values.*
  - decidim.content_blocks.*_settings_form.show.*
  - decidim.newsletter_templates.*_settings_form.show.*
  - participate_in
  - see_other_versions
  - actions.invalid_destroy.proposals_count
  - decidim.budgets.projects_helper.current_rule_explanation.*
  - decidim.budgets.projects_helper.current_rule_description.*
  - decidim.budgets.projects_helper.current_rule_call_for_action_text.*
  - decidim.debates.debate_m.footer.commented_time_ago
  - date.abbr_day_names
  - date.day_names
  - date.month_names
  - explanation

# Consider these keys used:
ignore_unused:
  - devise.*
  - activemodel.attributes.*
  - activemodel.errors.*
  - activemodel.models.*
  - activerecord.attributes.*
  - activerecord.errors.*
  - activerecord.models.*
  - booleans.*
  - '{date,time.formats}.*'
  - datetime.distance_in_words.*
  - decidim.admin.actions.share
  - decidim.admin.participatory_process_steps.default_title
  - decidim.admin.admin_log.changeset.*
  - decidim.verifications.admin_log.csv_datum.*
  - decidim.admin.forms.file_help.import_csv.*
  - decidim.authorization_handlers.{direct,multistep}
  - decidim.admin.models.assembly_member.positions.*
  - decidim.application.documents.component_documents.*
  - decidim.statistics.*
  - decidim.components.*
  - decidim.collaborative_texts.admin_log.document.*
  - decidim.collaborative_texts.admin_log.version.*
  - decidim.collaborative_texts.admin_log.suggestion.*
  - decidim.filters.linked_classes.*
  - decidim.shared.participatory_space_filters.filters.*
  - decidim.follows.create.participatory_space
  - decidim.forms.errors.*
  - decidim.forms.file_help.*
  - decidim.forms.admin_log.questionnaire.update
  - decidim.elections.admin_log.election.*
  - decidim.elections.admin_log.question.*
  - decidim.elections.admin.statuses.*
  - decidim.elections.censuses.internal_users.*
  - decidim.elections.elections.filters.state_values.*
  - decidim.elections.elections.orders.*
  - decidim.elections.elections.show.*
  - decidim.elections.votes.check_census.*
  - decidim.elections.votes.question.*
  - decidim.proposals.answers.*
  - decidim.proposals.collaborative_drafts.show.see_other_versions
  - decidim.proposals.collaborative_drafts.wizard_aside.back
  - decidim.proposals.collaborative_drafts.wizard_aside.back_from_collaborative_draft
  - decidim.proposals.collaborative_drafts.wizard_aside.back_from_step_1
  - decidim.proposals.collaborative_drafts.wizard_aside.back_from_step_2
  - decidim.proposals.collaborative_drafts.wizard_aside.back_from_step_3
  - decidim.proposals.collaborative_drafts.wizard_aside.back_from_step_4
  - decidim.proposals.proposal_likes_helper.likes_count_title
  - decidim.proposals.proposals.orders.*
  - decidim.proposals.proposals.likes_card_row.comments_title
  - decidim.proposals.proposals.wizard_aside.back
  - decidim.proposals.proposals.wizard_aside.back_from_step_1
  - decidim.proposals.proposals.wizard_aside.back_from_step_2
  - decidim.proposals.proposals.wizard_aside.back_from_step_3
  - decidim.proposals.proposals.wizard_aside.back_from_step_4
  - decidim.proposals.proposals.wizard_steps.current_step
  - decidim.proposals.proposals.wizard_steps.step_1
  - decidim.proposals.proposals.wizard_steps.step_2
  - decidim.proposals.proposals.wizard_steps.step_3
  - decidim.proposals.proposals.wizard_steps.step_4
  - decidim.proposals.proposals.show.proposal_accepted_reason
  - decidim.proposals.proposals.show.proposal_in_evaluation_reason
  - decidim.proposals.proposals.show.proposal_rejected_reason
  - decidim.resource_links.*
  - decidim.system.default_pages.placeholders.*
  - decidim.system.organizations.omniauth_settings.*
  - decidim.verifications.csv_census.admin.census.create_import.no_user
  - decidim.verifications.csv_census.admin.census.index.no_sign_in
  - decidim.verifications.csv_census.admin.census.index.no_user
  - decidim.verifications.id_documents.{identification_number,passport}
  - decidim.verifications.dummy_authorization.extra_explanation.user_postal_codes.{one,other}
  - errors.messages.*
  - invisible_captcha.*
  - social_share_button.*
  - decidim.features.accountability.name
  - decidim.features.accountability.settings.*
  - decidim.accountability.models.project.valid_statuses.*
  - decidim.accountability.admin_log.*
  - decidim.proposals.admin_log.*
  - decidim.log.base_presenter.*
  - decidim.admin_log.*
  - decidim.debates.debates.filters.*
  - decidim.debates.admin_log.*
  - decidim.meetings.admin_log.*
  - decidim.budgets.admin_log.*
  - decidim.budgets.admin.models.project.name
  - decidim.budgets.budgets_list.cancel_order.more_than_one
  - decidim.budgets.budgets_list.cancel_order.only_one
  - decidim.budgets.budgets_list.finished_message
  - decidim.budgets.budgets_list.highlighted_cta
  - decidim.budgets.budgets_list.if_change_opinion
  - decidim.budgets.budgets_list.my_budgets
  - decidim.budgets.budgets_list.voted_on
  - decidim.budgets.budget_information_modal.close_modal
  - decidim.budgets.budget_information_modal.continue
  - decidim.budgets.budget_information_modal.more_information
  - decidim.budgets.budget_information_modal.back_to
  - decidim.budgets.limit_announcement.cant_vote
  - decidim.budgets.limit_announcement.limit_reached
  - decidim.budgets.projects.order_progress.dynamic_help.*
  - decidim.budgets.projects.order_progress.minimum_projects_rule.*
  - decidim.budgets.projects.order_progress.projects_rule.*
  - decidim.budgets.projects.order_progress.projects_rule_maximum_only.*
  - decidim.budgets.projects.order_progress.maximum_projects_rule.*
  - decidim.budgets.projects.order_progress.vote_threshold_percent_rule.*
  - decidim.orders.checkout.*
  - decidim.budgets.projects.filters.*
  - decidim.sortitions.admin_log.*
  - decidim.sortitions.sortitions.filters.*
  - decidim.sortitions.sortitions.orders.*
  - decidim.initiatives.admin_log.*
  - decidim.initiatives.initiatives.orders.*
  - decidim.initiatives.states.*
  - decidim.initiatives.admin_states.*
  - decidim.initiatives.events.*
  - decidim.initiatives.initiatives.author_list.hidden_authors_count.*
  - decidim.initiatives.initiatives.signatures_count.*
  - decidim.collapsible_list.hidden_elements_count.*
  - decidim.events.*
  - doorkeeper.scopes.*
  - decidim.proposals.proposals.votes_count.count.*
  - decidim.proposals.proposals.show.hidden_likes_count.*
  - decidim.admin.taxonomies.breadcrumb.*
  - decidim.admin.taxonomy_filters.breadcrumb.*
  - decidim.admin.models.*.name
  - decidim.admin.models.*.name.*
  - password_validator.*
  - decidim.*.pages.home.highlighted_*.*
  - decidim.participatory_processes.participatory_processes.filters.*
  - decidim.participatory_processes.participatory_processes.description.*
  - decidim.participatory_processes.show.related_assemblies
  - decidim.content_blocks.*.name
  - decidim.participatory_processes.content_blocks.*.name
  - decidim.participatory_process_groups.content_blocks.*.name
  - decidim.assemblies.content_blocks.*.name
  - decidim.debates.content_blocks.*.name
  - decidim.initiatives.content_blocks.*.name
  - decidim.meetings.content_blocks.*.name
  - decidim.blogs.content_blocks.*.name
  - decidim.proposals.content_blocks.*.name
  - decidim.proposals.collaborative_drafts.show.hidden_authors_count.*
  - decidim.proposals.collaborative_drafts.orders*
  - decidim.proposals.collaborative_drafts.filters*
  - decidim.proposals.collaborative_drafts.show.withdraw
  - decidim.proposals.collaborative_drafts.show.publish
  - decidim.conferences.content_blocks.*.name
  - decidim.conferences.pages.home.highlighted_conferences.*
  - decidim.conferences.conference_speaker.*
  - decidim.conferences.show.*
  - decidim.conferences.models.conference_registration.fields.states.*
  - decidim.proposals.admin.participatory_texts.sections.*
  - decidim.gamification.badges.*
  - decidim.surveys.admin.surveys.update.*
  - decidim.groups.roles.*
  - decidim.welcome_notification.*
  - decidim.help.*
  - decidim.amendments.amendable.error
  - decidim.amendments.emendation.announcement.*
  - decidim.amendments.accept.error
  - decidim.search.results
  - decidim.searches.filters.state.*
  - decidim.security.selfxss_warning.*
  - decidim.assemblies.filter.*
  - decidim.assemblies.assemblies.description.*
  - decidim.assemblies.assemblies.filters.*
  - decidim.initiatives.initiatives.votes_count.count.*
  - decidim.proposals.admin.participatory_texts.new_import.accepted_mime_types.*
  - decidim.participatory_processes.admin.new_import.accepted_types.*
  - decidim.assemblies.admin.new_import.accepted_types.*
  - decidim.amendments.visibility_options.*
  - decidim.wizard_step_form.*
  - decidim.proposals.proposals.filters.*
  - decidim.admin.filters.*
  - decidim.proposals.models.proposal.fields.*
  - decidim.admin_terms_of_service.default_body
  - decidim.admin.admin_terms_of_service.required_review.alert
  - decidim.budgets.projects.orders.*
  - forms.length_validator.*
  - layouts.decidim.participatory_process_groups.*
  - decidim.newsletter_templates.basic_only_text.name
  - decidim.newsletter_templates.image_text_cta.name
  - decidim.content_blocks.*_settings_form.*
  - decidim.newsletter_templates.*_settings_form.*
  - decidim.version.show.*
  - decidim.versions_list.show.*
  - decidim.versions_list_item.show.*
  - decidim.accountability.results.show.stats.back_to_resource
  - decidim.meetings.actions.invalid_destroy.proposals_count.*
  - layouts.decidim.participatory_processes.participatory_process.more_info
  - layouts.decidim.participatory_processes.participatory_process.more_info_about
  - layouts.decidim.participatory_processes.participatory_process.take_part
  - layouts.decidim.participatory_processes.participatory_process.take_part_in
  - decidim.debates.debates.show.edit_conclusions
  - activemodel.attributes.organization.machine_translation_display_priority_*
  - decidim.budgets.projects.budget_summary.minimum_projects_rule.*
  - decidim.budgets.projects.budget_summary.projects_rule.*
  - decidim.budgets.projects.budget_summary.projects_rule_maximum_only.*
  - decidim.budgets.projects.budget_summary.vote_threshold_percent_rule.*
  - decidim.budgets.projects.budget_excess.description
  - decidim.debates.debates.orders.*
  - decidim.debates.debate_m.commented_time_ago
  - decidim.devise.sessions.user.timed_out
  - decidim.admin.forms.file_help.import.*
  - decidim.admin.menu.questions_submenu.attachments
  - decidim.admin.menu.questions_submenu.categories
  - decidim.meetings.public_participants_list.hidden_participants_count.*
  - decidim.budgets.budgets_list.*
  - decidim.budgets.projects.project_budget_button.*
  - decidim.meetings.meetings.show.withdraw_btn_hint
  - decidim.meetings.meetings.show.withdraw_confirmation_html
  - decidim.meetings.meetings.show.withdraw_meeting
  - decidim.proposals.proposals.show.withdraw_btn_hint
  - decidim.proposals.proposals.show.withdraw_confirmation_html
  - decidim.proposals.proposals.show.withdraw_proposal
  - decidim.assemblies.admin.assembly_members.form.explanation
  - decidim.assemblies.admin.assembly_members.form.image_guide
  - decidim.assemblies.admin.assembly_members.form.non_user_avatar_help
  - decidim.initiatives.create_initiative.select_initiative_type.*
  - decidim.blogs.admin_log.*
  - decidim.templates.admin_log.*
  - editor.*
  - emojis.*
  - ransack.predicates.*
  - decidim.profiles.user.actions.*
  - decidim.forms.upload_help.explanation
  - decidim.admin.assembly_user_roles.create.*
  - decidim.admin.assembly_user_roles.update.*
  - decidim.admin.assembly_user_roles.destroy.*
  - decidim.admin.conference_user_roles.create.*
  - decidim.admin.conference_user_roles.destroy.*
  - decidim.admin.participatory_process_user_roles.create.*
  - decidim.admin.participatory_process_user_roles.update.*
  - decidim.admin.participatory_process_user_roles.destroy.*
  - layouts.decidim.participatory_processes.promoted_process.*
  - layouts.decidim.conferences.promoted_conference.*
  - layouts.decidim.assemblies.assembly.*
  - layouts.decidim.conferences.promoted_conference.*
  - versions.directions.*
  - layouts.decidim.conferences.conference.*
  - decidim.admin.conflicts.*
  - decidim.profiles.show.conversations
  - decidim.profiles.show.view_full_profile
  - layouts.decidim.assemblies.promoted_assembly.take_part
  - versions.dropdown.option_*
  - decidim.meetings.meetings.filters.*
  - decidim.meetings.polls.questions.index_admin.statuses.{closed,published,unpublished}
  - decidim.meetings.directory.meetings.index.space_type
  - decidim.authorization_modals.content.*
  - decidim.authorization_handlers.admin.{another_dummy_authorization_handler,csv_census,dummy_authorization_handler,ephemeral_dummy_authorization_handler,id_documents,postal_letter,sms}.help
  - number.currency.format.format
  - time.buttons.*
  - decidim.profiles.show.members
  - decidim.participatory_processes.static_pages.democratic_quality_indicators.*
  - decidim.participatory_processes.admin.content_blocks.democratic_quality_stats_settings_form.*

## 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 is not 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}']] %>