ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.49k stars 3.7k forks source link

Why error when use webpack to set ui-language? #8302

Closed SparkElf closed 3 years ago

SparkElf commented 3 years ago

✔️ Expected result

reset ui-language to zh-cn successfully.

❌ Actual result

Error Massage:

vue-cli-service serve Starting development server... 92% chunk asset optimization CKEditor5Plugin[CKEditorWebpackPlugin] Error: No translation has been found for the zh-cn language. 98% after emitting CopyPlugin

📃 Other details


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

SparkElf commented 3 years ago

details in vue.config.js(copied from official document)

const path = require( 'path' );
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
const { styles } = require( '@ckeditor/ckeditor5-dev-utils' );

module.exports = {
    // The source of CKEditor is encapsulated in ES6 modules. By default, the code
    // from the node_modules directory is not transpiled, so you must explicitly tell
    // the CLI tools to transpile JavaScript files in all ckeditor5-* modules.
    transpileDependencies: [
        /ckeditor5-[^/\\]+[/\\]src[/\\].+\.js$/,
    ], 
    configureWebpack: {
        plugins: [
            // CKEditor needs its own plugin to be built using webpack.
            new CKEditorWebpackPlugin( {
                // See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
                language: 'zh-cn',

                // Append translations to the file matching the `app` name.
                translationsOutputFile: /app/
            } )
        ]
    },
FilipTokarski commented 3 years ago

Hi, I just checked it and I'm able to set zh-cn translations in Vue with no errors. Please check if you have latest ckeditor packages, especially ckeditor5-vue. If that's not the case, we'll ned more information about your setup ( editor config, package.json, etc. ) and step-by-step instruction to reproduce this error.

SparkElf commented 3 years ago

I had solved this problem,this error was caused by my app environment. Thanks for your check.