Internationalization in NextJs 14 with Next-Intl | i18n
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- In this video, we will explore the implementation of next-intl within the Next.js app router using server components. Additionally, we will demonstrate the creation of a select button in the navbar, allowing users to switch between the English and Indonesian languages.
👨💻Code:
[github] github.com/can...
🔗Source:
[next-intl docs] next-intl-docs...
🚀Live:
nextlingo-beta...
#programming
you saved my life more than GPT 4o for sure ... Thanks you
The best tutorial for nextjs translations. Literally the only tutorial that worked for me the first time, perfectly explained and fully functional. Thanks a lot!
I was looking for a server-side internationalization package for a next.js project. And I found it! Thank you very much!!!
Great video! Probably the best explanation about Internationalization in Nextjs so far
men this is the best explanation that I have been seen
the best and only tutorial on youtube
bangga ada orang indo, bikin tutorial pake bahasa inggris di web dev
Terimakasih, yuk kita belajar bareng disini 😁
Thanks a lot! Straight forward tut! Learned something nice 👌🏼
thank you sharing code
good work bro
But its so slow with next-intl.... On each page request the page fetches the correct translations for like 0.2seconds... Either we block whole page render till translations are done or wrap translated parts in suspense which adds a lot of code + comlexity..
It was very helpful for me.thanks a lot.
Great video! Helped me a lot. Thanks!
great , for nested layout : for ex : the third layout i have include header and navbar but not working
saved me twice on two different projects 😃
Thanks, I was searching for long for this kind of video
Moving the layout.tsx to the locale directory, made everything else doesn't work properly in my project
Thank you for this video!
Can you make a video on RTL languages too?
Would be really appreciated.
Great video! thank you vert much!
Thanks, But we can not build production it gives error with static and i can not fixt it
Nice tutorial! Could you please add routing. like adding about and contact page. That is giving error
Nice tutorial though, thank you so much but sir Could you please create a second video with the app router (without the SRC) in nextjs i have tried to implement the same thing but i got some issues, please kindly create a second video i have existing app router projects that i will need to implement the translation this only works for the SRC, best regards
😊😉
Good morning, I followed the video and I would like to add pages to my project, how can I do it?
Does redirection of homepage affects SEO?
Sir, I have tried to implement next-intl, the only thing different is that I don't have src folder, I have app folder under root directory, I have followed the video and your github and it always led to not-found page, is there a way to get around src folder? 🤔
Try to put the src files in the video in your app folder
And organize the files import in i18n and middleware files
@@Falconforex OK,I will give it a try,thank you for the reply ❤
i don't think it is a good idea, we have existing projects with the app router and we need to know how we can implement the translation on it@@Falconforex , i have also faced this issue
bro did you found solution?
@@ashishsubedi1400 nope
So really nice tutorial dude. I have a question, is there any way to make the same with "PAGES ROUTER"?...It's because I realized that you set the language very well. And when you navigate back, it not return to last language route "/en" or route by default , it quit from the apliccations really well, and I want to achieve that behaviour. Hope your advice, Thanks a lot.
How to manage multiple middleware with different matcher config ?@Cand DEV
Good stuff, but I hate how you can't use multiple sententences in the namespaces. Basically they can't contain full stops, so you gotta plan around it.
Thank you very much for the explanation but we are still waiting second part for server side translation
what if i don't have src folder.
then use root folder
Hello, Which would be the importance of selecting yes for the src directory? How would be the process if I have the app with no src directory?
I have the same question
Nice tutorial thanks! i have a question.... How do i build a header responsive (burger menu , etc) with a "use client " ? or another solution?
Great video!
I have a question,
how could i do if i want to add another router, like app/bio/page.tsx ... I have to put it into my [locale] folder, or into app folder?
Thanks!!!
Whatif I have deeply nested routes? How would the router replace work?
I am wondering the samething...
I thought about asking chatGPT to create a function to detect the current URL path like I dont know
localhost:4000/en/dashboard?userId=xjhf123fd09dslkj2123123
and the function could get a string "es | de | en" and inside that function and replace the current url param but replace the "en" for "es" or "de" on the current path for the string coming from the function..
It could be a function that could be called from anywhere and be placed inside of "src/utils/"
or I'm full of bad practices haha I'm just a junior doing things for 1st time
great sir
Hello sir, I have one question. Can useTranslations() be used in both server and client component?
No
Hooks can't be used in server side components
Hello Bro. I would like to request a video about redux toolkit. Learning from ur tutorial helps me alot to understand react better.
Thanks very much ❤❤❤❤
When you visit the index page '/', it shows 404. How do you solve it?
you should do this code in nextconfig :
module.exports = {
async redirects() {
return [
{
source: '/',
destination: '/redirectRoute',
permanent: true,
},
]
},
}
Hey, is there a way to have one language(lets say english) not have any prefix by default? And others have like shown on video?
where should i create app directory and which files should i move in it??
app directory is automatically created for you when you create your next app with create-next-app, it will be in src folder if you choose src during creation. otherwise in root directory if you choose to discard src during the create-next-app terminal commands.
Bro, I'm crying, is there an option how to do all this for SSG without 100500 crutches?
thanks nice tutorial. Can you teach dynamic language structure using Next.js and database? I mean like a multilingual dynamic website
exactly. I wanted to ask the same! I have a marketplace project for multi-country and I assume it's going to be messy when i reach the implementation of internalization and localization feature
Thanks, great idea. I'll consider it for future tutorials
Anyone got a working example of combining next-intl and autjs 5 (beta) in the middleware?
Didnt next have built in i18n internationalisation?
yes, it does
Thanx . Please Answer on my question .... How can make url without en . like instead of localhos/en to be localhost ?
Amazing 🔥🔥
Thanks 🔥
How to write middleware when joining Next-Auth
YEEEEE same here!
Thank you!
bruh can you create localization without sub-path or any routing like: /en or smth
so can you provide how to create sitemap with next-intl
thank you
hello,how to fixed this problem ?
Can you provide us a one with Next14 with clerk , the middleware seems to have a conflict
amazing
is this available in JS not TS
soo cool
what microphone are you usin? Thanks
You are very cooooooooooooooooooool
How to use next-intl in client components?
hello,how to Removing the Default Locale ?
Can you show when we routing like about page
Can we set default language without adding /en in the url.
good video, how can I disable to not see the prefix in the url, it is causing me conflicts with another security dependency.
I've been trying to figure out how to achieve this, but haven't found any good solutions yet
Nice
Bang cara agar kalau pindah halaman makek next/link, tetep di bahasa yg di select ?
I Like you really
For not found page:
export const config = {
// Match only internationalized pathnames
// matcher: ['/', '/(ar|en)/:path*']
matcher: '/((?!api|static|.*\\..*|_next).*)'
};
BEWARE: next-intl does NOT support 'complex' data structures. It will not let you iterate over a list for example. Not even using its useFormatter() hook.
What’s the solution?
Can you make a video using Clerk and Next i18n?
I can do that on my channel
@@joscript7846 Please
Bang lu orang indo?
iya bang. jowo tulen bang
6:37
ada indonesia coyyy
dan orang indonesia ini emang ada dimana mana ya. 😁
This video like United Nations - useless!
So basic