From 945df4af1b2d01948aa0c191b4d229365e4aecf7 Mon Sep 17 00:00:00 2001 From: paring Date: Sat, 4 Jan 2025 01:36:22 +0900 Subject: [PATCH] feat: exclude language --- src/lib/utils/translation.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/utils/translation.ts b/src/lib/utils/translation.ts index 7d2efae..690ca86 100644 --- a/src/lib/utils/translation.ts +++ b/src/lib/utils/translation.ts @@ -9,9 +9,17 @@ import { FluentBundle, FluentResource, type FluentVariable } from '@fluent/bundl import { translationData } from '$lib/localization/translations/index.js' export const availableLanguages: LangResponse[] = langs - export const fallbackLang = 'ko' +export const excludeLanguages = (...languages: string[]) => { + languages.forEach((l) => { + const index = availableLanguages.findIndex((x) => x.code === l) + if (index >= 0) { + availableLanguages.splice(index, 1) + } + }) +} + const registeredLangSections: string[] = [] const langSections = ['ui-common', 'ui-footer', 'ui-search'] as const