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

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 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 года назад +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 6 месяцев назад

    Amazing, clear to the point

  • @IlkhomMaksadkulov
    @IlkhomMaksadkulov Год назад

    Thank you. The tutorial was really helpful

  • @antobine
    @antobine Год назад +1

    Great tutorial! Thanks🎉

  • @johnifemezuo2641
    @johnifemezuo2641 Год назад

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

  • @PrinceSodhi
    @PrinceSodhi 2 года назад +4

    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?

  • @loadszz
    @loadszz Год назад

    Thank you very much! You're awesome!

  • @siamparvez44
    @siamparvez44 2 года назад

    Thanks bro, I was looking for the same thing.

  • @alekz888
    @alekz888 2 года назад +2

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

    • @CulesCoding
      @CulesCoding  2 года назад

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

  • @saulandre274
    @saulandre274 11 месяцев назад

    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 ?

  • @СашоИванов-л3ц
    @СашоИванов-л3ц Год назад

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

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

  • @ing3189
    @ing3189 11 месяцев назад

    how can I translate dynamic content?

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

  • @ProtesterBD
    @ProtesterBD 2 года назад +2

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

    • @CulesCoding
      @CulesCoding  2 года назад +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

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

  • @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']))
    }
    }
    }
    ```

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

  • @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?

  • @joehsndev
    @joehsndev Год назад

    A tutorial for you vim configuration?

  • @oguzhanbay5339
    @oguzhanbay5339 2 года назад

    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  2 года назад

      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.

  • @SAADKHAN-qh3bp
    @SAADKHAN-qh3bp Год назад

    how to translate with dynamic data?

    • @CulesCoding
      @CulesCoding  Год назад

      You will need third party APIs for that

  • @maykelariastorres58
    @maykelariastorres58 2 года назад

    How to export in GitPage or Vercel

  • @sabbir-holybangla1866
    @sabbir-holybangla1866 9 месяцев назад

    Can I look up on your Linkedin profile?

  • @mhamadsafa7166
    @mhamadsafa7166 2 года назад

    Brilliant as always

  • @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`.

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

  • @souvlaki42
    @souvlaki42 2 года назад

    Good video but please fix the typo in the title.

  • @returnZeroo
    @returnZeroo Год назад

    Thanks bro

  • @GeneralDeD9963
    @GeneralDeD9963 Год назад

    Thanks a lot bro)

  • @cafefiftyfifty
    @cafefiftyfifty 2 года назад

    awesome