mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
easy-locale: init
This commit is contained in:
1 parent
b43a9e174a
commit
27ef93a1d0
3 files changed
+27
No files matched your search
@@ -0,0 +1,10 @@
|
|||||||
|
import yaml from 'js-yaml';
|
||||||
|
import * as bus from 'hydrooj/dist/service/bus';
|
||||||
|
import * as system from 'hydrooj/dist/model/system';
|
||||||
|
import i18n from 'hydrooj/dist/lib/i18n';
|
||||||
|
|
||||||
|
bus.once('app/started', () => {
|
||||||
|
const langs = system.get('easy-locale.langs');
|
||||||
|
const entries = yaml.load(langs);
|
||||||
|
i18n(entries as any);
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "@hydrooj/easy-locale",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "package.json",
|
||||||
|
"repository": "https://github.com/hydro-dev/Hydro",
|
||||||
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"js-yaml": "^4.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
langs:
|
||||||
|
type: yaml
|
||||||
|
desc: Custom Translation
|
||||||
|
default:
|
||||||
|
zh:
|
||||||
|
text: 文本
|
||||||
Reference in new issue
Block a user