i18n: move locale scope just after the key name

It helps i18n-tasks to understand the scope, and not report errors
about a missing key.
This commit is contained in:
Pierre de La Morinerie 2021-09-15 12:37:53 -05:00
parent 95d1cd6992
commit 1eefc151bc
4 changed files with 10 additions and 11 deletions

View file

@ -48,14 +48,13 @@
- if matching_archive.status == 'generated' && matching_archive.file.attached?
= link_to url_for(matching_archive.file), class: 'button primary' do
%span.icon.download-white
= t(:archive_ready_html, generated_period: time_ago_in_words(matching_archive.updated_at), scope: [:instructeurs, :procedure])
= t(:archive_ready_html, scope: [:instructeurs, :procedure], generated_period: time_ago_in_words(matching_archive.updated_at))
- else
%span.icon.retry
= t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure])
= t(:archive_pending_html, scope: [:instructeurs, :procedure], created_period: time_ago_in_words(matching_archive.created_at))
- elsif weight < 1.gigabyte
= link_to instructeur_archives_path(@procedure, type:'monthly', month: month.strftime('%Y-%m')), method: :post, class: "button" do
%span.icon.new-folder
Demander la création
- else
Archive trop volumineuse

View file

@ -28,9 +28,9 @@
= t("update_drop_down_options#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
%ul
- if added.present?
%li= t(:add_option, items: added.map{ |term| "« #{term.strip} »" }.join(", "), scope: [:new_administrateur, :revision_changes])
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{term.strip} »" }.join(", "))
- if removed.present?
%li= t(:remove_option, items: removed.map{ |term| "« #{term.strip} »" }.join(", "), scope: [:new_administrateur, :revision_changes])
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{term.strip} »" }.join(", "))
- when :carte_layers
- added = change[:to].sort - change[:from].sort
- removed = change[:from].sort - change[:to].sort
@ -38,11 +38,11 @@
= t("update_carte_layers#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
%ul
- if added.present?
%li= t(:add_option, items: added.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "), scope: [:new_administrateur, :revision_changes])
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
- if removed.present?
%li= t(:remove_option, items: removed.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "), scope: [:new_administrateur, :revision_changes])
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
- move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] }
- if move_changes.size != 0
%li.mb-1= t(:move, count: move_changes.size, scope: [:new_administrateur, :revision_changes])
%li.mb-1= t(:move, scope: [:new_administrateur, :revision_changes], count: move_changes.size)
- if move_private_changes.size != 0
%li.mb-1= t(:move_private, count: move_private_changes.size, scope: [:new_administrateur, :revision_changes])
%li.mb-1= t(:move_private, scope: [:new_administrateur, :revision_changes], count: move_private_changes.size)

View file

@ -2,7 +2,7 @@
%tbody
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
%tr
%td= t('warning_for_private_info', etablissement: raison_sociale_or_name(etablissement), scope: 'views.shared.dossiers.identite_entreprise')
%td= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', etablissement: raison_sociale_or_name(etablissement))
- else
%tr
%th.libelle Dénomination :

View file

@ -9,7 +9,7 @@
- etablissement = @dossier.etablissement
- if etablissement.diffusable_commercialement == false
%p= t('warning_for_private_info', etablissement: raison_sociale_or_name(etablissement), scope: 'views.shared.dossiers.identite_entreprise')
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', etablissement: raison_sociale_or_name(etablissement))
- else
%p