Sha256: ffc14695075e89f5512885faa9e59dfb12db571a607eaf4ac4fdb64a7c2f11bf

Contents?: true

Size: 395 Bytes

Versions: 5

Compression:

Stored size: 395 Bytes

Contents

//= require i18n_screwdriver/md5

const interpolate = (message, data) =>
  message.replace(/%{([^{}]*)}/g, (a, b) => data[b]);

I18n.screw = function(message, data) {
  const md5 = window.md5(message);
  let translation = I18n.translations[I18n.locale][md5];
  if (translation == null) {
    translation = I18n.onMissingTranslation(md5, message);
  }
  return interpolate(translation, data);
};

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i18n_screwdriver-10.7.2 app/assets/javascrips/i18n_screwdriver/screw.js
i18n_screwdriver-10.7.1 app/assets/javascrips/i18n_screwdriver/screw.js
i18n_screwdriver-10.7.0 app/assets/javascrips/i18n_screwdriver/screw.js
i18n_screwdriver-10.6.0 app/assets/javascrips/i18n_screwdriver/screw.js
i18n_screwdriver-10.5.0 app/assets/javascrips/i18n_screwdriver/screw.js