I have an app which shows html files from assets folder. I would like to translate some files.
For example I have files in folder assets/fr for french users and in assets/en for others.
Here is the line which I want to change:
String htmlFileName = "m" + bundle.getString("defStrID") + ".html";
So I want to get language of phone, if it’s french I want to show files from /fr and if it’s other show /en.
The modified version of this line will look like
String locale = java.util.Locale.getDefault().getDisplayName();
if locale=french
String htmlFileName = "m" + bundle.getString("defStrID") + ".html";
else
String htmlFileName = "mn" + bundle.getString("defStrID") + ".html";
endif
Syntax is incorrect because I don’t know how to do that. Help, please.
Hi Please used below Syntax