Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
export const LANG_DEFAULT = 'en' as const
export const LANG_SUPPORTED = new Set(['ca', 'de', 'en', 'es', 'fr', 'hi', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'pt-BR', 'ru', 'tr', 'zh'] as const)
export type i18nLocaleSupported = typeof LANG_SUPPORTED extends Set<infer T> ? T : never
export type i18nLocale = Exclude<i18nLocaleSupported, typeof LANG_DEFAULT>
export function normalizeLanguage(language: string): i18nLocaleSupported | null {
if (!language) return null
if (LANG_SUPPORTED.has(language as i18nLocaleSupported)) {
return language as i18nLocaleSupported
}
const code = language.split('-')[0]
return LANG_SUPPORTED.has(code as i18nLocaleSupported) ? (code as i18nLocaleSupported) : null
}