Sha256: c871f3c8c6f8dd17451251cceb922e9432dc4af482795f98497af35ef1f10a40

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

(function() {
  // Spree's locales are different to Summernotes
  // Summernote defaults to english if it doesn't get what's being set
  var metaTranslations = {
    "ca": "ca-ES",
    "cs": "cs-CZ",
    "da": "da-DK",
    "de": "de-DE",
    "es": "es-ES",
    "fa": "fa-FA",
    "fi": "fi-FI",
    "fr": "fr-FR",
    "id": "id-ID",
    "it": "it-IT",
    "ja": "ja-JP",
    "ko": "ko-KR",
    "nb": "nb-NO",
    "nl": "nl-NL",
    "pl": "pl-PL",
    "pt": "pt-PT",
    "ro": "ro-RO",
    "ru": "ru-RU",
    "sk": "sk-SK",
    "sl-SI": "sl-SI",
    "sv": "sv-SE",
    "th": "th-TH",
    "uk": "uk-UA",
    "vi": "vi-VN",
    "zh-CN": "zh-CN",
    "zh-TW": "zh-TW"
  };

  $(document).ready(function() {

    var locale = $('html').attr('lang');
    var translation = metaTranslations[locale];
    var selectors = [
      '.summernote', 
      '.description .panel-body textarea', 
      '#product_description', 
      '#taxon_description', 
      '#promotion_description'
    ].join(',');

    $(selectors).summernote({
      lang: translation
    });
    
  });
})();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_summernote-3.0.0 app/assets/javascripts/spree_summernote/summernote_settings.js