just a couple tiny changes to i18n related code.

This commit is contained in:
wearrrrr 2024-01-28 01:02:34 -06:00
parent 9454eda791
commit d45cd21847
2 changed files with 1 additions and 6 deletions

View file

@ -1,12 +1,6 @@
import en from './en.json';
import jp from './jp.json';
export const languages = {
en: 'English',
jp: "日本語",
};
export const defaultLang = 'en';
export const ui = {

View file

@ -1,6 +1,7 @@
import { ui, defaultLang } from './ui';
export function getLangFromUrl(url: URL) {
// comma lol
const [, lang] = url.pathname.split('/');
if (lang in ui) return lang as keyof typeof ui;
return defaultLang;