i18next / next-i18next

The easiest way to translate your NextJs apps.
https://next.i18next.com
MIT License
5.38k stars 762 forks source link

After setting it according to the document, "redirect(/url)" in the action file is not useful, what is the reason? #2264

Open czw333221 opened 4 months ago

czw333221 commented 4 months ago

Directory structure: src/ ├── app/ │ └──actions.ts next-i18next.config.js next.config.js

//next-i18next.config.js /**

//next.config.js const { withStoreConfig } = require("./store-config") const store = require("./store.config.json")

/* @type {import('next').NextConfig} / const { i18n } = require('./next-i18next.config');

/**

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 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

adrai commented 4 months ago

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