21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-29 15:30:49 +02:00

Real label for locale selection

This commit is contained in:
Jérémy Lecour 2018-06-13 20:28:37 +02:00
parent 9d62aceba4
commit 9b155e018c
5 changed files with 12 additions and 2 deletions

View file

@ -2,4 +2,8 @@ module ApplicationHelper
def format_utc(time, format: :default)
l(time.utc, format: format)
end
def available_locales_collection
I18n.available_locales.map { |k| [t("shared.locales.#{k}"), k]}
end
end

View file

@ -24,7 +24,7 @@
<%= f.input :password_confirmation, autocomplete: "off" %>
</div>
<%= f.input :locale, label: t('.locale'), collection: I18n.available_locales, selected: resource.locale %>
<%= f.input :locale, label: t('.locale'), collection: available_locales_collection, selected: resource.locale %>
<%= f.input :notifications_enabled %>

View file

@ -9,7 +9,7 @@
<%= f.input :password_confirmation, autocomplete: "off" %>
<%= f.input :locale, label: t('.locale'), collection: I18n.available_locales, selected: I18n.default_locale %>
<%= f.input :locale, label: t('.locale'), collection: available_locales_collection, selected: I18n.default_locale %>
<%= f.input :tos_accepted, label: t('.tos_acceptance_html') %>

View file

@ -40,6 +40,9 @@ en:
shared:
locales:
en: English
fr: French
navbar:
sign_up: "Sign up"
sign_in: "Sign in"

View file

@ -40,6 +40,9 @@ fr:
shared:
locales:
en: Anglais
fr: Français
navbar:
sign_up: "Enregistrement"
sign_in: "Connexion"