I am developing an application, where i am providing support for multiple language, but in ImageView for content description
<ImageView
android:id="@+id/imgSomeID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="1dip"
android:layout_marginLeft="1dip"
android:adjustViewBounds="true"
android:contentDescription="@string/imgDescription"
android:src="@drawable/img_selector">
Question
Is it necessary to have content description in all languages?
What will happen if one do not provide content description (keep it same as ENGLISH,US locale)?
Is it right to mix english with local language, e.g Hello 세계 (Korean) => Hello World?
I am new to developing app for multi language, so please help the newbie..
Content description is an accessibility feature which is enabled when people with vision impairment are using your application. When accessibility mode is enabled, Android starts reading content of the screen. This helps people to understand what your app is doing and how to use it without looking at the screen. For controls with text, like buttons, Android will read this text, which is fine. However, if you have an image, then Android will just say "image". This is normally not enough to understand what this image is. This is where content description comes in play. If there is a content description for this image, then this content will be pronounced and people will better understand what this image is. For instance, "image smiling face".
Answering your question, if you do not provide a meaningful and localized content description for images, then people with vision impairment will have difficulties using your application. I would always properly translate it.
There is no perfect answer for your first question. However, since you are developing a multi language application, I would suggest you to have translation for those language which you care about. It may depend on your application's target users. For example, if your target users are Korean, it will be much better if you can have translation for them, isn't it?
For your second question, if your user use the language you did not provide, it will use the default local source file
res/
value/
strings.xml
Usually we will put english resources here since it is the most common language. But you still can put other language resources here if you really want to.
For your third question, it still don't have the perfect answer. It depends on your application's demand and what you want to display to your user. However, it won't mix different language since people usually use the complete string resource.
For example, if you have:
res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World!</string>
</resources>
res/values-es/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hola Mundo!</string>
</resources>
So if you use @string/hello_world, it will display Hola Mundo! if user's device set to Spanish, and display Hello World! for any other settings. Of course you can separate it so that you may get mix language like your post if you really need it.
Here is the document for supporting multiple language. Hope it will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With