feat: client side game strings

This commit is contained in:
TrèsAbhi committed 2026-01-13 13:30:09 -06:00
1 parent 2d282a3261
commit f5f3f70e35
7 files changed
+60 -13

No files matched your search

+6 -3
View File
@@ -101,14 +101,17 @@ export class ServerAPI extends AbstractAPI {
return strings;
}
protected async _groupedGameStrings(locale: string, group: string) {
protected async _groupedGameStrings(
locale: string,
group: string,
prefix: boolean
) {
const strings = await this.gameStrings(locale);
const filtered: Record<string, string> = {};
for (const key in strings) {
if (key.startsWith(`${group}__`)) {
const trimmed = key.substring(group.length + 2);
filtered[trimmed] = strings[key];
filtered[prefix ? key : key.substring(group.length + 2)] = strings[key];
}
}