2013-02-18 98 views
0

我想为我的一个项目使用Aloha-Editor。默认的项目语言是德语,但我找不到任何方法来更改编辑器的语言。 (搜索他们的网站和指南)更改Aloha编辑语言

我发现的唯一的事情是如何在为编辑器开发插件时使用i18n,而不是如何在当前稳定版本中设置语言。

这是我做过什么:

<!-- load the jQuery and require.js libraries --> 
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script> 
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.2.js"></script> 

<!-- load the Aloha Editor core and some plugins --> 
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" 
     data-aloha-plugins="common/ui, 
          common/format, 
          common/list, 
          common/link, 
          common/highlighteditables"> 
</script> 

<!-- load the Aloha Editor CSS styles --> 
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" rel="stylesheet" type="text/css" /> 

<!-- make all elements with class="editable" editable with Aloha Editor --> 
<script type="text/javascript"> 
    Aloha.ready(function() { 
     var $ = Aloha.jQuery; 
     $('.editable').aloha(); 
    }); 
</script> 

有谁知道我需要添加或更改,以获得在其他语言的编辑器?

回答

2

起初,我发现在​​的东西,但这样做并没有为我工作。

比我看了演示页面,来到这个工作解决方案。我不得不添加下面的JavaScript之前,我包括require.jsaloha.js

<script language="javascript"> 
    Aloha = window.Aloha || {}; 
    Aloha.settings = { 
     locale: 'de' 
    }; 
</script> 

然后阿罗哈脚本自动加载的所选择的语言对于i18n文件。我使用了本地版本的aloha,并没有使用http://cdn.aloha-editor.org/latest版本进行测试。我的版本是0.22.7。

+0

出于某种原因,我不得不删除'common/block'插件让它工作 – Pere 2013-12-27 23:39:24

1

您可以下载其他语言herehelp file 有更多信息您可以通过管理 - >语言随时在您的项目中更改主语言。

希望这有助于

雷切尔

+0

@ tbraun89查看更新的答案 – 2013-02-18 18:39:28

+0

我拥有js格式的所有语言文件,但我不知道如何使用它们。 gengo仅仅是为了开发新的插件还是为现有的或者核心提供新的语言? 当我下载了语言文件时,我并不清楚如何在我的应用程序中加载。 – tbraun89 2013-02-18 18:59:36

+0

我说再次下载https://github.com/akzhan/jwysiwyg – 2013-02-18 19:22:37