Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/yummy-donkeys-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theoplayer/web-ui': patch
---

Language names in the language menu are now capitalized according to that language's case mappings.
4 changes: 3 additions & 1 deletion src/util/CommonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export const localizeLanguageName: (languageCode: string) => string | undefined
const displayNames = new Intl.DisplayNames([languageCode, 'en'], { type: 'language', fallback: 'none' });
const localName = displayNames.of(languageCode);
if (localName) {
return localName.slice(0, 1).toUpperCase() + localName.slice(1);
const locale = displayNames.resolvedOptions().locale;
const [first] = localName;
return first.toLocaleUpperCase(locale) + localName.slice(first.length);
}
}
: (_languageCode) => undefined;
Expand Down
Loading