Skip to content

Commit

Permalink
change: subtitle selector use regex to distinguish between locale and…
Browse files Browse the repository at this point in the history
… language name (#430)
  • Loading branch information
Adolar0042 authored Oct 20, 2022
1 parent b52129e commit 7847029
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class SubtitleDialogFragment : BottomSheetDialogFragment() {
"pl-PL" -> "[pl-PL] Polish"
"ro-RO" -> "[ro-RO] Romanian"
"sv-SE" -> "[sv-SE] Swedish"
else -> "[${subtitles[position - 1].language}]"
else -> if(subtitles[position - 1].language matches Regex("([a-z]{2})-([A-Z]{2}|\\d{3})")) "[${subtitles[position - 1].language}]" else subtitles[position - 1].language
}
model.getMedia().observe(viewLifecycleOwner) { media ->
val mediaID: Int = media.id
Expand Down

0 comments on commit 7847029

Please sign in to comment.