Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

671 B
Raw Blame
import type { SupportedLanguage } from "./languages";
import { supportedLanguages } from "./languages";
import type { stringOrTranslation, TranslationFunction } from "./type";

export * from "./type";
export * from "./config";
export { createLanguageMapping } from "./mapping";
export type { TranslationKeys } from "./mapping";

export const translateIfNecessary = (t: TranslationFunction, value: stringOrTranslation | undefined) => {
  if (typeof value === "function") {
    return value(t);
  }
  return value;
};

export const isLocaleSupported = (locale: string): locale is SupportedLanguage => {
  return supportedLanguages.includes(locale as SupportedLanguage);
};