Last active
December 16, 2024 18:19
-
-
Save alexishida/3abac5f18da6e60899a3fae7378bc212 to your computer and use it in GitHub Desktop.
Internacionalizacao Rails para pt-BR locale i18n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Artigo ogirinal por JORGE VILAÇA | |
# https://jorgevilaca.wordpress.com/2012/03/06/nacionalizando-rails-para-pt-br/ | |
# config/application.rb | |
config.i18n.default_locale = :'pt-BR' # Define o locale padrão como pt-BR | |
config.i18n.available_locales = ['en', :'pt-BR'] # Adiciona pt-BR aos locais disponíveis | |
config.time_zone = 'La Paz' | |
config.active_record.default_timezone = :local | |
# config/locales/pt-BR.yml | |
https://gist.github.com/alexishida/93dfdb243c6342d591f48f3f2e5f072d | |
# config/initializers/inflections.rb | |
https://gist.github.com/alexishida/b5bf544e44805f648b80455a822ddc04 | |
# Teste | |
I18n.l Date.today, :format => :long | |
Mais informações a respeito: | |
http://guides.rubyonrails.org/i18n.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment