Skip to content

Commit

Permalink
indonesian audio track fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Dec 30, 2024
1 parent 413d0b1 commit 075bae6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private void showGroupDialog(Video item, VideoMenuCallback callback) {
List<ChannelGroup> groups = mService.getChannelGroups();

List<OptionItem> options = new ArrayList<>();


// Create new group or enter url
String editDialogTitle = mContext.getString(R.string.new_subscriptions_group);
options.add(UiOptionItem.from(editDialogTitle, optionItem -> {
dialogPresenter.closeDialog();
Expand Down Expand Up @@ -111,8 +112,9 @@ private void showGroupDialog(Video item, VideoMenuCallback callback) {
return true;
});
}, false));

String filePickerTitle = mContext.getString(R.string.import_subscriptions_group) + " (GrayJay/PocketTube)";

// Import from the file
String filePickerTitle = mContext.getString(R.string.import_subscriptions_group) + " (GrayJay/PocketTube/NewPipe)";
options.add(UiOptionItem.from(filePickerTitle, optionItem -> {
dialogPresenter.closeDialog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ private MediaTrack[][] filterByLanguage(MediaTrack[][] trackGroupList, MediaTrac
return trackGroupList;
}

String audioLanguage = PlayerData.instance(mContext).getAudioLanguage();
String audioLanguage = fixLangCode(PlayerData.instance(mContext).getAudioLanguage());

String resultLanguage = null;
String originLanguage = null;
Expand Down Expand Up @@ -840,4 +840,17 @@ private boolean isErrorInAudio(MediaTrack mediaTrack) {
private boolean isUnsafeFormat(MediaTrack mediaTrack) {
return mediaTrack.isMP4ACodec() && mediaTrack.format.bitrate >= 195_000;
}

private String fixLangCode(String langCode) {
if (langCode == null) {
return null;
}

switch (langCode) {
case "in": // Wrong Indonesian
return "id"; // Correct Indonesian
default:
return langCode;
}
}
}
2 changes: 1 addition & 1 deletion common/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -680,5 +680,5 @@
<string name="screen_dimming_amount">Степень затемнения экрана</string>
<string name="screen_dimming_timeout">Тайм-аут затемнения экрана</string>
<string name="playlists_rows">Отображать раздел Плейлисты в виде строк</string>
<string name="import_subscriptions_group">Импортировать файл</string>
<string name="import_subscriptions_group">Импортировать</string>
</resources>
2 changes: 1 addition & 1 deletion common/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -689,5 +689,5 @@
<string name="screen_dimming_amount">Ekran karartma miktarı</string>
<string name="screen_dimming_timeout">Ekran karartma zaman aşımı</string>
<string name="playlists_rows">Oynatma listelerini satır olarak göster</string>
<string name="import_subscriptions_group">Dosyayı içe aktar</string>
<string name="import_subscriptions_group">Içe aktar</string>
</resources>
2 changes: 1 addition & 1 deletion common/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -680,5 +680,5 @@
<string name="screen_dimming_amount">Величина затемнення екрана</string>
<string name="screen_dimming_timeout">Тайм-аут затемнення екрана</string>
<string name="playlists_rows">Відображати розділ Плейлисти у вигляді рядків</string>
<string name="import_subscriptions_group">Імпорт файлу</string>
<string name="import_subscriptions_group">Імпорт</string>
</resources>
2 changes: 1 addition & 1 deletion common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@
<string name="screen_dimming_amount">Screen dimming amount</string>
<string name="screen_dimming_timeout">Screen dimming timeout</string>
<string name="playlists_rows">Show Playlists section as rows</string>
<string name="import_subscriptions_group">Import file</string>
<string name="import_subscriptions_group">Import</string>
<string name="lb_playback_controls_closed_captioning_disable">Disable Closed Captioning</string>
<string name="lb_playback_controls_closed_captioning_enable">Enable Closed Captioning</string>
</resources>

0 comments on commit 075bae6

Please sign in to comment.