mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Include an English filter line in the support email body.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package org.signal.core.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Gives access to English strings.
|
||||
*/
|
||||
public final class EnglishResourceUtil {
|
||||
|
||||
private EnglishResourceUtil() {
|
||||
}
|
||||
|
||||
public static Resources getEnglishResources(@NonNull Context context) {
|
||||
Configuration configurationLocal = context.getResources().getConfiguration();
|
||||
|
||||
Configuration configurationEn = new Configuration(configurationLocal);
|
||||
configurationEn.setLocale(Locale.ENGLISH);
|
||||
|
||||
return context.createConfigurationContext(configurationEn)
|
||||
.getResources();
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,7 @@ public final class TranslationDetection {
|
||||
public TranslationDetection(@NonNull Context context) {
|
||||
this.resourcesLocal = context.getResources();
|
||||
this.configurationLocal = resourcesLocal.getConfiguration();
|
||||
|
||||
Configuration configurationEn = new Configuration(configurationLocal);
|
||||
configurationEn.setLocale(Locale.ENGLISH);
|
||||
|
||||
this.resourcesEn = context.createConfigurationContext(configurationEn).getResources();
|
||||
this.resourcesEn = EnglishResourceUtil.getEnglishResources(context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user