branch names

This commit is contained in:
tresabhi committed 2026-08-08 20:56:45 -05:00
1 parent c5bb537bf2
commit 5bda754b6e
10 files changed
+22 -124

No files matched your search

+6 -13
View File
@@ -3,19 +3,12 @@ import { STRINGS } from "@blitzkit/i18n";
import locales from "@blitzkit/i18n/locales.json";
export function resolveBranchName(locale: string = locales.default) {
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
const strings = STRINGS[locale];
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT);
if (
assertSecret(import.meta.env.MODE) === "development" &&
secret === "dev"
) {
return strings.common.branches.local;
} else {
return (strings.common.branches as Record<string, string>)[secret] as
| string
| undefined;
}
if (environment === "production") return undefined;
return strings.common.branches[
environment as keyof typeof strings.common.branches
];
}