File tree 2 files changed +26
-11
lines changed
src/Components/Web.JS/src/Platform 2 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -83,5 +83,6 @@ export type ExtendedResourceList = {
83
83
export enum ICUDataMode {
84
84
Sharded ,
85
85
All ,
86
- Invariant
86
+ Invariant ,
87
+ Custom
87
88
}
Original file line number Diff line number Diff line change @@ -493,29 +493,43 @@ function attachInteropInvoker(): void {
493
493
}
494
494
495
495
function getICUResourceName ( bootConfig : BootJsonData , culture : string | undefined ) : string {
496
+ if ( bootConfig . icuDataMode === ICUDataMode . Custom ) {
497
+ const icuFiles = Object
498
+ . keys ( bootConfig . resources . runtime )
499
+ . filter ( n => n . startsWith ( 'icudt' ) && n . endsWith ( '.dat' ) ) ;
500
+ if ( icuFiles . length === 1 ) {
501
+ const customIcuFile = icuFiles [ 0 ] ;
502
+ return customIcuFile ;
503
+ }
504
+ }
505
+
496
506
const combinedICUResourceName = 'icudt.dat' ;
497
507
if ( ! culture || bootConfig . icuDataMode === ICUDataMode . All ) {
498
508
return combinedICUResourceName ;
499
509
}
500
510
501
511
const prefix = culture . split ( '-' ) [ 0 ] ;
502
- if ( [
503
- 'en' ,
504
- 'fr' ,
505
- 'it' ,
506
- 'de' ,
507
- 'es' ,
508
- ] . includes ( prefix ) ) {
512
+ if ( prefix === 'en' ||
513
+ [
514
+ 'fr' ,
515
+ 'fr-FR' ,
516
+ 'it' ,
517
+ 'it-IT' ,
518
+ 'de' ,
519
+ 'de-DE' ,
520
+ 'es' ,
521
+ 'es-ES' ,
522
+ ] . includes ( culture ) ) {
509
523
return 'icudt_EFIGS.dat' ;
510
- } else if ( [
524
+ }
525
+ if ( [
511
526
'zh' ,
512
527
'ko' ,
513
528
'ja' ,
514
529
] . includes ( prefix ) ) {
515
530
return 'icudt_CJK.dat' ;
516
- } else {
517
- return 'icudt_no_CJK.dat' ;
518
531
}
532
+ return 'icudt_no_CJK.dat' ;
519
533
}
520
534
521
535
function changeExtension ( filename : string , newExtensionWithLeadingDot : string ) {
You can’t perform that action at this time.
0 commit comments