We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 939aac2 commit eec7271Copy full SHA for eec7271
2025/src/i18n/index.ts
@@ -2,14 +2,6 @@ export const LANGUAGES = ['ja', 'en'] as const;
2
3
type Lang = typeof LANGUAGES[number];
4
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
-
13
export function useTranslate(lang: Lang): (...translations: string[]) => string {
14
return (...translations: string[]) => translations[LANGUAGES.indexOf(lang)]; ;
15
}
0 commit comments