Reputation: 1225
I try to translate my application to other languages. I added a few local files values/strings.xml to the project with relevant translation. The text is translated now, however it is not enough. There are 2 problems:
How I can solve those problems?
Upvotes: 1
Views: 68
Reputation: 8745
You can define other layout for right to left languages. You should place it to layout-<your language code>.
Also you can truncate and replace last chars of the string if it is too large. You can do this using android:ellipsize and android:singleLine attributes:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text_mytext"
android:ellipsize="end"
android:singleLine="true"
/>
Another way is to define text size in dimens.xml for needed languages and use it as follows:
in dimens.xml:
<dimen name="text_size">32sp</dimen>
in layout:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text_mytext"
android:textSize="@dimen/text_size"
/>
Upvotes: 1