Skip to content

Commit

Permalink
chore: -locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Mar 23, 2024
1 parent 908b9c0 commit 3887ada
Show file tree
Hide file tree
Showing 178 changed files with 7 additions and 21 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function RootLayout({
vendor = await getVendor();
wallets = await getMyWallets(walletscurrencies);
} else if (!fullUrl.includes('login') && !fullUrl.includes('signup')) {
return <meta http-equiv="refresh" content="0; url=/html/login" />;
return <meta httpEquiv="refresh" content="0; url=/html/login" />;
}

return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const verifyPgpPage = async () => {
<ApolloWrapper>
{isNotValidRequest && (
<noscript>
<meta http-equiv="refresh" content="0; url=/html/settings/pgp" />
<meta httpEquiv="refresh" content="0; url=/html/settings/pgp" />
</noscript>
)}
<PgpSettingPage {...props} />;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
18 changes: 2 additions & 16 deletions src/app/[locale]/layout.tsx → src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import 'react-image-gallery/styles/css/image-gallery.css';
import { isEmpty } from 'lodash';
import type { Metadata } from 'next';
import { cookies } from 'next/headers';
import { notFound } from 'next/navigation';
import { NextIntlClientProvider, useMessages } from 'next-intl';

import StyledComponentsRegistry from '@/lib/styled-registry';
import { AppConfig } from '@/utils/AppConfig';

export const metadata: Metadata = {
icons: [
Expand Down Expand Up @@ -44,26 +41,15 @@ export default function RootLayout(props: {
const cookieStore = cookies();
const theme = cookieStore.get('theme');

// Validate that the incoming `locale` parameter is valid
if (!AppConfig.locales.includes(props.params.locale)) notFound();

// Using internationalization in Client Components
const messages = useMessages();

return (
<html
lang={props.params.locale}
lang="en"
className={`js-focus-visible tw-root--theme-${
theme && !isEmpty(theme?.value) ? theme.value : 'light'
} tw-root--hover`}
>
<body>
<NextIntlClientProvider
locale={props.params.locale}
messages={messages}
>
<StyledComponentsRegistry>{props.children}</StyledComponentsRegistry>
</NextIntlClientProvider>
<StyledComponentsRegistry>{props.children}</StyledComponentsRegistry>
</body>
</html>
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/[locale]/page.tsx → src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async function Home() {
validateEndgameSession(endgamex, endgamei),
);
if (validEndgame) {
return <meta http-equiv="refresh" content="0; url=/html" />;
return <meta httpEquiv="refresh" content="0; url=/html" />;
}

const [, captchaRes] = await awaitTo(getCaptchaFromLocalhost());
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { stackMiddlewares } from '@/middlewares/stackHandler';

import endGameMiddleware from './middlewares/endgame';
import translationMiddleware from './middlewares/translation'; // config as translationConfig,
// config as translationConfig,

// TODO combine all middlewares config matches
const middlewares = [translationMiddleware, endGameMiddleware];
const middlewares = [endGameMiddleware];
export default stackMiddlewares(middlewares);

export const config = {
Expand Down

0 comments on commit 3887ada

Please sign in to comment.