How to make our app to support multiple languages | Android Studio | Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.พ. 2018
  • This tutorial is about how to develop an app with multiple language support.
    We will create separate strings.xml files for each language.
    We will use AlertDialog to display languages to choose one of them and change. The settings will be saved using shared preferences, so whenever you will start the app it will load with the language you selected last time.
    Buy Me a Coffee: paypal.me/atifsayings
    Chanel:
    / mohammadatif1
    Websites:
    technifysoft.com/
    devofandroid.blogspot.com
    Apps/Games on PlayStore:
    play.google.com/store/apps/de...
    If u like this video, Like, Comment, Subscribe to support us...

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

  • @bartomiejdziao9594
    @bartomiejdziao9594 5 ปีที่แล้ว +13

    Clean and neat. I saw few other tutorial and this is by far the simplest and most effective. This is what I will be using. Thank you!

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      You're welcome 😊

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

      @bartlomiej can you provide source code to me

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

      @@AtifSayings hi i am a student in UI UX design, i am curious how apps support multiple languages, is it the engineers job to add languages to the app?, how do i as a designer assist this process to make my app designs more accessible to people?

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

    Thank you for this perfect walk-through - saved me so much time!

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

    Many thanks. April 2020 and stills working. I could manage to make it work on my app. Thanks!

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

    One Word!! ........................................ Awesome. Really Useful. Thank You Bro

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

    Your Tutorial is always well sir, please give us some project tutorial.

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

    Good job dude!!! Thanks a lot :)

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

    Thank you, it was very helpful video.

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

    It is the best tutorial !! Thanks a lot !

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

    its very help ful bro thanks a lot

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

    Thank you.
    This video is very helpful.

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

    This is so helpful!! Thanks a lot!! Finally understand!

  • @olivierfaux9599
    @olivierfaux9599 5 ปีที่แล้ว

    Clear, efficient, thanks a lot

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

    That was awesome. Thanks broo. It works for me

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

    Thank you sooo much, that was really helpful

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

    thsnk you sooooooo much even after 6 years it works

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

      You're welcome

  • @qubee-tech
    @qubee-tech 2 ปีที่แล้ว +1

    Nice work!

  • @geniousitywave1871
    @geniousitywave1871 6 ปีที่แล้ว +5

    At last! I got the simplest tutorial.

  • @richmangroup
    @richmangroup 4 ปีที่แล้ว

    Thank you so much. Verry helped!

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

    Thank you for the tutorial...Run Successfully💖

  • @treasureislandofworld
    @treasureislandofworld 4 ปีที่แล้ว

    Really appreciate you man !

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

    Легендарно!!!
    Попробуй в интернетах ещё найти что-то подобное!..
    То ли я слишком глуп, а все уже знают, или просто никто таким уже не пользуется?...

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

    Thank you. It's very help me.

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

    This is working on my emulator but when I uploaded it to google play, choosing the language is not changing the language. How can I solve this issue?

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

    Really Helpful!

  • @mtoheed1085
    @mtoheed1085 5 ปีที่แล้ว

    Very useful tutorial

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

    thank you very mush brother

  • @linko-tan
    @linko-tan 2 ปีที่แล้ว +1

    Thanks,
    This video made me do a subscribe .

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

    finally something useful thanks

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

    Great brother 😊

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

    tnx for make this tutorial

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

      You're welcome

  • @HabiasaDeveloper
    @HabiasaDeveloper 5 ปีที่แล้ว

    Thank you so much :)))

  • @jonathanpincay656
    @jonathanpincay656 5 ปีที่แล้ว +6

    Hi, thanks very much for the tutorial, It's very nice, I have a question, when I run the emulator I'm able to change the language, but when I run it in the phone it's is not changing the language.

    • @invanemay6814
      @invanemay6814 2 ปีที่แล้ว

      it has been 2 years but i need to ask. did you solve the issue and how :(

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

    Thank you brother :D

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

    Thank you very much!!! You help my life! haha

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว

      You're welcome

    • @VikasRaao
      @VikasRaao 4 ปีที่แล้ว

      @carlos pls sharre source code to me

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

    wow thanks and nice

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

    Thx man!!

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

    Nice

  • @HarisBukhari-bm7eh
    @HarisBukhari-bm7eh 2 ปีที่แล้ว +1

    Thanks a Lot man !!!!!!!

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

    good work

    • @fekedewhailemariam5979
      @fekedewhailemariam5979 4 ปีที่แล้ว

      How to make navigation have an option to select language with out opening any fragment or activity, Please
      with best regards

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

    thanks a lot

  • @Alihaider-rs8is
    @Alihaider-rs8is 3 ปีที่แล้ว +2

    Jazak Allah

  • @path_ethics
    @path_ethics 5 ปีที่แล้ว

    Some deprecated code but works for now. Thanks

  • @Vijaykumar-ww6vu
    @Vijaykumar-ww6vu 5 ปีที่แล้ว +1

    Thank u so much bro

  • @pramodamarasinghe5175
    @pramodamarasinghe5175 5 ปีที่แล้ว

    Thank you it's working

  • @zafarturgunboev7261
    @zafarturgunboev7261 5 ปีที่แล้ว

    thanks bro!

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

    Hello Atif,
    Perfect Video, I did the same that you did in the video and it works fine when I run my app directly from android studio, but my problem is that when i upload my app in google play store and download back from play store the localization is not working. Can you advice me what should i do?

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

      May be u haf made some mistake.
      Because im using same some of my apps on playstore

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

      @@AtifSayings i copied the exact same code.but the language is not changing.can you help?

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

      ​@@farahnazreza984 I have the same problem, i tried for APK and it´s work fine but when i publish (PlayStore) nothing do it.

    • @nishasudani86
      @nishasudani86 2 ปีที่แล้ว

      @@AtifSayings same problem

    • @hazelkaya9668
      @hazelkaya9668 2 ปีที่แล้ว

      @@AtifSayings is it working offline?

  • @ronirusmayadi9253
    @ronirusmayadi9253 5 ปีที่แล้ว

    Thx brother

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

    Thank you!

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

    Hi Atif,
    I have been following your tutorials lately and they are great for learning studio. While following this tutorial I came across an issue which is:
    I have copied the exact code but when I choose language, the strings aren't changed. While writing UpdateConfiguration() I saw that this is deprecated and while going through answers on Google I was unable to understand what to do.
    Now I want to Localize my app but I am unable to do so. Can you please help?

    • @AtifSayings
      @AtifSayings  6 ปีที่แล้ว

      Thaks you....
      If the method is depreciated it still should work. ok, send your screenshot on email, ill check it out

    • @UzairAmirs
      @UzairAmirs 6 ปีที่แล้ว

      Hi, thanks for your kind response. I have sent you the email with Screenshots and Logcat errors.
      Please help and thanks for responding again. Very kind of you.

  • @Error-ss4vm
    @Error-ss4vm 4 ปีที่แล้ว +1

    Thanks !

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว

      You're welcome :)

    • @tarikaws173
      @tarikaws173 3 ปีที่แล้ว

      @@AtifSayings bro i need source code please

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

    I only changed
    SharedPreferences prefs=getSharedPreferences("setting", Activity.MODE_PRIVATE);
    to
    SharedPreferences prefs=getSharedPreferences("save to all activity", Activity.MODE_PRIVATE);
    and its working for me

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

    good tutorial but it shows the language but when you click on a language it doesn't change the texts to the language you have selected

  • @asaserge9089
    @asaserge9089 3 ปีที่แล้ว

    Really good, next time add some music, I taught I had problems with my sound system, lol

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

    Damn, you made it seem so easy! hahah
    Thx bro

  • @shay-cohen
    @shay-cohen 6 ปีที่แล้ว +1

    Thanks for the video but i noticed as soon i am inside my RTL Layout and I change my orientation from portrait to landscape the layout changes back from RTL to LTR, any way to prevent this?

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

    sir video is very informative and useful. can you please share the link of code of the same programme?

    • @AtifSayings
      @AtifSayings  3 ปีที่แล้ว

      Thanks You. I don't have code 😕

  • @SunnyKumar-tu5hp
    @SunnyKumar-tu5hp 6 ปีที่แล้ว +1

    thanks a lot.

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

    great Atif ,application is working but drawer layout item not change the language

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

      Make sure you've put its strings to their respective localized strings.xml files

  • @ART_OF_SK
    @ART_OF_SK 2 ปีที่แล้ว

    Instead of using shared preference use Room database
    If you can please make a tutorial video
    If you have done already send the link plz

  • @dyari009
    @dyari009 3 ปีที่แล้ว

    Jazaka Allah , how can use for all activities ?

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

    i want implement this code into fragment not at mainactivity how?

  • @oanxuanson7654
    @oanxuanson7654 3 ปีที่แล้ว

    how can I apply changing language in multi interface, because it still change language in main activity

  • @helenh2442
    @helenh2442 4 ปีที่แล้ว

    am i the only one that this is not working for me? I put setlocale() before setContentView() it can be translated , but loadLocale() doesn't work

  • @sonechak
    @sonechak 4 ปีที่แล้ว

    Hi have a book app in English but I would like to add another language using Sqlite.

  • @umerhayyat7818
    @umerhayyat7818 5 ปีที่แล้ว

    atif bhai keyboard bhi change ho ga ?

  • @revengine4830
    @revengine4830 3 ปีที่แล้ว

    How to manage the radio button selection in this case?

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

    i have a problem the list of language appear to me in horizanl view , not verical and i can't chose one of them

  • @sivakumarb8286
    @sivakumarb8286 4 ปีที่แล้ว

    hello bro .. its a Awesome video.. but i have one doubt .. how can i change the language for all other activities ..

    • @zooozadel3126
      @zooozadel3126 3 ปีที่แล้ว

      Do you know how can i change all other activities

  • @devanshidoshi9690
    @devanshidoshi9690 5 ปีที่แล้ว

    Nice Video.But after i choose the option of language there is no translation.Please help

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

    Okay great😊.... but what if i wanted to ask the user which language they want when they first launch the app?!

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

      You can do it using Shared Preferences.
      In launch get a boolean value from shared Preferences e.g. isOldUse if value is false which is always false when launching first time then set required language after that save its value true
      Then next time you lanuch its valie will be true

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

    SharePreferences not working at my side, after reopening the app it shows default value english. Please help me

  • @shanilshani910
    @shanilshani910 4 ปีที่แล้ว

    I have written the same code in my program but is not working (nothing is happening). Can any one help me to correct it. Please...

  • @ayushigupta3673
    @ayushigupta3673 5 ปีที่แล้ว

    tutorial is good but i am getting a small error can you please help me for me the action bar which i am adding does not support..
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setTitle(java.lang.CharSequence)' on a null object reference

    • @ailing21
      @ailing21 3 ปีที่แล้ว

      did you manage to solve it?

  • @thrwatzidan8086
    @thrwatzidan8086 4 ปีที่แล้ว

    thanx for the simple code but how to fix release apk it dosnt make any change and keep only one language
    @Atif Pervaiz

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

    so if I change the language in one activity, will it be followed by all activities?

    • @razushikh4553
      @razushikh4553 3 ปีที่แล้ว

      Is it possible?I need it!!!"

    • @ailing21
      @ailing21 3 ปีที่แล้ว

      @@razushikh4553 did you manage to solve it?

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

    Hi thanks for this video. But this is not working in Android 8 mobiles how can I fix it can you help me.

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

    Can you please tell why I am able to select language only once. After it if I select language it doesn't reflect on the other activities of the app! Hoping for quick answer!

    • @AtifSayings
      @AtifSayings  3 ปีที่แล้ว

      write all strings in strings.xml of each language
      call loadLocale(); function before setContentView(R.layout.activity_name); of each activity

    • @cr3st
      @cr3st 3 ปีที่แล้ว

      @@AtifSayings what about Fragments?

  • @alimahmood4158
    @alimahmood4158 6 ปีที่แล้ว

    bro all the videos on you tube are those in which they are changing the language of the single activity.please tell us how we can change the language of more than one activity

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

      do same for all activities if you want to change language programatically. write strings of each activity in strings.xml

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

    It is not working for API level 23 and below (Android version 6.0 and lower). Do you have any idea?

    • @ArifRahman-ce7bf
      @ArifRahman-ce7bf 5 ปีที่แล้ว

      Same Problem. It is not working for API level 21.

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

    Hi thank you so much for this
    but I have a problem, when i close the app and restart it again, everything is good, just navigation view it open from start , why it does not open from end, i hope you understand me , thank you

    • @walidpivano117
      @walidpivano117 4 ปีที่แล้ว

      Hi sir please if you find a solution tell le please!

    • @mohammedtalhaoui1872
      @mohammedtalhaoui1872 3 ปีที่แล้ว

      @@walidpivano117 i found a soulution , you have to set local in OnCreate before setContentView

  • @HY-du5nt
    @HY-du5nt 2 ปีที่แล้ว

    Is this video no voice or it's just my earphone?

  • @lollol-qk7mw
    @lollol-qk7mw 5 ปีที่แล้ว +6

    best! dislikers have no life

    • @kashishsharma5086
      @kashishsharma5086 5 ปีที่แล้ว

      @Trupti Londhe Copy same code in each activity

  • @MeeketTank
    @MeeketTank 3 ปีที่แล้ว

    i am unble to see any indian language when translated and pasted in android studio

  • @prajwalbendale7087
    @prajwalbendale7087 5 ปีที่แล้ว

    thanks for video.... its totally working...
    but when i kill the app and relaunch it, it goes to english language but only main activity other are still translated.....

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

    It did not change during I changed I need to refresh. Why did I get this I was following you all?
    pls help dear.

    • @AtifSayings
      @AtifSayings  6 ปีที่แล้ว

      elaborate the problem

  • @samirdesigner3324
    @samirdesigner3324 6 ปีที่แล้ว

    Very very thanks
    But my bro how work save for some activities by Shared preferences

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

      what you want to save

    • @samirdesigner3324
      @samirdesigner3324 6 ปีที่แล้ว

      Atif Pervaiz if we select language en save to all activity
      Simple. If we use settings from here select language

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

      the method is same
      Write strings of all activities in strings.xml
      You can create a seprate settings activity to change language
      write both functions in each activity, call loadLocale() in onCreate(Bundle savedInstanceState), before setContentView(R.layout.your_activity);

    • @dope_gadget
      @dope_gadget 6 ปีที่แล้ว

      Both functions, you meant loadLocale() and setLocale() ?

  • @admniyeokuyorsun...3044
    @admniyeokuyorsun...3044 5 ปีที่แล้ว +1

    Lol, honestly I was expecting someting much more smaller in code but I forgot that this is java :D

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

      :D

    • @mmkamal
      @mmkamal 5 ปีที่แล้ว

      The code is quite small which was written in java :/

    • @mmkamal
      @mmkamal 5 ปีที่แล้ว

      What he did in java? Made Dialogue and just two methods. That's all. :D How is this not small?

  • @rivensmeicky8309
    @rivensmeicky8309 5 ปีที่แล้ว

    what should i do if i want to implement this method in a fragment that using radio button in setting of apps. thx

    • @ashiqullahmg
      @ashiqullahmg 5 ปีที่แล้ว

      I think you will need to implement it in the base activity only. I mean the one in which you have implemented the fragment.

  • @jitendrapratap9667
    @jitendrapratap9667 5 ปีที่แล้ว

    What if I have tons of data in sqlite database, can I change that too in different languages,or I will have to write again all things in the other languages.

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      i think you have to write separate data for each language

  • @parthanarra6335
    @parthanarra6335 4 ปีที่แล้ว

    It wasn't working on recyclerview items.

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

    sir when i clean app history and then reopen app dosen't have selected language its have default language i want when i select a language then its continue have the language wich i chosed

    • @AtifSayings
      @AtifSayings  2 ปีที่แล้ว

      User shared preferences to save which language was selected then whenever app starts, load the value from shared preferences, in that way you can set the language that was selected last time

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

    Please help don't work idont know why ever think is good and when i click the botton nothing happened

    • @CamboTutorial
      @CamboTutorial 3 ปีที่แล้ว

      You may not work because of Android Version, he implemented only support some version. There is another way to do.

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

    Works , just api level 24 and above , what to do with api level 21 and other, pleas if you can help;

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

    Could you please share with us the code. I want to change the language of my weather app to Arabic.

    • @AtifSayings
      @AtifSayings  4 ปีที่แล้ว

      Actually i don't have code of this project :(

    • @entertechinc
      @entertechinc 4 ปีที่แล้ว

      You can share what you are coding , Thank you.

  • @saadmohammed1997
    @saadmohammed1997 5 ปีที่แล้ว

    Oreo version mobile not change language how to solve?

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

    not working for me the language dosent change

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

    will this make the full app changes, or just that activity only ?
    please reply anyone !

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

      Everything string written in strings.xml either of one activity or all activities of complete app will be changed.

    • @devmoonstar1151
      @devmoonstar1151 6 ปีที่แล้ว

      Thank You ♥

    • @jitendrapratap9667
      @jitendrapratap9667 5 ปีที่แล้ว

      @@AtifSayings but u did write all the languages separately.

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

    is there any method that change app data language at realtime and data is coming from firebase ???

    • @AtifSayings
      @AtifSayings  5 ปีที่แล้ว

      May be.... but i don't know yet

    • @hamzachohan9268
      @hamzachohan9268 5 ปีที่แล้ว

      @@AtifSayings hmmm thanx sir
      and sir is there any method to use single recyclerview + cardview for different data coming from firebase

  • @robertoacosta9788
    @robertoacosta9788 4 ปีที่แล้ว

    Hello friend, a question how could I change the language for all the activities and not in one?

    • @sivakumarb8286
      @sivakumarb8286 4 ปีที่แล้ว

      hello friend ...did you get the answer please share me.. im also having the same doubt