You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next.js has it's own language detection... beside that, I don't know exactly what you mean...
Please do not just paste code snippets but create a minimal reproducible example repository
Directory structure:
src/
├── app/
│ └──actions.ts
next-i18next.config.js
next.config.js
//next-i18next.config.js
/**
*/
const path = require('path');
module.exports = {
i18n: {
defaultLocale: 'zh',
locales: ['en', 'zh'],
},
};
//next.config.js
const { withStoreConfig } = require("./store-config")
const store = require("./store.config.json")
/** @type {import('next').NextConfig} */
const { i18n } = require('./next-i18next.config');
/**
*/
const nextConfig = withStoreConfig({
// i18n,
features: store.features,
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: "http",
hostname: "localhost",
},
{
protocol: "https",
hostname: "medusa-public-images.s3.eu-west-1.amazonaws.com",
},
{
protocol: "https",
hostname: "medusa-server-testing.s3.amazonaws.com",
},
{
protocol: "https",
hostname: "medusa-server-testing.s3.us-east-1.amazonaws.com",
},
],
},
})
console.log("next.config.js", JSON.stringify(module.exports, null, 2))
module.exports = nextConfig
//actions.ts
"use server"
import { revalidateTag } from "next/cache"
import { cookies } from "next/headers"
import { redirect } from "next/navigation"
import { getRegion, updateCart } from "@lib/data"
/**
*/
export async function updateRegion(countryCode: string, currentPath: string) {
const cartId = cookies().get("_medusa_cart_id")?.value
const region = await getRegion(countryCode)
if (!region) {
return null
}
try {
if (cartId) {
await updateCart(cartId, { region_id: region.id })
revalidateTag("cart")
}
} catch (e) {
return "Error updating region"
}
console.log("1111")
redirect(
/${countryCode}${currentPath}
)}
export async function resetOnboardingState(orderId: string) {
cookies().set("_medusa_onboarding", "false", { maxAge: -1 })
redirect(
http://localhost:7001/a/orders/${orderId}
)}
The expected result should be yarn dev running and automatically jumping to http://localhost:8000/zh after opening http://localhost:8000
The text was updated successfully, but these errors were encountered: