Issue #2721Opened April 17, 2020by alex19891 reactions

[Bug] Can not import any locale file from grapesjs/locale/

Question

Hi I run into an error when I'm trying to import any locale file from 'grapejs/locale' by using es6 import

I followed by the documentation:

https://grapesjs.com/docs/modules/I18n.html#configuration

but I always get this: image

I can import it only in next way image

Could you explain why I can't import it directly from grapesjs/locale/.

grapejs was installed by npm install

grapejs is latest version (0.16.3)

Answers (3)

padcomMarch 21, 20251 reactions

With the change provided by PR #6459 it is now possible to do the following:

  <script type="importmap">
    {
      "imports": {
        "grapesjs": "https://unpkg.com/grapesjs/dist/grapes.mjs",
        "grapesjs/locale/en": "https://unpkg.com/grapesjs/locale/en.mjs",
        "grapesjs/locale/pt": "https://unpkg.com/grapesjs/locale/pt.mjs",
      }
    }
  </script>

Make sure you also load the styles correctly:

  <link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
willGabrielPereiraJanuary 30, 20230 reactions

It still don't works, only works from "src/i18n/locale/...." Using v0.20.3

image

image

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.