File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
355355 < SettingsSectionIcon to = { item . to } />
356356 < span className = "min-w-0 flex-1" >
357357 < span className = "block truncate text-sm font-medium text-sidebar-foreground" >
358- { item . title }
358+ { m ( item . title ) }
359359 </ span >
360360 < span className = "block truncate text-2xs text-sidebar-muted-foreground/75" >
361361 { m ( SETTINGS_SECTION_LABELS [ item . to ] ) }
Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ export function nativeLanguageName(locale: string): string {
1515 return NATIVE_LANGUAGE_NAMES [ locale ] ?? locale ;
1616}
1717
18+ // Our `zh` is Simplified, so Traditional tags only match an exact locale.
19+ const TRADITIONAL_CHINESE = / ^ z h [ - _ ] ( h a n t | t w | h k | m o ) \b / ;
20+
1821function matchSupportedLocale ( tag : string ) : string | undefined {
1922 const normalized = tag . trim ( ) . toLowerCase ( ) ;
2023 const language = normalized . split ( / [ - _ ] / ) [ 0 ] ;
21- return (
22- SUPPORTED_LOCALES . find ( ( locale ) => locale . toLowerCase ( ) === normalized ) ??
23- SUPPORTED_LOCALES . find ( ( locale ) => locale . toLowerCase ( ) === language )
24- ) ;
24+ const exact = SUPPORTED_LOCALES . find ( ( locale ) => locale . toLowerCase ( ) === normalized ) ;
25+ if ( exact || TRADITIONAL_CHINESE . test ( normalized ) ) return exact ;
26+ return SUPPORTED_LOCALES . find ( ( locale ) => locale . toLowerCase ( ) === language ) ;
2527}
2628
2729/** Saved setting to active locale; "system" and unknown values follow the host's languages. */
Original file line number Diff line number Diff line change @@ -25,10 +25,11 @@ function loadLocale(locale: string): Promise<void> {
2525 if ( locale in loadedTranslations ) return Promise . resolve ( ) ;
2626 let load = pendingLoads . get ( locale ) ;
2727 if ( ! load ) {
28- // A failed load resolves without an entry, so the locale renders the English source .
28+ // A failed load resolves without an entry: English renders now and the next request retries .
2929 load = getTranslationsSnapshot ( locale ) . then ( ( loaded ) => {
30- loadedTranslations [ locale ] = loaded [ locale ] ?? { } ;
3130 pendingLoads . delete ( locale ) ;
31+ const translations = loaded [ locale ] ;
32+ if ( translations ) loadedTranslations [ locale ] = translations ;
3233 } ) ;
3334 pendingLoads . set ( locale , load ) ;
3435 }
You can’t perform that action at this time.
0 commit comments