From d631193311d1d56befaf26555a2f4fea1eb6628d Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 5 Jul 2020 09:38:03 +0200 Subject: [PATCH] Made the "Automated" video quality translatable --- .../peertube/fragment/VideoMenuQualityFragment.java | 5 +++-- .../schueller/peertube/fragment/VideoOptionsFragment.java | 5 +++-- app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java index 45420d9..da55956 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java @@ -17,6 +17,7 @@ */ package net.schueller.peertube.fragment; +import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; @@ -44,7 +45,7 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment { public static final String TAG = "VideoMenuQuality"; private static File autoQualityFile; - public static VideoMenuQualityFragment newInstance(ArrayList files) { + public static VideoMenuQualityFragment newInstance(Context context, ArrayList files) { mFiles = files; @@ -53,7 +54,7 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment { autoQualityFile = new File(); Resolution autoQualityResolution = new Resolution(); autoQualityResolution.setId(0); - autoQualityResolution.setLabel("Auto"); + autoQualityResolution.setLabel(context.getString(R.string.menu_video_options_quality_automated)); autoQualityFile.setId(0); autoQualityFile.setResolution(autoQualityResolution); } diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java index 01da654..f27080c 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoOptionsFragment.java @@ -87,7 +87,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment { new Iconics.IconicsBuilder().ctx(getContext()).on(iconView2).build(); textView2.setOnClickListener(view1 -> { VideoMenuQualityFragment videoMenuQualityFragment = - VideoMenuQualityFragment.newInstance(files); + VideoMenuQualityFragment.newInstance(getContext(), files); videoMenuQualityFragment.show(getActivity().getSupportFragmentManager(), videoMenuQualityFragment.TAG); }); @@ -106,6 +106,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment { return file.getResolution().getLabel(); } } - return "Auto"; + // Returning Automated as a placeholder + return getString(R.string.menu_video_options_quality_automated); } } \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a39fbef..52397c7 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -343,4 +343,5 @@ Sélectionner un serveur Retirer un serveur Voulez-vous vraiment retirer ce serveur de votre carnet d\'adresses ? + Automatique \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4bee5e8..f000c8c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -384,6 +384,7 @@ pref_token_type pref_auth_username pref_auth_password + Automated \ No newline at end of file