如何更改语言angular js ck编辑器

问题描述

每个人。我想找出使用​​angular js实现为ck编辑器更新语言的可能解决方案,现在仅当我使用$ state.reload完全刷新页面时,语言才会更改。但是不知何故,它可能应该...任何想法都得到赞赏

link: function ($scope,element,attrs,ngModel) {
    var config = {
        language: $translate.preferredLanguage()
    };
    
    CKEDITOR.timestamp = (new Date()).valueOf();


    if (angular.isDefined(attrs.maxTextLength) && angular.isFunction($scope.maxTextLength) && $scope.maxTextLength() > 0) {
        config.wordcount = {
            showCharCount: true,showParagraphs: false,showWordCount: false,maxCharCount: $scope.maxTextLength(),countSpacesAsChars: true
        };
    }

    config.removePlugins = 'elementspath';
    config.disallowedContent = 'span{font,font-size,font-family}';

    let ck = CKEDITOR.replace(element[0],config);

    $rootScope.$on('$translateChangeSuccess',function(event,args) {
     // it catches that translations has been updated,but contents are not gettin traslated
     

     console.log(CKEDITOR.instances) // shows empty object :(
     config.language = 'nl';
     CKEDITOR.replace(element[0],config);
    });

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)