I apologize for the simpel question, I am new to Android development.

I am writing three Android apps. All of them supporting right-to-left languages (specifically, Arabic, Hebrew, and Persian).

The UI and language for each of those apps will always be irrelevant to the OS language. So, assuming the OS language is English, the apps UI will still be displayed in the corresponding app language (either Arabic, Hebrew, or Persian; depending on which version is installed). This note is important to mention because I am not localizing the app in which its UI will change based on user's OS language setting, but rather creating apps that are specific to the three languages mentioned above.

Now, how do I do that? How do I set the app language to be Arabic, Hebrew, or Persian? Setting this is important, because for example, android:orientation="horizontal" in LinearLayout will display the UI components of the children from right to left as opposed to the default left-to-right orientation when the language is English for example.

Thanks.

有帮助吗?

解决方案

Set the layout_gravity of your containers to right. That will force them to align to the right edge first.

Also, this may be easier to do as a relative layout for everything. You can always do an align to the right edge or alignParentRight

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top