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

ความคิดเห็น • 96

  • @florentgironde7279
    @florentgironde7279 2 วันที่ผ่านมา +1

    you saved my life more than GPT 4o for sure ... Thanks you

  • @xDiagone
    @xDiagone 4 หลายเดือนก่อน +6

    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!

  • @SUlutas
    @SUlutas 4 หลายเดือนก่อน +3

    I was looking for a server-side internationalization package for a next.js project. And I found it! Thank you very much!!!

  • @IvoTsochev
    @IvoTsochev 5 หลายเดือนก่อน +2

    Great video! Probably the best explanation about Internationalization in Nextjs so far

  • @ExtraMad0
    @ExtraMad0 5 หลายเดือนก่อน +2

    men this is the best explanation that I have been seen

  • @osw2050
    @osw2050 3 หลายเดือนก่อน +1

    the best and only tutorial on youtube

  • @mamlzy
    @mamlzy 7 หลายเดือนก่อน +2

    bangga ada orang indo, bikin tutorial pake bahasa inggris di web dev

    • @CandDev
      @CandDev  7 หลายเดือนก่อน +1

      Terimakasih, yuk kita belajar bareng disini 😁

  • @rayusaki88
    @rayusaki88 3 หลายเดือนก่อน +1

    Thanks a lot! Straight forward tut! Learned something nice 👌🏼

  • @mamzouj
    @mamzouj 7 ชั่วโมงที่ผ่านมา

    thank you sharing code
    good work bro

  • @iPankBMW
    @iPankBMW 5 หลายเดือนก่อน +3

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

  • @hosseinjafari2896
    @hosseinjafari2896 4 หลายเดือนก่อน +1

    It was very helpful for me.thanks a lot.

  • @marcoB0815
    @marcoB0815 4 หลายเดือนก่อน +1

    Great video! Helped me a lot. Thanks!

  • @sayedalisinasadat2908
    @sayedalisinasadat2908 2 วันที่ผ่านมา

    great , for nested layout : for ex : the third layout i have include header and navbar but not working

  • @ThisIsLiving__
    @ThisIsLiving__ 3 หลายเดือนก่อน

    saved me twice on two different projects 😃

  • @catweb666
    @catweb666 5 หลายเดือนก่อน +1

    Thanks, I was searching for long for this kind of video

  • @user-kb6ck7gb6f
    @user-kb6ck7gb6f 4 หลายเดือนก่อน +1

    Moving the layout.tsx to the locale directory, made everything else doesn't work properly in my project

  • @survivordaqwv9002
    @survivordaqwv9002 หลายเดือนก่อน

    Thank you for this video!
    Can you make a video on RTL languages too?
    Would be really appreciated.

  • @alangiovanni5204
    @alangiovanni5204 19 วันที่ผ่านมา

    Great video! thank you vert much!

  • @twanabrno875
    @twanabrno875 4 หลายเดือนก่อน +1

    Thanks, But we can not build production it gives error with static and i can not fixt it

  • @mohdsahil226
    @mohdsahil226 6 หลายเดือนก่อน +2

    Nice tutorial! Could you please add routing. like adding about and contact page. That is giving error

  • @pamphilemkp
    @pamphilemkp 6 หลายเดือนก่อน +1

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

  • @pierosabino
    @pierosabino 4 หลายเดือนก่อน +1

    Good morning, I followed the video and I would like to add pages to my project, how can I do it?

  • @razvlekashka
    @razvlekashka 2 หลายเดือนก่อน +1

    Does redirection of homepage affects SEO?

  • @maskman4821
    @maskman4821 6 หลายเดือนก่อน +3

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

    • @Falconforex
      @Falconforex 6 หลายเดือนก่อน +1

      Try to put the src files in the video in your app folder
      And organize the files import in i18n and middleware files

    • @maskman4821
      @maskman4821 6 หลายเดือนก่อน

      ​@@Falconforex OK,I will give it a try,thank you for the reply ❤

    • @pamphilemkp
      @pamphilemkp 6 หลายเดือนก่อน

      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

    • @ashishsubedi1400
      @ashishsubedi1400 5 หลายเดือนก่อน +1

      bro did you found solution?

    • @maskman4821
      @maskman4821 5 หลายเดือนก่อน

      @@ashishsubedi1400 nope

  • @user-yy9vr7pc1i
    @user-yy9vr7pc1i 6 หลายเดือนก่อน +2

    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.

  • @divyarajsinhrana6045
    @divyarajsinhrana6045 5 หลายเดือนก่อน +1

    How to manage multiple middleware with different matcher config ?@Cand DEV

  • @tomasburian6550
    @tomasburian6550 หลายเดือนก่อน

    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.

  • @husseinoklah8839
    @husseinoklah8839 4 หลายเดือนก่อน

    Thank you very much for the explanation but we are still waiting second part for server side translation

  • @user-gh3uo3om9g
    @user-gh3uo3om9g 5 หลายเดือนก่อน +3

    what if i don't have src folder.

    • @jaspreetmaan121
      @jaspreetmaan121 5 หลายเดือนก่อน +1

      then use root folder

  • @helloWorldPlus
    @helloWorldPlus 5 หลายเดือนก่อน +1

    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?

  • @YTthings666
    @YTthings666 4 หลายเดือนก่อน

    Nice tutorial thanks! i have a question.... How do i build a header responsive (burger menu , etc) with a "use client " ? or another solution?

  • @germancardosodesousa5183
    @germancardosodesousa5183 3 หลายเดือนก่อน

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

  • @naolfekadu6101
    @naolfekadu6101 3 หลายเดือนก่อน +1

    Whatif I have deeply nested routes? How would the router replace work?

    • @user-lh8lf9cm1x
      @user-lh8lf9cm1x 3 หลายเดือนก่อน

      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

  • @limitlesstothemoon
    @limitlesstothemoon 2 หลายเดือนก่อน

    great sir

  • @sengwatrongrat1630
    @sengwatrongrat1630 5 หลายเดือนก่อน +1

    Hello sir, I have one question. Can useTranslations() be used in both server and client component?

    • @moussaibrahem9
      @moussaibrahem9 3 หลายเดือนก่อน

      No
      Hooks can't be used in server side components

  • @capK29
    @capK29 5 หลายเดือนก่อน

    Hello Bro. I would like to request a video about redux toolkit. Learning from ur tutorial helps me alot to understand react better.

  • @user-yn9yr8hq8v
    @user-yn9yr8hq8v 4 หลายเดือนก่อน

    Thanks very much ❤❤❤❤

  • @jy1772
    @jy1772 6 หลายเดือนก่อน +1

    When you visit the index page '/', it shows 404. How do you solve it?

    • @ariyansalari270
      @ariyansalari270 5 หลายเดือนก่อน +1

      you should do this code in nextconfig :
      module.exports = {
      async redirects() {
      return [
      {
      source: '/',
      destination: '/redirectRoute',
      permanent: true,
      },
      ]
      },
      }

  • @rokkazmvm
    @rokkazmvm 3 หลายเดือนก่อน

    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?

  • @sandrotabatadze3768
    @sandrotabatadze3768 5 หลายเดือนก่อน +1

    where should i create app directory and which files should i move in it??

    • @me.akaaba
      @me.akaaba 4 หลายเดือนก่อน

      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.

  • @user-bi8pe4lc1x
    @user-bi8pe4lc1x 2 วันที่ผ่านมา

    Bro, I'm crying, is there an option how to do all this for SSG without 100500 crutches?

  • @feksoftware
    @feksoftware 7 หลายเดือนก่อน +1

    thanks nice tutorial. Can you teach dynamic language structure using Next.js and database? I mean like a multilingual dynamic website

    • @dreamsachiever212
      @dreamsachiever212 7 หลายเดือนก่อน

      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

    • @CandDev
      @CandDev  7 หลายเดือนก่อน +2

      Thanks, great idea. I'll consider it for future tutorials

  • @niconel7659
    @niconel7659 4 หลายเดือนก่อน

    Anyone got a working example of combining next-intl and autjs 5 (beta) in the middleware?

  • @lucaseitel98
    @lucaseitel98 5 หลายเดือนก่อน +1

    Didnt next have built in i18n internationalisation?

    • @3litepker
      @3litepker 4 หลายเดือนก่อน

      yes, it does

  • @omarrayes2281
    @omarrayes2281 4 หลายเดือนก่อน

    Thanx . Please Answer on my question .... How can make url without en . like instead of localhos/en to be localhost ?

  • @eliuddyn
    @eliuddyn 3 หลายเดือนก่อน

    Amazing 🔥🔥

    • @CandDev
      @CandDev  2 หลายเดือนก่อน

      Thanks 🔥

  • @Mark-lg2qe
    @Mark-lg2qe 6 หลายเดือนก่อน +1

    How to write middleware when joining Next-Auth

    • @codingspot
      @codingspot 6 หลายเดือนก่อน

      YEEEEE same here!

  • @user-rv1bx8hx4v
    @user-rv1bx8hx4v 3 หลายเดือนก่อน

    Thank you!

  • @JavohirXasanov-kt6oi
    @JavohirXasanov-kt6oi 6 หลายเดือนก่อน +1

    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

    • @murazaslan3631
      @murazaslan3631 3 หลายเดือนก่อน +1

      hello,how to fixed this problem ?

  • @zqgAFf
    @zqgAFf 3 หลายเดือนก่อน

    Can you provide us a one with Next14 with clerk , the middleware seems to have a conflict

  • @Jeridi
    @Jeridi 3 หลายเดือนก่อน

    amazing

  • @mouad3599
    @mouad3599 5 หลายเดือนก่อน +1

    is this available in JS not TS

  • @aldotugasumb2366
    @aldotugasumb2366 2 หลายเดือนก่อน

    soo cool

  • @Tommy-jn9ps
    @Tommy-jn9ps 6 หลายเดือนก่อน

    what microphone are you usin? Thanks

  • @ahmedadawy8149
    @ahmedadawy8149 4 หลายเดือนก่อน

    You are very cooooooooooooooooooool

  • @petpetai
    @petpetai หลายเดือนก่อน

    How to use next-intl in client components?

  • @murazaslan3631
    @murazaslan3631 3 หลายเดือนก่อน

    hello,how to Removing the Default Locale ?

  • @amcheachamroeun2716
    @amcheachamroeun2716 4 หลายเดือนก่อน

    Can you show when we routing like about page

  • @pontingIndia
    @pontingIndia 5 หลายเดือนก่อน

    Can we set default language without adding /en in the url.

  • @juanebertaypeescobar3482
    @juanebertaypeescobar3482 7 หลายเดือนก่อน

    good video, how can I disable to not see the prefix in the url, it is causing me conflicts with another security dependency.

    • @gustavenzi
      @gustavenzi 6 หลายเดือนก่อน

      I've been trying to figure out how to achieve this, but haven't found any good solutions yet

  • @user-mq2qb6ry1f
    @user-mq2qb6ry1f 4 หลายเดือนก่อน

    Nice

  • @Happycat-xd8rw
    @Happycat-xd8rw 4 หลายเดือนก่อน

    Bang cara agar kalau pindah halaman makek next/link, tetep di bahasa yg di select ?

  • @ahmedadawy8149
    @ahmedadawy8149 4 หลายเดือนก่อน

    I Like you really

  • @AhmedKhaled-mw9rs
    @AhmedKhaled-mw9rs 6 หลายเดือนก่อน

    For not found page:
    export const config = {
    // Match only internationalized pathnames
    // matcher: ['/', '/(ar|en)/:path*']
    matcher: '/((?!api|static|.*\\..*|_next).*)'
    };

  • @bernardukiii
    @bernardukiii 4 หลายเดือนก่อน +1

    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.

    • @3litepker
      @3litepker 4 หลายเดือนก่อน

      What’s the solution?

  • @caioalves8319
    @caioalves8319 7 หลายเดือนก่อน

    Can you make a video using Clerk and Next i18n?

    • @joscript7846
      @joscript7846 7 หลายเดือนก่อน

      I can do that on my channel

    • @caioalves8319
      @caioalves8319 7 หลายเดือนก่อน

      @@joscript7846 Please

  • @Aufafkri
    @Aufafkri 4 หลายเดือนก่อน +1

    Bang lu orang indo?

    • @CandDev
      @CandDev  3 หลายเดือนก่อน

      iya bang. jowo tulen bang

  • @tuananhdo1870
    @tuananhdo1870 5 หลายเดือนก่อน

    6:37

  • @user-xz8dh1jc5d
    @user-xz8dh1jc5d 7 หลายเดือนก่อน

    ada indonesia coyyy

    • @CandDev
      @CandDev  7 หลายเดือนก่อน

      dan orang indonesia ini emang ada dimana mana ya. 😁

  • @berhaneselassie7811
    @berhaneselassie7811 4 หลายเดือนก่อน +1

    This video like United Nations - useless!

  • @nguyenvohoanglong3898
    @nguyenvohoanglong3898 4 หลายเดือนก่อน

    So basic