I need to detect language in Ruby without any rubygems installed. Both Python and Perl do have locale utilities as part of the core API. I want something like
# LC_ALL=cs_CZ ruby test.rb
Your language is: cs_CZ
Your currency is: CZK
Thanks
Rails Internationalization http://guides.rubyonrails.org/i18n.html
I18n.locale
Also, check your application.rb file if you want to set defaults like so:
I18n.default_locale = [:en]
I18n.available_locales = [:en, :fr]
If you don't have access to ANY gems, including Rails, take a look at how svenfuchs implemented it: https://github.com/svenfuchs/i18n
Quick question though: you do know you could vendor gems and use them without access to rubygems right?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With