mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
versions and shit
This commit is contained in:
1 parent
c42b109974
commit
480d2226f7
4 files changed
+28
-27
No files matched your search
@@ -33,6 +33,8 @@ import { parse as parseYaml } from "yaml";
|
||||
import { AbstractBlitzKitAPI } from "../abstract";
|
||||
|
||||
export abstract class ServerBlitzKitAPI0 extends AbstractBlitzKitAPI {
|
||||
// TODO: move most of these to their respective constructors
|
||||
|
||||
protected vfs: AbstractVFS;
|
||||
protected parsePath?: typeof parse;
|
||||
protected extname?: typeof extname;
|
||||
|
||||
@@ -5,17 +5,18 @@ import { merge } from "lodash-es";
|
||||
import { Cache } from "./0_base";
|
||||
import { ServerBlitzKitAPI11 } from "./11_scripts";
|
||||
|
||||
const globbedStrings = import.meta.glob("../../../../../i18n/strings/*.json", {
|
||||
import: "default",
|
||||
});
|
||||
|
||||
export abstract class ServerBlitzKitAPI12 extends ServerBlitzKitAPI11 {
|
||||
private globbedStrings = import.meta.glob(
|
||||
"../../../../../i18n/strings/*.json",
|
||||
{ import: "default" },
|
||||
);
|
||||
|
||||
@Cache()
|
||||
async strings(locale: string) {
|
||||
const localized = (await globbedStrings[
|
||||
const localized = (await this.globbedStrings[
|
||||
`../../../../../i18n/strings/${locale}.json`
|
||||
]()) as DeepPartial<Strings>;
|
||||
const defaults = (await globbedStrings[
|
||||
const defaults = (await this.globbedStrings[
|
||||
`../../../../../i18n/strings/${locales.default}.json`
|
||||
]()) as Strings;
|
||||
const strings = merge({}, defaults, localized);
|
||||
|
||||
Reference in new issue
Block a user