Issue #3022Opened September 15, 2020by trony20200 reactions

Localization without using "import"

Question

Code SnippetTEXT
Hi,
to do localization is there a way to do it without using "import" ie with <script src="myFolder/grapesjs/locale/it.js"></script>?

From the docs:

import grapesjs from 'grapesjs';
import it from 'grapesjs/locale/it';
import tr from 'grapesjs/locale/tr';
const editor = grapesjs.init({
  ...
  i18n: {
    // locale: 'en', // default locale
    // detectLocale: true, // by default, the editor will detect the language
    // localeFallback: 'en', // default fallback
    messages: { it, tr },
  }
});

Answers (3)

artfSeptember 16, 20200 reactions

Current locale files are optimized only for importing them via import but you always build them on your own

applibsMarch 22, 20230 reactions

And how? Is anywhere documentation how to setup locale in vanilla js?

AhrimanFebruary 26, 20240 reactions

Same problem here, how we can set the locale in JavaScript vanilla?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.