I am trying to create multilangualge app and faced with a problem! I have a string in values\strings.xml
translated in German language values-de\strings.xml
. I am trying to compare user input with those strings. If my input is in English and device's language is also English, everything works fine, but if I switch device's language to German and input a string in English, contains()
and equals()
methods will return false
. Is there a way to compare strings in different languages? Thanks in advance! Also, sorry for my English!
if (mystring.contains(context.getResources().getString(R.string.testString))) {
check = true;
}
if (mystring.equals(context.getResources().getString(R.string.testString))) {
check = true;
}