Reputation: 5074
I have android app, which has a lot of string resources localized for different languages (~200 strings for 10 languages). Some of them displayed on limited area. To make them fit correctly I have different text sizes for different resolutions (ldpi, hdpi, etc). But now I have a problem, that some text on different languages have different length and do not fit that area. Is there a way how can I fit all text properly, to avoid too small text on one language and to big on another? Thanks.
Upvotes: 2
Views: 429
Reputation: 1046
In theory, you can create specific language and specific resolution folders.
The naming convention has a hierarchy of qualifiers and qualifiers must be added in that order only.
values-en-hdpi (it cannot be values-hdpi-en)
values-en-land-hdpi (it cannot be values values-hdpi-en-land or any other order)
layout-hdpi
The order is documented in table 2 at this page
If we were to add values in all possible permutations, this can become overkill as there will be an explosion of permutations of values-xx-xx folders.
In my view, you should normally have
values-en
values-hdpi
working together seamlessly, as long as they do not override the same item from the default values folder. Generally, values-en will only override strings and values-hdpi will override dimensions.
values-en-hdpi will be needed only when you have the same item in the language and resolution folder (which generally is not the case).
Upvotes: 0
Reputation: 3695
I m not aware of any other way other than having different Text size for difference languages.
You can use the dimens.xml resource file for this purpose. In your case you'll probably want to create a file called res/values-es/dimens.xml, and possibly also a -fr version. You can specifify the default values in res/values/dimens.xml (or res/values-en/dimens.xml, if you want to be more specific).
Upvotes: 2