mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 08:08:16 +02:00
Localize reply header based on detected language
This commit is contained in:
@@ -752,6 +752,16 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
static String getString(Context context, String language, int resid, Object... formatArgs) {
|
||||
if (language == null)
|
||||
return context.getString(resid, formatArgs);
|
||||
|
||||
Configuration configuration = new Configuration(context.getResources().getConfiguration());
|
||||
configuration.setLocale(new Locale(language));
|
||||
Resources res = context.createConfigurationContext(configuration).getResources();
|
||||
return res.getString(resid, formatArgs);
|
||||
}
|
||||
|
||||
static String[] getStrings(Context context, int resid, Object... formatArgs) {
|
||||
return getStrings(context, null, resid, formatArgs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user