Skip to content

Commit

Permalink
Merge pull request #61 from hockyy/miteiru/5.0.0
Browse files Browse the repository at this point in the history
Force english when file has .en.
  • Loading branch information
hockyy authored Aug 28, 2024
2 parents f8481cd + 75b6572 commit 8f58516
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion renderer/components/Subtitle/DataStructures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class SubtitleContainer {

static async create(filename: string, lang: string, isSimplified: boolean) {
if (filename === '') return
const isForcedEnglish = filename.includes('.en.');
const subtitleContainer = new SubtitleContainer();
subtitleContainer.path = filename;

Expand All @@ -172,7 +173,8 @@ export class SubtitleContainer {
entries = parsedSubtitle.content.entries;
}

this.createFromArrayEntries(subtitleContainer, entries, lang, isSimplified);
this.createFromArrayEntries(subtitleContainer, entries,
isForcedEnglish ? videoConstants.englishLang : lang, isSimplified);
return subtitleContainer;
} catch (error) {
console.error('Error parsing subtitle:', error);
Expand Down

0 comments on commit 8f58516

Please sign in to comment.