Made the "Automated" video quality translatable

This commit is contained in:
Florian CUNY 2020-07-05 09:38:03 +02:00
parent fd3a7c87d1
commit d631193311
4 changed files with 8 additions and 4 deletions

View File

@ -17,6 +17,7 @@
*/ */
package net.schueller.peertube.fragment; package net.schueller.peertube.fragment;
import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -44,7 +45,7 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment {
public static final String TAG = "VideoMenuQuality"; public static final String TAG = "VideoMenuQuality";
private static File autoQualityFile; private static File autoQualityFile;
public static VideoMenuQualityFragment newInstance(ArrayList<File> files) { public static VideoMenuQualityFragment newInstance(Context context, ArrayList<File> files) {
mFiles = files; mFiles = files;
@ -53,7 +54,7 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment {
autoQualityFile = new File(); autoQualityFile = new File();
Resolution autoQualityResolution = new Resolution(); Resolution autoQualityResolution = new Resolution();
autoQualityResolution.setId(0); autoQualityResolution.setId(0);
autoQualityResolution.setLabel("Auto"); autoQualityResolution.setLabel(context.getString(R.string.menu_video_options_quality_automated));
autoQualityFile.setId(0); autoQualityFile.setId(0);
autoQualityFile.setResolution(autoQualityResolution); autoQualityFile.setResolution(autoQualityResolution);
} }

View File

@ -87,7 +87,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment {
new Iconics.IconicsBuilder().ctx(getContext()).on(iconView2).build(); new Iconics.IconicsBuilder().ctx(getContext()).on(iconView2).build();
textView2.setOnClickListener(view1 -> { textView2.setOnClickListener(view1 -> {
VideoMenuQualityFragment videoMenuQualityFragment = VideoMenuQualityFragment videoMenuQualityFragment =
VideoMenuQualityFragment.newInstance(files); VideoMenuQualityFragment.newInstance(getContext(), files);
videoMenuQualityFragment.show(getActivity().getSupportFragmentManager(), videoMenuQualityFragment.show(getActivity().getSupportFragmentManager(),
videoMenuQualityFragment.TAG); videoMenuQualityFragment.TAG);
}); });
@ -106,6 +106,7 @@ public class VideoOptionsFragment extends BottomSheetDialogFragment {
return file.getResolution().getLabel(); return file.getResolution().getLabel();
} }
} }
return "Auto"; // Returning Automated as a placeholder
return getString(R.string.menu_video_options_quality_automated);
} }
} }

View File

@ -343,4 +343,5 @@
<string name="title_activity_select_server">Sélectionner un serveur</string> <string name="title_activity_select_server">Sélectionner un serveur</string>
<string name="server_book_del_alert_title">Retirer un serveur</string> <string name="server_book_del_alert_title">Retirer un serveur</string>
<string name="server_book_del_alert_msg">Voulez-vous vraiment retirer ce serveur de votre carnet d\'adresses ?</string> <string name="server_book_del_alert_msg">Voulez-vous vraiment retirer ce serveur de votre carnet d\'adresses ?</string>
<string name="menu_video_options_quality_automated">Automatique</string>
</resources> </resources>

View File

@ -384,6 +384,7 @@
<string name="pref_token_type" translatable="false">pref_token_type</string> <string name="pref_token_type" translatable="false">pref_token_type</string>
<string name="pref_auth_username" translatable="false">pref_auth_username</string> <string name="pref_auth_username" translatable="false">pref_auth_username</string>
<string name="pref_auth_password" translatable="false">pref_auth_password</string> <string name="pref_auth_password" translatable="false">pref_auth_password</string>
<string name="menu_video_options_quality_automated">Automated</string>
</resources> </resources>