1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-05 01:52:22 +01:00

added Language suffix for subtitle downloads

This commit is contained in:
pratyaksh1610 2022-12-04 17:59:22 +05:30
parent bd6b3c53c5
commit 1afb9cdba9
2 changed files with 19 additions and 0 deletions

View File

@ -562,6 +562,24 @@ public class DownloadDialog extends DialogFragment
selectedSubtitleIndex = position;
break;
}
onItemSelectedSetFileName();
}
private void onItemSelectedSetFileName() {
final String setSubtitleLanguageCode = subtitleStreamsAdapter.getItem(selectedSubtitleIndex)
.getLanguageTag();
switch (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()) {
case R.id.audio_button:
case R.id.video_button:
dialogBinding.fileName.setText(FilenameUtils.createFilename(getContext(),
currentInfo.getName()));
break;
case R.id.subtitle_button:
dialogBinding.fileName.setText(FilenameUtils.createFilename(getContext(),
currentInfo.getName() + getString(
R.string.caption_file_name, setSubtitleLanguageCode)));
break;
}
}
@Override

View File

@ -452,6 +452,7 @@
<string name="resize_zoom">Zoom</string>
<string name="caption_auto_generated">Auto-generated</string>
<!-- Caption Settings -->
<string name="caption_file_name">-%s</string>
<string name="caption_setting_title">Captions</string>
<string name="caption_setting_description">Modify player caption text scale and background styles. Requires app restart to take effect</string>
<!-- Debug Settings -->