Skip to content

Browser language lookup is incorrectly using ISO 639-1 instead of BCP 47 #12003

@tfmorris

Description

@tfmorris

Problem

As I mentioned in #5997 (comment), the language tags sent by browsers are based on BCP 47, not ISO 639-1, so doing ISO 639-1 based lookups is incorrect. This will not work for the over 300 MARC languages which don't have ISO 639-1 codes, disenfranchising those users.

In Wikidata, these can be found using the property P305 "IETF Language Tag". For languages which have ISO 639-1 codes, these will overlap, but most languages do not have an ISO 639-1 code.

Reproducing the bug

  • Expected behavior: Language specific searches like Random Book work for all MARC languages
  • Actual behavior: Only ISO 639-1 languages work

Context

  • Browser (Chrome, Safari, Firefox, etc):
  • OS (Windows, Mac, etc):
  • Logged in (Y/N):
  • Environment (prod, dev, local): prod

Breakdown

Implementation Details (for maintainers)

Requirements Checklist

  • [ ]

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Lead: @cdriniIssues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]Needs: BreakdownThis big issue needs a checklist or subissues to describe a breakdown of work. [managed]Needs: ResponseIssues which require feedback from leadPriority: 3Issues that we can consider at our leisure. [managed]Type: BugSomething isn't working. [managed]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions