Sha256: cea76c26a4663f62d02204e49496ea1bdcc5a5159b9abe7e13453b6ef9222ed0
Contents?: true
Size: 1.14 KB
Versions: 3
Compression:
Stored size: 1.14 KB
Contents
{"version":3,"file":"index.module.js","sources":["../package/src/index.js"],"sourcesContent":["import md5 from \"md5\";\n\nfunction onMissingTranslation(I18n, md5, message) {\n return `translation missing: ${I18n.locale}.${message}`;\n}\n\nconst interpolate = (message, data) =>\n message.replace(/%{([^{}]*)}/g, (a, b) => data[b]);\n\nexport default function configure(I18n) {\n I18n.screw = function screw(message, data) {\n const hash = md5(message);\n let translation = I18n.translations[I18n.locale]?.[hash];\n if (typeof translation === \"undefined\") {\n translation = onMissingTranslation(I18n, hash, message);\n }\n return interpolate(translation, data);\n };\n}\n"],"names":["I18n","screw","message","data","hash","md5","translation","translations","locale","_I18n$translations$I","onMissingTranslation","replace","a","b","interpolate"],"mappings":"2CASkCA,GAChCA,EAAKC,MAAQ,SAAeC,EAASC,SAC7BC,EAAOC,EAAIH,GACbI,YAAcN,EAAKO,aAAaP,EAAKQ,4BAAvBC,EAAiCL,GAInD,YAH2B,IAAhBE,IACTA,EAZN,SAA8BN,EAAMK,EAAKH,GACvC,8BAA+BF,EAAKQ,WAAUN,EAW5BQ,CAAqBV,EAAMI,EAAMF,IARjC,SAACA,EAASC,UAC5BD,EAAQS,QAAQ,eAAgB,SAACC,EAAGC,UAAMV,EAAKU,KAStCC,CAAYR,EAAaH"}
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
i18n_screwdriver-10.7.2 | dist/index.module.js.map |
i18n_screwdriver-10.7.1 | dist/index.module.js.map |
i18n_screwdriver-10.7.0 | dist/index.module.js.map |