1

I have a set of textless PNG buttons that I did adding the text in photoshop in English and in Spanish, I don't have the option to use the string file cause the text is already added in Photoshop. How do I use the spanish buttons if the user selects spanish language??.......

JAF
  • 350
  • 3
  • 19

2 Answers2

2

The same as Spanish strings. You can use drawable-en and drawable-es same way as for strings - values-en, values-es. Put image for English into drawable-en, and for Spanish - into drawable-es

Vladyslav Matviienko
  • 10,610
  • 4
  • 33
  • 52
  • Thanks, both answers were good but I'll take this one cause I don't have many images as 2Dee suggested. Just one more question, If I have the drawable-en and drawable-es in two sepparate folders, what's going to happen if someone from other place than those two enters the app, should I keep a neutral drawable folder to provide the default english images to these people? – JAF Sep 23 '15 at 21:02
  • 1
    @JAF You'll need the default image placed into `drawable` folder. Without any `-en` or `-es` – Vladyslav Matviienko Sep 24 '15 at 04:44
1

PNG buttons that I did adding the text in photoshop

--> that's your main problem, trying to circumvent it will probably prove to be less efficient than using the framework's built-in system to produce buttons with text and images (this question discusses how to do that). But if you can't, you can probably use the system's Locale to determine the language of the user, like so :

Locale.getDefault().getLanguage()
// this will return "en" for english
Community
  • 1
  • 1
2Dee
  • 8,609
  • 7
  • 42
  • 53
  • The thing is that I did a button with two states that I control with an XML when the user clicks on it and I needed the blending effect on the text that only photoshop gives me.....Thanks anyway for the function, really useful – JAF Sep 23 '15 at 14:34
  • De nada, I hope it will prove useful nonetheless. You could try Vlad Matvienko's solution if you don't have too many images (duplicating images in several folders will make your apk size grow). – 2Dee Sep 23 '15 at 14:57