Translate website content using Next.js internationalization and next-i18next

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024
  • In this video, you will learn how to use nextjs internationalization and translate your website content using next-i18next package.
    Contacts
    Email: thatanjan@gmail.com
    Linkedin: / thatanjan
    portfolio: thatanjan.me/
    Github: github.com/tha...
    Instagram personal: / thatanjan
    Twitter: / thatanjan
    Blogs you might want to read:
    Eslint, prettier setup with TypeScript and react: www.culescodin...
    What is Client-Side Rendering?: www.culescodin...
    What is Server Side Rendering?: www.culescodin...
    Everything you need to know about tree data structure: www.culescodin...
    13 reasons why you should use Nextjs: www.culescodin...
    Videos you might want to watch:
    Setup Eslint Prettier with Typescript and React -Nextjs, Create React App: • Setup Eslint Prettier ...
    Everything you need to know about CSS in JS: • Everything you need to...
    Toggle Dark mode with Material-UI: • Material-UI Basics Cou...
    Build a real-time view counter: • Build a blog using #JA...
    Build a small search engine with MongoDB: • Build a blog using #JA...
    Playlists you might like:
    Build a blog using JAMstack: • Build a blog using JAM...
    Material-UI basics course: • Video
    Quick tricks: • Access COOKIES in Next...
    Crash course: • Redux toolkit crash co...
    How-to videos: • Setup Eslint Prettier ...
    Stay safe and good bye.

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

  • @jaroslavgrejtak2484
    @jaroslavgrejtak2484 ปีที่แล้ว +4

    I saw a lot of tutorials during the last days but I have to say that this is the best, straight-forward and functional tutorial. Thank you very much!

  • @stepakitov4556
    @stepakitov4556 ปีที่แล้ว +2

    Best explanation I've ever seen. Thank you very much

  • @monirhrabby
    @monirhrabby ปีที่แล้ว +1

    Thanks for sharing knowledge with us. Keep it up. I got this video helpfull.🚀

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

    Amazing, clear to the point

  • @antobine
    @antobine ปีที่แล้ว +1

    Great tutorial! Thanks🎉

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

    Thanks man. very helpful. Although i would like to know how to change the entire content of a page to a selected language.

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

    Thank you. The tutorial was really helpful

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

      Glad it was helpful!

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

    Thank you very much! You're awesome!

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

    Hey bro. This video is helping me so much. But this is not working on dynamic route pages. Do you have a working example for dynamic route pages with translation ?

  • @alekz888
    @alekz888 ปีที่แล้ว +2

    Unfortunately, this way not working for new Nextjs13 if using the /app directory routing

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      Thanks for mentioning it. The /app directory routing is still on beta. But the principles should be same.

  • @PrinceSodhi
    @PrinceSodhi ปีที่แล้ว +3

    I have a question, what happens when you are on the /bn/about page and refresh it. Does locale fallback to en or bn? also, does it work when you disable the javascript on the browser? I am trying to achieve to render the translation with SSR (nextjs) and keep the locale on page refresh. Do you have any video or repo?
    Thank you in advance.

    • @avinskatirza7009
      @avinskatirza7009 ปีที่แล้ว +1

      if we refresh the page the locale stays on the previous state before it was refreshed. as for your second question maybe you can refer to the next-i18n docs on the 'next export section'. hope this helps

    • @nikitavakula5778
      @nikitavakula5778 ปีที่แล้ว

      @@avinskatirza7009 when we just refresh the page, the locale is saved. but what if we close the page and then open it again? the site usually opens with the locale that next-i18next has defined by default. how can we fix the locale for the site?

  • @mhamadsafa7166
    @mhamadsafa7166 ปีที่แล้ว

    Brilliant as always

  • @siamparvez44
    @siamparvez44 ปีที่แล้ว

    Thanks bro, I was looking for the same thing.

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      I am glad that it helped

  • @sanvirahmed
    @sanvirahmed ปีที่แล้ว +1

    Hey, thank you for this awesome video. But I got stuck on this error that says 'Module not found: Can't resolve 'fs''
    I did everything as you did

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว +1

      Probably you are trying to use server side module on client. I would recommend checking the issues on GitHub

  • @kevin_3301
    @kevin_3301 ปีที่แล้ว +1

    Thanks for tutorial. But I got a question. I got a 'fs' error?
    And I have to install 'react-i18next' plus i18next libs too. But in your video, only next-i18next

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      Not sure why you are facing this issue?
      Maybe you should try look into stackoverflow or github issues.

    • @leonardo-leite-meira
      @leonardo-leite-meira ปีที่แล้ว

      me too 😒

    • @leonardo-leite-meira
      @leonardo-leite-meira ปีที่แล้ว

      you can use the useTranslation hook on any layout components as long as you call the serverSideTranslation function on getStaticProps/getServerSide (depends on your case) on every page.
      By: @Avinska Tirza

  • @СашоИванов-л3ц
    @СашоИванов-л3ц ปีที่แล้ว

    next-i18next doesn't support export command so what is the point of all of that?

  • @ajanclose
    @ajanclose ปีที่แล้ว

    is there any way to ge rid of calling files that are used in the whole website, in the code below i will use 'common' and 'ui' file everywhere, is there any way to make them always available and only have to call 'home' or 'about' page in their file
    ```
    export const getStaticProps: GetStaticProps = async ({ locale }) => {
    return {
    props: {
    ...(await serverSideTranslations(locale as string, ['ui', 'common', 'dashboard']))
    }
    }
    }
    ```

  • @GeneralDeD9963
    @GeneralDeD9963 ปีที่แล้ว

    Thanks a lot bro)

  • @ProtesterBD
    @ProtesterBD ปีที่แล้ว +2

    Awesome tutorial bro. But I have a question. How can I use nested JSON objects?

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว +4

      Why would you need to use nested json objects for translation data?

    • @timndichu
      @timndichu ปีที่แล้ว

      @@CulesCoding maybe to categorize for different pages and components

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      @@timndichu use seperate namespace

  • @nikhilev3840
    @nikhilev3840 ปีที่แล้ว

    I have a NextJS app. When I navigate away from a page and return to the same again I see the xxx.json file is requested and loading again in network tab. Is that natural?

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

    how can I translate dynamic content?

  • @joehsndev
    @joehsndev ปีที่แล้ว

    A tutorial for you vim configuration?

  • @returnZeroo
    @returnZeroo ปีที่แล้ว

    Thanks bro

  • @oguzhanbay5339
    @oguzhanbay5339 ปีที่แล้ว

    How can i use with only Component for example layout or navbar ? I can't serverSide rendering ? When I Try to const { t } = useTranslation('common') didn't work. Onyl works serverside why ?

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      Sorry for the late reply. I don't understand the problem you are facing. Are you facing problem with `getServerSideProps ` or something else?

    • @mehedi_mosharrof
      @mehedi_mosharrof ปีที่แล้ว +1

      I have the same question. How to use it in the non page components?

    • @avinskatirza7009
      @avinskatirza7009 ปีที่แล้ว

      @@mehedi_mosharrof you can use the useTranslation hook on any layout components as long as you call the serverSideTranslation function on getStaticProps/getServerSide (depends on your case) on every page.

  • @edwinchan8190
    @edwinchan8190 ปีที่แล้ว

    Thanks for the video, is the translation content lazy-loaded? If locale is en, I only want en content to be loaded, thanks

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      I am not sure about this

  • @zilant07
    @zilant07 ปีที่แล้ว

    Hi i have this error i18n support is not compatible with next export and don`t find a solution

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      Sorry, I haven't used it with `next export`.

  • @cafefiftyfifty
    @cafefiftyfifty ปีที่แล้ว

    awesome

  • @maykelariastorres58
    @maykelariastorres58 ปีที่แล้ว

    How to export in GitPage or Vercel

  • @SAADKHAN-qh3bp
    @SAADKHAN-qh3bp ปีที่แล้ว

    how to translate with dynamic data?

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      You will need third party APIs for that

  • @sabbir-holybangla1866
    @sabbir-holybangla1866 5 หลายเดือนก่อน

    Can I look up on your Linkedin profile?

  • @brahmharsh24
    @brahmharsh24 ปีที่แล้ว

    Thanks, Which linux flavour you're using?

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      I was using manjaro in that video. However I have now switched to ArcoLinux

  • @souvlaki42
    @souvlaki42 ปีที่แล้ว

    Good video but please fix the typo in the title.

  • @anuragsingh506
    @anuragsingh506 ปีที่แล้ว

    good video but how i translate the data coming from database
    or API

    • @CulesCoding
      @CulesCoding  ปีที่แล้ว

      In that case you will need to use third party services like google translate