mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-15 05:36:11 +01:00
fix: store trimmed only in cache
This commit is contained in:
1 parent
4a6f5845f9
commit
3b4e089756
4 files changed
+20
-29
No files matched your search
@@ -12,29 +12,15 @@ export class ClientAPI extends AbstractAPI {
|
||||
throw new Error("Cannot fetch full game strings on client");
|
||||
}
|
||||
|
||||
protected async _groupedGameStrings(
|
||||
locale: string,
|
||||
group: string,
|
||||
prefix: boolean
|
||||
) {
|
||||
protected async _groupedGameStrings(locale: string, group: string) {
|
||||
const response = await fetch(`/api/game-strings/${locale}/${group}.json`);
|
||||
const json = (await response.json()) as Record<string, string>;
|
||||
|
||||
if (!prefix) return json;
|
||||
|
||||
const strings: Record<string, string> = {};
|
||||
|
||||
for (const key in json) {
|
||||
strings[`${group}__${key}`] = json[key];
|
||||
}
|
||||
|
||||
return strings;
|
||||
return json;
|
||||
}
|
||||
|
||||
protected async _strings(locale: string) {
|
||||
const response = await fetch(`/api/strings/${locale}.json`);
|
||||
const json = (await response.json()) as Strings;
|
||||
|
||||
return json;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user