diff options
author | Arne Schwabe <arne@rfc2549.org> | 2021-10-13 03:33:28 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2021-10-13 03:34:30 +0200 |
commit | d54b7f0a3528307f4218412037b017f37d924b00 (patch) | |
tree | 7d781298502eb2adc437d591dd9e28ef4fb13a71 /main/src/ui/java | |
parent | cbb44807587e7e51acd3813099059a94448a6de4 (diff) |
Make a toggle to allow community translation (closes #681)
Since it is hard for me to check languages other than the ones that
I speak myself, languages other than English/German default to off.
This might change if I have someone trusted to review other languages.
Diffstat (limited to 'main/src/ui/java')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/activities/BaseActivity.java | 13 |
1 files changed, 9 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); } } |