Sha256: a4d785bd7c6ff40f2f9daf5df19c374df2e44fe539548eeeedb877998ab9a1d3
Contents?: true
Size: 646 Bytes
Versions: 9
Compression:
Stored size: 646 Bytes
Contents
pageflow.i18nUtils = { findTranslation: function(keys, options) { options = options || {}; return _.chain(keys).reverse().reduce(function(result, key) { return I18n.t(key, {defaultValue: result}); }, options.defaultValue).value(); }, findKeyWithTranslation: function(keys) { var missing = '_not_translated'; return _(keys).detect(function(key) { return I18n.t(key, {defaultValue: missing}) !== missing; }) || _.first(keys); }, translationKeysWithSuffix: function(keys, suffix) { return _.chain(keys).map(function(key) { return [key + '_' + suffix, key]; }).flatten().value(); } };
Version data entries
9 entries across 9 versions & 1 rubygems