Skip to content

Instantly share code, notes, and snippets.

View bcaccinolo's full-sized avatar

Benoit Caccinolo bcaccinolo

View GitHub Profile
<type>(<scope>): <subject>
<body>
<footer>
#-------------------------------------------------------------------------------
# <type>
# - feat: A new feature
# - fix: A bug fix
@bcaccinolo
bcaccinolo / i18n_lookup.rb
Created December 22, 2014 08:08
Rails i18n_lookup
# config/initializers/i18n_lookup.rb
class I18n::Backend::Simple
module Implementation
protected
def lookup(locale, key, scope = [], options = {})
init_translations unless initialized?
keys = I18n.normalize_keys(locale, key, scope, options[:separator])