froala / vue-froala-wysiwyg

Vue component for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
633 stars 86 forks source link

vue how to config language? #21

Closed pasBone closed 7 years ago

pasBone commented 7 years ago

vue how to config language? i config language: "zh_cn",
but it had no effect。 thanks.

stefanneculai commented 7 years ago

You should also include the language file:

require('froala-editor/js/languages/zh_cn')
wanghognyu521 commented 6 years ago

require() is Unresolved function or method ?why

parallel-kevin commented 6 years ago

@stefanneculai Hi, I have included the language file as you said

import VueFroala from 'vue-froala-wysiwyg'
require('froala-editor/js/languages/zh_cn')

But it went wrong

Uncaught TypeError: Cannot read property 'LANGUAGE' of undefined

Is there any solution?

stefanneculai commented 6 years ago

@parallel-kevin please make sure you are including the editor first


// Require Froala Editor js file.
require('froala-editor/js/froala_editor.pkgd.min')
require('froala-editor/js/languages/zh_cn')

// Require Froala Editor css files.
require('froala-editor/css/froala_editor.pkgd.min.css')
require('font-awesome/css/font-awesome.css')
require('froala-editor/css/froala_style.min.css')

// Import and use Vue Froala lib.
import VueFroala from 'vue-froala-wysiwyg'