Skip to content

Conversation

@nabalone
Copy link
Collaborator

@nabalone nabalone commented Sep 9, 2025

This change is Reviewable

Copy link
Member

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

One minor comment that may not apply to this specific change.
It may be better for at least one other person to review this who is more familiar with this code.

@StephenMcConnel reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @nabalone)


components/language-chooser/common/find-language/scripts/langtagProcessingHelpers.ts line 57 at r1 (raw file):

  // These are not in the langtags.json file but may be added in the processing
  isRepresentativeForMacrolanguage: boolean;
  indivIsoCode: string;

would a comment on how this differs from iso639_3 be helpful?

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nabalone)


components/language-chooser/common/find-language/scripts/langtagProcessing.ts line 175 at r1 (raw file):

        alternativeTags: [...langData.alternativeTags],
        parentMacrolanguage: langData.parentMacrolanguage,
        isMacrolanguage: false, // we add macrolanguages separately below. See macrolanguageNotes.md

Is this fixing an unrelated bug?
(Same question for removing it above)

@nabalone nabalone force-pushed the BL-15209_autonyms_in_default_scripts branch from 032afd1 to 15e6092 Compare September 10, 2025 14:41
Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nabalone)

@andrew-polk andrew-polk requested a review from Copilot September 10, 2025 18:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where autonyms (native language names) should be displayed using the default script of a language rather than from other script variants. The change ensures that when multiple script entries exist for a language, the system prioritizes the autonym from the default script entry (the one without script modifiers in the tag).

  • Added logic to track and prefer default script autonyms during language data processing
  • Updated data structures to include a defaultScriptAutonym field for proper autonym selection
  • Added comprehensive test coverage for the new default script autonym behavior

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
langtagProcessingHelpers.ts Added interface fields and removed debug logging
langtagProcessing.ts Implemented core logic for tracking and using default script autonyms
languageSearch.spec.ts Added tests to verify default script autonym selection behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nabalone nabalone force-pushed the BL-15209_autonyms_in_default_scripts branch from 15e6092 to a1ddb9b Compare September 11, 2025 14:37
Copy link
Collaborator Author

@nabalone nabalone left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @andrew-polk and @StephenMcConnel)


components/language-chooser/common/find-language/scripts/langtagProcessing.ts line 175 at r1 (raw file):

Previously, andrew-polk wrote…

Is this fixing an unrelated bug?
(Same question for removing it above)

Kindof, more of a refactor. The old code produced basically the same result but in unnecessarily roundabout way - by replacing the iso639-3 codes with individual language codes and then checking again whether these replaced codes were macrolanguage codes, which will always come out false (except for possibly the few pathological cases which will need fixing up regardless.)


components/language-chooser/common/find-language/scripts/langtagProcessingHelpers.ts line 57 at r1 (raw file):

Previously, StephenMcConnel (Steve McConnel) wrote…

would a comment on how this differs from iso639_3 be helpful?

Done.

@andrew-polk andrew-polk requested a review from Copilot September 11, 2025 17:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @StephenMcConnel)

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk dismissed @StephenMcConnel from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nabalone)

@andrew-polk andrew-polk merged commit 4908554 into main Sep 11, 2025
2 checks passed
@andrew-polk andrew-polk deleted the BL-15209_autonyms_in_default_scripts branch September 11, 2025 17:24
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.

4 participants