I asked a similar question earlier for Swift, and I'm now facing the same problem in Android/Java.
Is there a way in Java for adding quotation marks to a String? The quotation marks should localize properly (see https://en.wikipedia.org/wiki/Quotation_mark) based on the user's language settings. The text is stored without quotes in a database. I'd like to show the string in a TextView
after adding the quotes.
For instance:
String quote = "To be or not to be..."
// one or more lines of code that add localized quotation marks
// to the beginning and the end of the string
mMyTextView.setText(stringWithQuotes);
For a French user: «To be or not to be...»
For a German user: To be or not to be...
For an English (US) user: To be or not to be...
I've not tried this, but you may be able to use Locale.getDefault. You could create an enum for each country with different quotations and supply that in the enum. Then it would just be a matter of finding the locale that matches an enum and substituting in the specified locale's quotation mark character.