diff --git a/app/helpers/locales_helper.rb b/app/helpers/locales_helper.rb new file mode 100644 index 000000000..7954cc908 --- /dev/null +++ b/app/helpers/locales_helper.rb @@ -0,0 +1,8 @@ +module LocalesHelper + + def name_for_locale(locale) + default = I18n.t("locale", locale: locale) + I18n.backend.translate(locale, "i18n.language.name", default: default) + end + +end diff --git a/app/views/shared/_locale_switcher.html.erb b/app/views/shared/_locale_switcher.html.erb index f29defcbd..af184fe48 100644 --- a/app/views/shared/_locale_switcher.html.erb +++ b/app/views/shared/_locale_switcher.html.erb @@ -8,7 +8,7 @@ <% I18n.available_locales.map do |loc| %> <% end %> diff --git a/doc/locales/pt-br.yml b/doc/locales/pt-br.yml index 9d2b3ee46..f3159cdc2 100644 --- a/doc/locales/pt-br.yml +++ b/doc/locales/pt-br.yml @@ -1,5 +1,8 @@ --- pt-BR: + i18n: + language: + name: Português account: show: change_credentials_link: Alterar meus dados pessoais