Track language handling is wrong for MKV tracks

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift
Domain
desktop

Research direction

Start by locating languages(adding:) and the language handling described in the issue. Check how the track language, ISO 639-2/B codes, and the l → I correction are used before Vision receives the language. Done when track language is primary, codes such as fre and ger are mapped to BCP-47, and the correction is gated on English.

Written by the indexing model from the issue text.

Description

bug
  • languages(adding:) builds "\(options.languages),\(trackLanguage)", so the default -l en always comes first and a French track is recognized English-first.
  • The l → I correction checks language.contains("en"), which is always true with the default, so French/Italian l' becomes I'.
  • MKV stores ISO 639-2/B codes. Locale.Language(identifier: "fre"/"ger").script is nil, so the Latin-confusables repair is disabled for those tracks, and Vision receives raw fre/ger.

Fix: put the track language first, map ISO 639-2/B to BCP-47 (e.g. via Locale.Language(...).maximalIdentifier after mapping B codes), and gate the l → I correction on the primary language being English.

Dominant language
Swift
Stars
42
Forks
9
Avg merge
9h 30m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ecdye/macSubtitleOCR

All issues in ecdye/macSubtitleOCR

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.