? 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 }, } });","answerCount":3,"author":{"@type":"Person","name":"trony2020","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2Ftrony2020"},"dateCreated":"2020-09-15T13:02:15Z","dateModified":"2024-02-26T13:44:30Z","acceptedAnswer":{"@type":"Answer","text":"Current locale files are optimized only for importing them via import but you always build them on your own","dateCreated":"2020-09-16T06:07:13Z","upvoteCount":0,"author":{"@type":"Person","name":"artf","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2Fartf"},"url":"https://gjs.market/issues/3022-localization-without-using-import#answer-693194054","sameAs":"https://github.com/GrapesJS/grapesjs/issues/3022#issuecomment-693194054"},"suggestedAnswer":[{"@type":"Answer","text":"And how? Is anywhere documentation how to setup locale in vanilla js?","dateCreated":"2023-03-22T09:40:53Z","upvoteCount":0,"author":{"@type":"Person","name":"applibs","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2Fapplibs"},"url":"https://gjs.market/issues/3022-localization-without-using-import#answer-1479218898","sameAs":"https://github.com/GrapesJS/grapesjs/issues/3022#issuecomment-1479218898"},{"@type":"Answer","text":"Same problem here, how we can set the locale in JavaScript vanilla?","dateCreated":"2024-02-26T13:44:29Z","upvoteCount":0,"author":{"@type":"Person","name":"Ahriman","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2FAhriman"},"url":"https://gjs.market/issues/3022-localization-without-using-import#answer-1964181835","sameAs":"https://github.com/GrapesJS/grapesjs/issues/3022#issuecomment-1964181835"}]}}
Issue #3022💬 AnsweredOpened September 15, 2020by trony20200 reactions

Localization without using "import"

Quick answerby artf

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

Read full answer below ↓

Question

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, 2020

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

applibsMarch 22, 2023

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

AhrimanFebruary 26, 2024

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.