Android app development

I am working on a relatively simple Android application. I want him to have an English version as well as a Hebrew version.

I have an activity that is all laid out in English, and I want to create resources in Hebrew. I could not find an easy way to do this. The only way I found is to take the layout / activity.xml file, put it in layout-iw / activity.xml and manually change everything so that it appears from right to left.

I need to reverse the order of all elements in any horizontally oriented container (all columns in <TableRow> s, all elements in horizontal <LinearLayout> s, etc.). I need to switch all layout_marginLefts with layout_marginRights and, of course, make left-aligned aligned right-aligned.

This is tiring, especially if I think about a change in activity at some point - I will need to change resources twice, and this in itself gives me a headache.

There should be an easier way.

+7
source share
1 answer

Unfortunately, you are right, this is exactly what you will need to do. I would suggest using styles to format any elements where you want to change the padding or fields to switch from text from left to right. If you build your styles correctly, this should limit the number of line-by-line changes needed in individual layout files. However, I understand that this is the case when the rear platform is 20/20.

+2
source

All Articles