Skip to content

feat(settings): choose the content language, with upload dates read in it - #177

Merged
A-EDev merged 6 commits into
mainfrom
feat/content-language
Oct 24, 2026
Merged

A-EDev merged 6 commits into
mainfrom
feat/content-language

Conversation

@A-EDev

@A-EDev A-EDev commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Third and last Phase 5 PR of the InnerTube parity plan (K5, Q3). It is stacked on #176.

  • A Content language setting (Settings, Region) lets YouTube write its text in one of 74 languages besides English, which stays the default.
    • core/locale.rs keeps the language and normalises it the way Flow for Android does (normalizeYouTubeHostLanguage, with Android's test vectors): Brazilian and European Portuguese and three Chinese variants stay apart, other regional variants collapse to their language.
    • Every request carries it except player requests, video and music, which stay English so every playability rule keeps working. Requests whose body has no context of its own get it from the transport, which keeps player English too.
  • Upload ages are read in the content language:
    • The per-language unit words come from NewPipe Extractor v0.26.5 (TeamNewPipe, GPL-3.0, credited in json/age_patterns.rs): 80 tables including Hebrew's dual forms.
    • The rule is NewPipe's: a unit word bounded by spaces or digits (or anywhere for languages written without spaces), and the text's number, else one.
    • English keeps its own reader, which knows the compact "2d ago".
    • Related and other lockup cards write compact ages in many languages ("il y a 2 sem.", "hace 16 a", "5 дн. назад"), which no table covers. Their metadata parts also carry an accessibility label with the full form ("il y a 2 semaines"), so outside English that form is what the card shows and what is read.
  • Counts outside English:
    • Exact counts are read whatever their grouping marks: "621.747 Aufrufe", "22 391 vues", "621 747 просмотров", "5,874,003回視聴".
    • CJK multipliers are applied: "587万", "1.3億".
    • Other abbreviations ("23 Mio.", "220 k", "6,3 млн") are left unknown rather than read as 23, 220 or 63. Their text is still shown on the card, which now finds its views part by digits as well as by icon.
    • A date such as "12.10.2026" is not a count.
  • The channel header's subscriber and video counts are read by position outside English, subscribers first. A lone count is shown but not read as a number.

Related issue

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Documentation
  • Build, packaging, or CI

Validation

  • pnpm test: 366 tests passed

  • pnpm build: passed

  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check: passed

  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features: no errors; lib warnings 545 (main: 773). No new warnings on changed lines beyond the too_many_lines one feat(player): Stable volume and volume normalized across videos #176 notes.

  • cargo test --manifest-path src-tauri/Cargo.toml --all-targets --all-features: 781 passed, 0 failed, 6 ignored

  • I smoke-tested the affected desktop behavior.

  • A new tests/innertube_locale.rs reads real captures in German, French, Japanese, Spanish, Russian and Brazilian Portuguese. For each language:

    • at least four in five search and related ages read;
    • at least half the search results have a count, and every count read is 1,000 or more, so no abbreviation was misread;
    • the channel header keeps its handle, separate subscriber and video counts, and tab kinds;
    • music search keeps its top result, offered filters, episodes and artists.
  • It runs in its own binary because it sets the process-wide language.

  • Unit tests cover ages in nine languages (including Hebrew's "יומיים" and Chinese "3天前"), word bounds, counts in five scripts, and the normaliser.

  • Every language in the setting resolves to a date table.

Smoke test on macOS (Apple Silicon), test profile, content language German:

  • Search showed "vor 1 Jahr", "vor 4 Monaten" and "317.914 Aufrufe".
  • Related videos showed "vor 2 Monaten" and "vor 16 Jahren" with counts "1 Mio." and "208 Mio.", whose numbers were left unknown.
  • The watch page read "1.829.956.154 Aufrufe" and "25.10.2009". The WAN Show playlist kept its owner, Linus Tech Tips, with 578 videos and "vor 3 Monaten gestreamt".
  • The channel showed "16,9 Mio. Abonnenten", "7964 Videos" and its tabs, Übersicht to Suchen, with the right kinds.
  • A video played. The category lookup still answered "Music" in German, since its player request stays English.

Not checked:

  • The playlist header's total view count: it is found by the word "view" and stays empty outside English.
  • Upcoming lockups outside English: they are recognised by English text ("Premieres"), so in other languages they show as ordinary cards with their start time as the date.
  • Languages beyond the six captured.
  • Windows and Linux.

Screenshots or recordings

Risk and compatibility

  • No migrations and no new dependencies.

  • Off by default: with no language set, requests and parsing are as before.

  • Outside English, abbreviated view counts have no number, so FlowNeuro and Home score those videos without their popularity.

  • Cached pages keep the language they were fetched in until they refresh.

  • No new secrets, private data, telemetry, or broad Tauri permissions were introduced.

  • User-facing documentation was updated where needed.

  • Dependency and lockfile changes are intentional and limited to this PR.

  • Breaking changes and upgrade steps are clearly documented.

Copilot AI balanced review requested due to automatic review settings October 24, 2026 10:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@A-EDev A-EDev changed the title feat(settings): content language with upload dates read in 80 languages feat(settings): choose the content language, with upload dates read in it Oct 24, 2026
@A-EDev
A-EDev force-pushed the feat/player-audio-video branch from 10b463d to aa0ba89 Compare October 24, 2026 11:14
@A-EDev
A-EDev force-pushed the feat/content-language branch from e50a4d3 to 6e37c1f Compare October 24, 2026 11:14
@A-EDev
A-EDev changed the base branch from feat/player-audio-video to main October 24, 2026 11:14
@A-EDev
A-EDev merged commit 3f61f3a into main Oct 24, 2026
1 check passed
@A-EDev
A-EDev deleted the feat/content-language branch October 24, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants