I'm developing a multilingual app and need to show a different layout for a specific region
My res structure is as follows
res/
layout/
questions.xml
layout-ar-rLY/
questions.xml
When the locale is English (en) the default layout is shown. When the locale is Libyan the Libyan (ar_LY) layout is shown. However, when the locale is Arabic (ar) the Libyan layout is still shown. I need it to show the default layout.
I know that I can simply create a layout-ar directory and copy the questions.xml layout there, however, I am wondering if there is a more elegant way to achieve the right result, so that I don't have to maintain both files.
res/
layout/
questions.xml
layout-ar/
questions.xml
layout-ar-rLY/
questions.xml
The best solution I have come up with so far is for the default and the Arabic layouts both to include a shared sub-layout. Is there a better way to achieve the same result?