Skip to content

Commit eec7271

Browse files
committed
chore: delete unused lang util function
1 parent 939aac2 commit eec7271

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

2025/src/i18n/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ export const LANGUAGES = ['ja', 'en'] as const;
22

33
type Lang = typeof LANGUAGES[number];
44

5-
export function getLangFromUrl(url: URL): Lang {
6-
const [, lang] = url.pathname.replace(import.meta.env.BASE_URL, '').split('/');
7-
if (lang in LANGUAGES) {
8-
return lang as Lang;
9-
}
10-
throw new Error(`Invalid language: ${lang}`);
11-
}
12-
135
export function useTranslate(lang: Lang): (...translations: string[]) => string {
146
return (...translations: string[]) => translations[LANGUAGES.indexOf(lang)]; ;
157
}

0 commit comments

Comments
 (0)