-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): Add i18n without routing
- Loading branch information
1 parent
e242d2c
commit f3d0a11
Showing
38 changed files
with
88 additions
and
60 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return children; | ||
import { GeistSans } from 'geist/font/sans'; | ||
import { | ||
generateMetadataRootLayout, | ||
RootLayout, | ||
RootLayoutProps, | ||
} from 'vitnode-frontend/views/layout/root-layout'; | ||
|
||
import './global.css'; | ||
|
||
export const generateMetadata = generateMetadataRootLayout; | ||
|
||
export default function Layout(props: RootLayoutProps) { | ||
return <RootLayout className={GeistSans.className} {...props} />; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
import createMiddleware from 'vitnode-frontend/middleware'; | ||
|
||
export default createMiddleware(); | ||
|
||
export const config = { | ||
matcher: '/((?!_next/static|_next/image|robots.txt|sitemap.xml|sitemap).*)', | ||
}; | ||
export default createMiddleware({}); |
13 changes: 13 additions & 0 deletions
13
packages/create-vitnode-app/templates/with-i18n-routing/apps/frontend/src/i18n.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { getRequestConfig } from 'next-intl/server'; | ||
import { i18nConfig } from 'vitnode-frontend/i18n'; | ||
|
||
export default getRequestConfig(async ({ locale }) => { | ||
const config = await i18nConfig({ | ||
locale, | ||
pathsToMessagesFromPlugins: async ({ plugin, locale }) => { | ||
return import(`./plugins/${plugin}/langs/${locale}.json`); | ||
}, | ||
}); | ||
|
||
return config; | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/create-vitnode-app/templates/with-i18n-routing/apps/frontend/src/middleware.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import createMiddleware from 'vitnode-frontend/middleware'; | ||
|
||
export default createMiddleware({ | ||
isLocalePathRoute: true, | ||
}); | ||
|
||
export const config = { | ||
matcher: '/((?!_next/static|_next/image|robots.txt|sitemap.xml|sitemap).*)', | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/create-vitnode-app/templates/without-i18n-routing/apps/frontend/src/middleware.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import createMiddleware from 'vitnode-frontend/middleware'; | ||
|
||
export default createMiddleware({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters