2

My problem statement is I want to develop an application for more than one languages that will support to the multiple devices. How I set the images according to locale and device? I know how to put the single image to multiple devices.

And also know how to set the single image for the different language.But I implemented it separately.Can we do this?

Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79
Karuna Darekar
  • 349
  • 2
  • 14

3 Answers3

2

Your first question: How I set the images according to locale and device?

you can create directory like this I have tested working fine

drawable-en-sw600dp - 7 inch Tab with English
-->ic_lan.png

drawable-hi-sw600dp - 7 inch Tab with Hindi

-->ic_lan.png

drawable-hi -normal phone with Hindi

-->ic_lan.png

enter image description here

MilapTank
  • 9,988
  • 7
  • 38
  • 53
1

Yes. Just like strings, you need to localize them. Check https://developer.android.com/guide/topics/resources/localization.html

It explains how you can separate your resources folders to support multiple languages.

Rui Santos
  • 537
  • 3
  • 15
1

if you want to put localisation in your app. You need to create the different layout folder according to your language.

Suppose your app have two language support 1)English 2)Arabic

You need to create the layout folder with layout-en (for english) layout-ar (for arabic)

And you want to use one image with support of all screen then you need to make the image size different according to screen size and paste it to

This are the folder where you need to paste your image.

1)drawable-xhpi 2)drawable-xxhdpi 3)drawable-xxxhdpi

  • I already have drawable-night and drawable folders. Now, I want to differentiate the images on base of Language too. So, How will I make folders now ? – Ali Raza Jan 31 '22 at 09:45