How to change App Language in react native | Multiple Language Support | i18next | React-Native

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

Комментарии • 40

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

    How to do RTL?

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

      Yes, you can achieve it using I18nManager.
      import {I18nManager} from 'react-native'
      ...
      I18nManager.forceRTL(true) // forceRLT: boolean

  • @govindchoudhary7311
    @govindchoudhary7311 2 месяца назад +1

    you saved my hours thanks a lot buddy

  • @fata__morgana
    @fata__morgana 4 месяца назад +1

    This was so easy, thanks a bunch !

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

    daammnnn this is what i need. thank you.

  • @riahiyassine7703
    @riahiyassine7703 11 месяцев назад +1

    Helpful content... great thanks

  • @shebeerretyn
    @shebeerretyn Месяц назад +1

    thanks

  • @NashrinFathima-oh7ji
    @NashrinFathima-oh7ji 7 месяцев назад +1

    Very Helpful

  • @GaneshguruA
    @GaneshguruA 9 месяцев назад +1

    Is there any way to change whole app languate in single click. instead of writting a alternate word for each word. I dont know, but just a thought. like by using google translate or any other api ?

    • @vishalpwr
      @vishalpwr  9 месяцев назад +1

      One way is you can send this file with your selected language to your server and the server will give you the response of the translated file.
      For dynamic data it works well.
      And another way you can use any third party API to translate your text.

  • @gauthamvijayan
    @gauthamvijayan 6 месяцев назад +1

    Perfect!

  • @MaheshRajan-ly7vm
    @MaheshRajan-ly7vm Год назад +1

    When I close the app and reopen it, will it show the default language (en), right? How can we display the last selected language when reopening the application using AsyncStorage?

    • @sameersingh-gb1gy
      @sameersingh-gb1gy Год назад

      i am also trying the same from last 3 days please reply here if you get any solution

    • @MaheshRajan-ly7vm
      @MaheshRajan-ly7vm Год назад +2

      Yeah, I got it,
      Screen One
      const changeLangFunc = async (lng) => {
      await AsyncStorage.setItem('selectedLanguage', lng); // Store the selected language
      i18next.changeLanguage(lng)
      setLangModal(false)
      }
      set the selected lang in an asyncStorage
      screen two,
      In the screen where we call the functions to execute the changes added the below code,
      const setInitialLanguage = async () => {
      try {
      const selectedLanguage = await AsyncStorage.getItem('selectedLanguage');
      if (selectedLanguage) {
      i18next.changeLanguage(selectedLanguage);
      }
      } catch (error) {
      console.error('Error retrieving selected language:', error);
      }
      };
      setInitialLanguage(); // Set the initial language on application startup
      @@sameersingh-gb1gy

    • @ntothektothel
      @ntothektothel 7 месяцев назад

      @@MaheshRajan-ly7vm ty man

  • @ibrahimcelen1896
    @ibrahimcelen1896 9 месяцев назад +1

    Danke Schön bruddah!

  • @gauthamvijayan
    @gauthamvijayan 6 месяцев назад

    Also try to mix react-native-localise with this video as part 2

  • @mariapaoladigrigoli9506
    @mariapaoladigrigoli9506 9 месяцев назад +1

    Thank u!!

    • @vishalpwr
      @vishalpwr  9 месяцев назад +1

      Welcome 😊

  • @marcelraszewski
    @marcelraszewski 9 месяцев назад

    What extension do you have that sugest you evreything when you are writting code ??

    • @vishalpwr
      @vishalpwr  9 месяцев назад +1

      I have installed many extensions but you can try these...
      Auto import
      "React Native Tools"
      Auto complete Tag

  • @arktutorials9866
    @arktutorials9866 8 месяцев назад

    is their any automation available?

  • @BukkyOdunsi
    @BukkyOdunsi 10 месяцев назад

    Does it mean you'd have to input the translations manually?

    • @vishalpwr
      @vishalpwr  10 месяцев назад +1

      Yes, for static texts!
      For dynamic or api based data/text it requires translation from api or need to add some extra efforts.

  • @stilljunior1764
    @stilljunior1764 9 месяцев назад

    ERROR TypeError: Cannot read property 'language' of undefined, js engine: hermes
    when I am trying to change language

    • @vishalpwr
      @vishalpwr  9 месяцев назад +1

      Please check, have you installed/configured library correctly?
      And to change language you can use
      import { useTranslation } from 'react-i18next'
      const { t, i18n } = useTranslation();
      i18n.changeLanguage('fr')

  • @vrto3287
    @vrto3287 8 месяцев назад

    How can I show last selected language when reopening the app ?

    • @vishalpwr
      @vishalpwr  8 месяцев назад +1

      For that you need to persist your selected language in any local storage like AsyncStorge or you can find any other solution to persist user prefs.

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

    How to do RTL ?
    Layout is not shifting without refreshing app

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

      Have you tried with, Pinned comment's answer?

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

      @@vishalpwr, yes ! Language changes but layout is not shifted.
      Can you show it in another tutorial please.

  • @yucelduz4897
    @yucelduz4897 10 месяцев назад

    does it work with expo

    • @vishalpwr
      @vishalpwr  10 месяцев назад +1

      Yes, i18next and react-i18next absolutely works with Expo.

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

    The music is freaking stressing me out , had to stop in the middle of tutorial :(

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

      Ohhh :(, Sorry next time I will try better.

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

    Bro again forgot yt password