Inside my Fragment I fetch a string which returns French translation but I want it to return English translation. What I noticed so far:
binding.textView = resources.getString(R.string.displayText) // returns French translation
binding.textView = getString(R.string.displayText) // returns English text
The issue seems to be when I use resources
. I don't understand how and why this happens, both examples will call public String getString(int resId)
inside Resources.
How can one return French text and the other one return English when both call the same getString() function?
I've tried using StringResources but that class is deprecated and shouldn't be used anymore.