Issue #2713Opened April 15, 2020by Lerdouille0 reactions

[QUESTION] Issue with i18n

Question

Hi,

first of all thank you for this awesome plugin. Sorry for the request, but i spent a few hours to look for the answer on this github page and other documentations but i can't find the good solution to use i18n on this plugin... and translate the editor in french for example...

I see in the src folder the locale directory with its configuration and all the languages available but how can i configure the plugin to force the locale ?

Here is the basic javascript code :

var editor = grapesjs.init({ showOffsets: 1, noticeOnUnload: 0, container: '#gjs', height: '100%', width: 'auto', fromElement: true, showDevices: 0, storageManager: { autoload: 0 }, });

Could you please show me the way ?

Regards

Answers (2)

LerdouilleApril 16, 20200 reactions
Code SnippetTEXT
Hi @artf ,

i saw the documentation and the part reguarding i18n but i didn't succed to use it.
In your documentation, you use some import function, basically my code is pretty simpler and without import, like this : 

<html>
    <body>
        <link rel="stylesheet" href="grapesjs/css/grapes.min.css">
        <script src="grapesjs/grapes.js"></script>
        <div id="gjs">
                <h1>Hello World Component!</h1>
        </div>
        <script type="text/javascript">
                var editor = grapesjs.init({
                showOffsets: 1,
                noticeOnUnload: 0,
                container: '#gjs',
                height: '100%',
                width: 'auto',
                fromElement: true,
                showDevices: 0,
                storageManager: { autoload: 0 },
                });
        </script>
        </body>
</html>

I managed too implement some plugins and configure the design of the editor, but i'm stucked with this i18n issue...

Could you please tell me what i'm doing wrong ?

I precise that i apparently my project is for now composed with only 3 files, the grapesjs.js, grapes.css and my HTML file. When i download your project on github, there are a few folders (and specially on named /src where i can find the locales files), but the plugin does not need them to work, is it normal ?

Regards and thank you again for the support :)

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.