Sha256: 762663bbe88d69b3eb85b9f990609af383b86491af990f79bcde1ce77141eccd

Contents?: true

Size: 454 Bytes

Versions: 11

Compression:

Stored size: 454 Bytes

Contents

var I18n = {
  locale: null,
  translations: null,
  init(locale, translations) {
    this.locale = locale;
    this.translations = translations;
    if (typeof this.translations === "string") {
      this.translations = JSON.parse(this.translations);
    }
  },
  t(key) {
    var humanize;
    humanize = key.charAt(0).toUpperCase() + key.replace(/_/g, " ").slice(1);
    return this.translations[key] || humanize;
  },
};

export { I18n as default };

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_admin-3.2.1 src/rails_admin/i18n.js
rails_admin-3.2.0 src/rails_admin/i18n.js
rails_admin-3.2.0.rc src/rails_admin/i18n.js
rails_admin-3.2.0.beta src/rails_admin/i18n.js
rails_admin-3.1.4 src/rails_admin/i18n.js
rails_admin-3.1.3 src/rails_admin/i18n.js
rails_admin-3.1.2 src/rails_admin/i18n.js
rails_admin-3.1.1 src/rails_admin/i18n.js
rails_admin-3.1.0 src/rails_admin/i18n.js
rails_admin-3.1.0.rc2 src/rails_admin/i18n.js
rails_admin-3.1.0.rc src/rails_admin/i18n.js