Module: Ooor::Locale
- Defined in:
- lib/ooor/locale.rb
Class Method Summary collapse
-
.to_erp_locale(locale) ⇒ Object
OpenERP requirs a locale+zone mapping while Rails uses locale only, so mapping is likely to be required.
Class Method Details
.to_erp_locale(locale) ⇒ Object
OpenERP requirs a locale+zone mapping while Rails uses locale only, so mapping is likely to be required
4 5 6 7 8 9 10 11 |
# File 'lib/ooor/locale.rb', line 4 def self.to_erp_locale(locale) if Ooor.default_config[:locale_mapping] mapping = Ooor.default_config[:locale_mapping] else mapping = {'fr' => 'fr_FR', 'en' => 'en_US'} end (mapping[locale.to_s] || locale.to_s).gsub('-', '_') end |