Files
homarr/packages/translation/src/index.ts
Manuel 4e1bbf2ae6 feat: add dynamic breadcrumb (#706)
* feat: add dynamic breadcrumb

* feat: pr feedback
2024-06-29 17:28:22 +02:00

19 lines
574 B
TypeScript

import type { stringOrTranslation, TranslationFunction } from "./type";
export * from "./type";
export * from "./locale-attributes";
export const supportedLanguages = ["en", "de"] as const;
export type SupportedLanguage = (typeof supportedLanguages)[number];
export const defaultLocale = "en";
export { languageMapping } from "./lang";
export type { TranslationKeys } from "./lang";
export const translateIfNecessary = (t: TranslationFunction, value: stringOrTranslation | undefined) => {
if (typeof value === "function") {
return value(t);
}
return value;
};