From b155f23d276ebc48ffe5fe86759320b6751ac512 Mon Sep 17 00:00:00 2001 From: bopol Date: Sat, 18 Jan 2020 09:46:38 +0100 Subject: [PATCH] fix: wrong language shown in playback parameters dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a hardly reproduceable bug that I hopefully fixed. After a long time of watching videos, you could have your system language shown in playback parameters dialog. Calling changeAppLanguage(getAppLocale(…),…) onCreate will most certainly fix this bug --- .../schabi/newpipe/player/helper/PlaybackParameterDialog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java index 4feed74fe..2aefa675e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java @@ -17,6 +17,8 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.util.SliderStrategy; import static org.schabi.newpipe.player.BasePlayer.DEBUG; +import static org.schabi.newpipe.util.Localization.changeAppLanguage; +import static org.schabi.newpipe.util.Localization.getAppLocale; public class PlaybackParameterDialog extends DialogFragment { @NonNull private static final String TAG = "PlaybackParameterDialog"; @@ -108,6 +110,7 @@ public class PlaybackParameterDialog extends DialogFragment { @Override public void onCreate(@Nullable Bundle savedInstanceState) { + changeAppLanguage(getAppLocale(getContext()), getResources()); super.onCreate(savedInstanceState); if (savedInstanceState != null) { initialTempo = savedInstanceState.getDouble(INITIAL_TEMPO_KEY, DEFAULT_TEMPO); @@ -137,6 +140,7 @@ public class PlaybackParameterDialog extends DialogFragment { @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { + changeAppLanguage(getAppLocale(getContext()), getResources()); final View view = View.inflate(getContext(), R.layout.dialog_playback_parameter, null); setupControlViews(view);