-
-
Notifications
You must be signed in to change notification settings - Fork 805
Feature/add next intl for localization #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sseshaheen
wants to merge
18
commits into
medusajs:main
Choose a base branch
from
sseshaheen:feature/add-next-intl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b2f053d
Added next-intl integration
6fc7762
finalize next-intl integration
3a0b83b
remove unneeded files and code
822828f
request-config.ts instead of request-config.js
8240eb0
refactor: inline config-callback logic into request-config.ts
df5e50a
refactor: use the built-in defineRouting from next-intl for type-safe…
49853b7
use import instead of require in request-config.ts
d00ed8a
use next-intltype-safe messages without listing all keys separately
ab51787
embedding interpolation placeholders directly within translation strings
1a95648
format dates with next-intl useFormatter() to replace toDateString()
3bd342f
refactor layout.tsx for middleware-driven locale detection with next-…
ad6d275
use createNavigation() instead of deprecated createSharedPathnamesNav…
c69bddb
add some missing localizations and fixes
201f126
move messages out of the src folder
1e5179e
remove unneeded old import
2450524
make translations in JSON files for better interop with other tools
df098b5
rename request-config.ts to request.ts
144937c
rename ref of request-config.ts to request.ts in next-config.js
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 contains hidden or 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 hidden or 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,50 @@ | ||
import k from "@lib/i18n/translations/keys" | ||
import { getTranslations } from "next-intl/server" | ||
import LocalizedClientLink from "@modules/common/components/localized-client-link" | ||
import ChevronDown from "@modules/common/icons/chevron-down" | ||
import MedusaCTA from "@modules/layout/components/medusa-cta" | ||
import { Suspense } from "react" | ||
|
||
export default async function CheckoutLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
params: { locale: string } | ||
}) { | ||
const t = await getTranslations() | ||
return ( | ||
<Suspense fallback={<></>}> | ||
<div className="w-full bg-white relative small:min-h-screen"> | ||
<div className="h-16 bg-white border-b "> | ||
<nav className="flex h-full items-center content-container justify-between"> | ||
<LocalizedClientLink | ||
href="/cart" | ||
className="text-small-semi text-ui-fg-base flex items-center gap-x-2 uppercase flex-1 basis-0" | ||
data-testid="back-to-cart-link" | ||
> | ||
<ChevronDown className="rotate-90" size={16} /> | ||
<span className="mt-px hidden small:block txt-compact-plus text-ui-fg-subtle hover:text-ui-fg-base "> | ||
{t(k.BACK_TO_SHOPPING_CART)} | ||
</span> | ||
<span className="mt-px block small:hidden txt-compact-plus text-ui-fg-subtle hover:text-ui-fg-base"> | ||
{t(k.BACK)} | ||
</span> | ||
</LocalizedClientLink> | ||
<LocalizedClientLink | ||
href="/" | ||
className="txt-compact-xlarge-plus text-ui-fg-subtle hover:text-ui-fg-base uppercase" | ||
data-testid="store-link" | ||
> | ||
{t(k.MEDUSA_STORE)} | ||
</LocalizedClientLink> | ||
<div className="flex-1 basis-0" /> | ||
</nav> | ||
</div> | ||
<div className="relative" data-testid="checkout-container">{children}</div> | ||
<div className="py-4 w-full flex items-center justify-center"> | ||
<MedusaCTA /> | ||
</div> | ||
</div> | ||
</Suspense> | ||
) | ||
} |
This file contains hidden or 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 hidden or 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
File renamed without changes.
This file contains hidden or 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 hidden or 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
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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 hidden or 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
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.