Merge pull request #6414 from betagouv/localization-improvements

Amélioration du sélecteur de langues (#6414)
This commit is contained in:
Pierre de La Morinerie 2021-08-24 13:06:35 -05:00 committed by GitHub
commit fd1a2e9307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 24 deletions

View file

@ -234,6 +234,10 @@ $header-mobile-breakpoint: 550px;
display: flex;
color: $black;
&.active {
font-weight: bold;
}
&:hover {
background: $light-grey;
}

View file

@ -1,11 +1,11 @@
.dropdown.locale-dropdown.header-menu-opener
%button.button.dropdown-button.icon-only.header-menu-button{ title: "Translate", aria: { expanded: 'false', controls: 'locale_menu' } }
.hidden Translate
= image_tag "icons/translate-icon.svg", alt: 'Translate', width: 24, height: 24, lazy: true, aria: { hidden: true }
%button.button.dropdown-button.icon-only.header-menu-button{ title: t('.languages'), aria: { expanded: 'false', controls: 'locale_menu' } }
.hidden t('.languages')
= image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, lazy: true, aria: { hidden: true }
%ul.header-menu.dropdown-content
%li
= link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link" do
EN English
= active_link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link", active: I18n.locale == :fr do
Français
%li
= link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link" do
FR français
= active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do
English

View file

@ -2,8 +2,8 @@
= image_tag "landing/hero/dematerialiser.svg", class: "paperless-logo", alt: "moins de papier"
.baseline.center
%p
%span.simple= t('views.layouts.commencer.no_procedure.line1')
%span.simple= t('.line1')
%br
= t('views.layouts.commencer.no_procedure.line2')
= t('.line2')
%br
= t('views.layouts.commencer.no_procedure.line3')
= t('.line3')

View file

@ -45,6 +45,14 @@ en:
commentaire:
send_message_to_instructeur: "Send a message to the instructor"
reply_in_mailbox: "Reply in mailbox"
layouts:
commencer:
no_procedure:
line1: A simple tool
line2: to manage dematerialized
line3: administrative forms.
locale_dropdown:
languages: "Languages"
views:
commencer:
show:
@ -85,12 +93,6 @@ en:
want_to_withdraw_permission: "Would you like to withdraw the permission?"
edit_dossier: "These people can edit this file."
submit_dossier_yourself: "You must submit the file yourself when it is complete."
layouts:
commencer:
no_procedure:
line1: A simple tool
line2: to manage dematerialized
line3: administrative forms.
pagination:
next: Next
last: Last

View file

@ -35,6 +35,14 @@ fr:
commentaire:
send_message_to_instructeur: "Envoyer un message à linstructeur"
reply_in_mailbox: "Répondre dans la messagerie."
layouts:
commencer:
no_procedure:
line1: Un outil simple
line2: pour gérer les formulaires
line3: administratifs dématérialisés.
locale_dropdown:
languages: "Langues"
views:
commencer:
show:
@ -76,12 +84,6 @@ fr:
want_to_withdraw_permission: "Souhaitez-vous supprimer lautorisation ?"
edit_dossier: "Ces personnes peuvent modifier ce dossier."
submit_dossier_yourself: "Une fois le dossier complet, vous devez le déposer vous-même."
layouts:
commencer:
no_procedure:
line1: Un outil simple
line2: pour gérer les formulaires
line3: administratifs dématérialisés.
pagination:
next: Suivant
last: Dernier

View file

@ -7,8 +7,8 @@ feature 'Accessing the website in different languages:' do
visit new_user_session_path
expect(page).to have_text('Connectez-vous')
click_on 'Translate'
click_on 'EN English'
click_on 'Langues'
click_on 'English'
# The page is now in English
expect(page).to have_text('Sign in')