mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
ui: upgrade monaco-editor to 0.52
This commit is contained in:
3 files changed
+5
-17
No files matched your search
@@ -60,9 +60,5 @@
|
||||
"supertest": "^7.0.0",
|
||||
"typescript": "5.7.2",
|
||||
"wtfnode": "^0.10.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"cosmokit": "1.6.3",
|
||||
"monaco-editor": "0.50.0"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
export { getNLSLanguage, getNLSMessages } from 'monaco-editor/esm/vs/nls.messages';
|
||||
|
||||
function format(message, args) {
|
||||
let result;
|
||||
if (!args.length) result = message;
|
||||
@@ -10,16 +12,14 @@ function format(message, args) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export const getConfiguredDefaultLocale = () => 'zh';
|
||||
|
||||
let CURRENT_LOCALE_DATA = {}; // eslint-disable-line @typescript-eslint/naming-convention
|
||||
|
||||
export function localize(path, message, ...args) {
|
||||
return format(CURRENT_LOCALE_DATA[path.key || path] || message, args);
|
||||
return format(CURRENT_LOCALE_DATA[path.key || path] || CURRENT_LOCALE_DATA[message] || message, args);
|
||||
}
|
||||
|
||||
export function localize2(data, message, ...args) {
|
||||
const original = localize(message, args);
|
||||
const original = localize(data, message, args);
|
||||
return {
|
||||
value: original,
|
||||
original,
|
||||
@@ -29,11 +29,3 @@ export function localize2(data, message, ...args) {
|
||||
export function setLocaleData(data) {
|
||||
CURRENT_LOCALE_DATA = Object.assign(...Object.values(data));
|
||||
}
|
||||
|
||||
export function loadMessageBundle() {
|
||||
return localize;
|
||||
}
|
||||
|
||||
export function config() {
|
||||
return loadMessageBundle;
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
"md-editor-rt": "^5.2.1",
|
||||
"mini-css-extract-plugin": "^2.9.2",
|
||||
"moment": "^2.30.1",
|
||||
"monaco-editor": "0.50.0",
|
||||
"monaco-editor": "0.52.2",
|
||||
"monaco-editor-nls": "^3.1.0",
|
||||
"monaco-editor-webpack-plugin": "^7.1.0",
|
||||
"monaco-themes": "^0.4.4",
|
||||
|
||||
Reference in new issue
Block a user