Update: 更新monaco (version: 0.52.2) 同时增加多国语言支持
This commit is contained in:
@@ -25,18 +25,17 @@ class EditorAce extends EditorBase {
|
||||
this.CTRL_BTNS = ['resetFontSize', 'increaseFontSize', 'decreaseFontSize'];
|
||||
this.CTRL_BTN_TEMPLATE = '<div m-id="{{d.mId}}" class="code-editor-btn setFontSize"></div>';
|
||||
this.MODE_MAP = goog.getJSON(path.join(Env.templatePath, 'json/ace-mode-map.json'));
|
||||
this.I18N = {
|
||||
'zh-hans': goog.getJSON(path.join(Env.templatePath, 'json/ace-i18n-zh-hans.json')),
|
||||
'zh-hant': goog.getJSON(path.join(Env.templatePath, 'json/ace-i18n-zh-hant.json')),
|
||||
'en': goog.getJSON(path.join(Env.templatePath, 'json/ace-i18n-en.json'))
|
||||
}
|
||||
|
||||
HTMLTemplate.add(
|
||||
'html/editor/editor-code.html',
|
||||
new HTMLTemplate(goog.get(path.join(Env.templatePath, 'html/editor/editor-code.html')))
|
||||
);
|
||||
|
||||
ace.config.setMessages(this.I18N[Msg.nowLang]);
|
||||
if (['zh-hans', 'zh-hant'].includes(Msg.nowLang)) {
|
||||
ace.config.setMessages(
|
||||
goog.getJSON(path.join(Env.templatePath, `json/ace.i18n.${Msg.nowLang}.json`))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#editor_ = null;
|
||||
|
||||
Reference in New Issue
Block a user