summaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java13
-rw-r--r--main/src/ui/res/xml/general_settings.xml7
2 files changed, 16 insertions, 4 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java b/main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java
index 0e143042..cca8b155 100644
--- a/main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java
+++ b/main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java
@@ -6,12 +6,16 @@
package de.blinkt.openvpn.activities;
import android.app.UiModeManager;
+import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.Window;
+import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
+import de.blinkt.openvpn.core.LocaleHelper;
+
public abstract class BaseActivity extends AppCompatActivity {
boolean isAndroidTV() {
final UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
@@ -29,12 +33,13 @@ public abstract class BaseActivity extends AppCompatActivity {
}
@Override
- protected void onResume() {
- super.onResume();
+ protected void attachBaseContext(Context base) {
+ super.attachBaseContext(LocaleHelper.updateResources(base));
}
@Override
- protected void onPause() {
- super.onPause();
+ public void onConfigurationChanged(@NonNull Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ LocaleHelper.onConfigurationChange(this);
}
}
diff --git a/main/src/ui/res/xml/general_settings.xml b/main/src/ui/res/xml/general_settings.xml
index 5c2ff8aa..dcaafde2 100644
--- a/main/src/ui/res/xml/general_settings.xml
+++ b/main/src/ui/res/xml/general_settings.xml
@@ -13,6 +13,13 @@
android:summary="@string/show_log_summary"
android:title="@string/show_log_window"/>
+ <CheckBoxPreference
+ android:defaultValue="@bool/allowTranslationDefault"
+ android:key="allow_translation"
+ android:title="@string/allow_translations_title"
+ android:summary="@string/allow_translatiosn_summary"
+ />
+
<CheckBoxPreference
android:defaultValue="false"