diff --git a/src/main/java/org/schabi/newpipe/extractor/Subtitles.java b/src/main/java/org/schabi/newpipe/extractor/Subtitles.java index bb5fd919b..dd0b94407 100644 --- a/src/main/java/org/schabi/newpipe/extractor/Subtitles.java +++ b/src/main/java/org/schabi/newpipe/extractor/Subtitles.java @@ -3,8 +3,11 @@ package org.schabi.newpipe.extractor; import org.schabi.newpipe.extractor.stream.SubtitlesFormat; import java.io.Serializable; +import java.util.Locale; public class Subtitles implements Serializable { + private final static String AUTO_GENERATED_TAG = " (auto-generated)"; + private final SubtitlesFormat format; private final String languageCode; private final String URL; @@ -30,4 +33,9 @@ public class Subtitles implements Serializable { public boolean isAutoGenerated() { return autoGenerated; } + + public String getDisplayName() { + final Locale locale = new Locale(languageCode.replace("-", "_")); + return locale.getDisplayLanguage() + (isAutoGenerated() ? AUTO_GENERATED_TAG : ""); + } }