easy-locale: init

This commit is contained in:
undefined committed 2021-05-24 22:01:20 +08:00
1 parent b43a9e174a
commit 27ef93a1d0
3 files changed
+27

No files matched your search

+10
View File
@@ -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);
});
+11
View File
@@ -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"
}
}
+6
View File
@@ -0,0 +1,6 @@
langs:
type: yaml
desc: Custom Translation
default:
zh:
text: 文本