Skip to content

BB-872: feat(editor): Add language-specific sort name generation to improve guessing#1212

Draft
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-872
Draft

BB-872: feat(editor): Add language-specific sort name generation to improve guessing#1212
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-872

Conversation

@atharvsp02
Copy link
Contributor

@atharvsp02 atharvsp02 commented Dec 27, 2025

Problem

Sort name guessing was too simplistic - only moved the last word to front, ignoring language-specific naming conventions. This caused incorrect sort names for different languages. The language dropdown existed but wasn't used for sort name generation.

Issue link: https://tickets.metabrainz.org/browse/BB-872

Solution

Implemented language-aware sort name generation that uses the selected language dropdown:

  • Created guess-case-util.ts with language-specific parsing functions
  • Moved language dropdown above sort name field for better UX flow
  • Pass selected language ISO code to sort name generation
  • Support particles for Dutch, German, French, Italian, Portuguese (e.g., "von Beethoven, Ludwig")
  • Support Eastern order for Japanese, Chinese, Korean, Hungarian (no reordering)
  • Support Russian patronymic names (FirstName Patronymic LastName → LastName, FirstName Patronymic)
  • Extended article handling to 10 languages for collective names

Areas of Impact

Components Modified:

  • guess-case-util.ts - New centralized sort name logic
  • sort-name-field.tsx - Simplified, imports language-aware makeSortName
  • name-section.js - Field reordering and language ISO code integration

User Experience

  • "Guess" button now generates correct sort names based on selected language
  • Language field positioned above Sort Name for logical workflow
  • Backward compatible - defaults to English logic for other languages

Screenshots

Dutch Norwegian
Dutch particle example Norwegian compound surname example
Spanish (Title with article) Italian (Title with article)
image image

@atharvsp02 atharvsp02 changed the title feat: Add language-specific sort name generation to improve guessing for most used languages BB-872: feat(editor): Add language-specific sort name generation to improve guessing Dec 27, 2025
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.

1 participant

Comments