Skip to content

Capitalize foreign language name clean#3633

Merged
alexfigtree merged 7 commits into
mainfrom
capitalize-foreign-language-name-clean
Jul 20, 2026
Merged

Capitalize foreign language name clean#3633
alexfigtree merged 7 commits into
mainfrom
capitalize-foreign-language-name-clean

Conversation

@alexfigtree

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

Fixes, closes https://github.com/mitodl/hq/issues/11648

Description (What does it do?)

Ensuring that first word for languages is capitalized, as per CTDL standards (see ticket).

How can this be tested?

  • Run new test added to dashboardViewModel.test.ts‎

alexfigtree and others added 5 commits July 17, 2026 10:51
Signed-off-by: Alex H <ahiguera@mit.edu>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 17, 2026 14:54
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Dashboard courseware variant labeling so that native language names are displayed with the first word capitalized (to align with CTDL/CLDR “standalone” casing expectations), and adjusts related frontend tests accordingly.

Changes:

  • Apply first-word capitalization to resolved native language names returned via Intl.DisplayNames (and resolved static fallbacks).
  • Track whether a language label is truly “resolved” vs a raw locale code, to avoid applying casing rules to unresolved codes.
  • Update/extend tests to assert the new casing behavior and to make label-matching assertions case-insensitive.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/VariantPicker.test.tsx Makes label assertions case-insensitive to accommodate capitalized language names.
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/model/dashboardViewModel.ts Implements first-word capitalization for resolved native language labels; preserves unresolved locale codes.
frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/model/dashboardViewModel.test.ts Adds/updates tests for capitalized language labels and first-word-only capitalization behavior.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@daniellefrappier18 daniellefrappier18 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great. 👍 For future PRs like this one, it can be really helpful to include a quick before/after screenshot (see below) — it gives reviewers immediate context on the visual change and makes it clear where to verify things.

BEFORE
Image

AFTER

Image

@alexfigtree
alexfigtree merged commit bc8d476 into main Jul 20, 2026
13 checks passed
@alexfigtree
alexfigtree deleted the capitalize-foreign-language-name-clean branch July 20, 2026 13:02
@odlbot odlbot mentioned this pull request Jul 20, 2026
12 tasks
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