[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)
@Lerdouille it's all explained here https://grapesjs.com/docs/modules/I18n.html
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.
Issue #2719
[QUESTION] How can I mark a class name as protected or private in a component.
Hi team, First let me thank you all for creating this wonderful library. You guys are awesome. I want to disable editing a specific class n...
Issue #1897
[Question] view vs code
Hello...and sorry for my english! First of all, congratulations for this fantastic framework. I'm trying to use GrapeJS to create my own wo...
Issue #2570
[QUESTION] 3rd party RTE integration
Hi there! Great work at grapesjs! Is there any list of external RTE's to integrate in grapesjs? I've spent a few days trying to integrate a...
Issue #1499
[Question] Is it possible to perform dom manipulation through the block's contents script?
Hey! First of all thank you so much to build such a great and versatile tool. Is it possible that I can manipulate the dom elements of the...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.