@@ -13,17 +13,21 @@ export async function withIntl(
1313) : Promise < EmscriptenOptions > {
1414 const memoizedFetch = createMemoizedFetch ( fetch ) ;
1515
16+ /*
17+ * The Intl extension is hard-coded to look for the `icudt74l` filename,
18+ * which means the ICU data file must use that exact name.
19+ */
20+ const dataName = 'icudt74l.dat' ;
1621 const extensionName = 'intl.so' ;
17- const dataName = 'icu.dat' ;
1822
19- const extensionPath = await getIntlExtensionModule ( version ) ;
2023 // @ts -ignore
2124 const dataPath = ( await import ( '../../../../public/shared/icu.dat' ) )
2225 . default ;
26+ const extensionPath = await getIntlExtensionModule ( version ) ;
2327
24- const [ extension , ICUData ] = await Promise . all ( [
25- memoizedFetch ( extensionPath ) . then ( ( response ) => response . arrayBuffer ( ) ) ,
28+ const [ ICUData , extension ] = await Promise . all ( [
2629 memoizedFetch ( dataPath ) . then ( ( response ) => response . arrayBuffer ( ) ) ,
30+ memoizedFetch ( extensionPath ) . then ( ( response ) => response . arrayBuffer ( ) ) ,
2731 ] ) ;
2832
2933 return {
@@ -82,19 +86,16 @@ export async function withIntl(
8286 * via the ICU_DATA environment variable.
8387 * By default, this variable is set to '/internal/shared',
8488 * which corresponds to the actual file location.
85- *
86- * The Intl extension is hard-coded to look for the `icudt74l` filename,
87- * which means the ICU data file must use that exact name.
8889 */
8990 if (
9091 ! FSHelpers . fileExists (
9192 phpRuntime . FS ,
92- `${ phpRuntime . ENV . ICU_DATA } /icudt74l.dat `
93+ `${ phpRuntime . ENV . ICU_DATA } /${ dataName } `
9394 )
9495 ) {
9596 phpRuntime . FS . mkdirTree ( phpRuntime . ENV . ICU_DATA ) ;
9697 phpRuntime . FS . writeFile (
97- `${ phpRuntime . ENV . ICU_DATA } /icudt74l.dat ` ,
98+ `${ phpRuntime . ENV . ICU_DATA } /${ dataName } ` ,
9899 new Uint8Array ( ICUData )
99100 ) ;
100101 }
0 commit comments