chore: update frontend dependencies and fix deprecated method use (#140)
This commit is contained in:
15
frontend/src/i18n/request.ts
Normal file
15
frontend/src/i18n/request.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getRequestConfig } from 'next-intl/server';
|
||||
import { routing } from './routing';
|
||||
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
let locale = await requestLocale;
|
||||
|
||||
if (!locale || !routing.locales.includes(locale as any)) {
|
||||
locale = routing.defaultLocale;
|
||||
}
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages: (await import(`../../messages/${locale}.json`)).default,
|
||||
};
|
||||
});
|
||||
15
frontend/src/i18n/routing.ts
Normal file
15
frontend/src/i18n/routing.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { createNavigation } from 'next-intl/navigation';
|
||||
import { defineRouting } from 'next-intl/routing';
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: ['en', 'ja'],
|
||||
defaultLocale: 'en',
|
||||
localePrefix: {
|
||||
mode: 'always',
|
||||
},
|
||||
});
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing);
|
||||
|
||||
export const NextUiLinkClasses =
|
||||
'data-[focus-visible=true]:outline-focus data-[focus-visible=true]:outline-offset-2 text-medium text-primary hover:underline hover:opacity-80 active:opacity-disabled transition-opacity underline-offset-4 dark:text-white';
|
||||
Reference in New Issue
Block a user