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;
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<File> files) {
public static VideoMenuQualityFragment newInstance(Context context, ArrayList<File> 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);
}

View File

@ -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);
}
}

View File

@ -343,4 +343,5 @@
<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_msg">Voulez-vous vraiment retirer ce serveur de votre carnet d\'adresses ?</string>
<string name="menu_video_options_quality_automated">Automatique</string>
</resources>

View File

@ -384,6 +384,7 @@
<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_password" translatable="false">pref_auth_password</string>
<string name="menu_video_options_quality_automated">Automated</string>
</resources>