@@ -78,22 +78,22 @@ export const countryLocaleVariants: Record<string, (LocaleObjectData & { country
7878 ],*/
7979}
8080
81- const locales : ( Omit < LocaleObjectData , 'code' > & { code : string } ) [ ] = [
81+ const locales : ( LocaleObjectData | ( Omit < LocaleObjectData , 'code' > & { code : string } ) ) [ ] = [
8282 {
8383 code : 'en' ,
8484 file : 'en.json' ,
8585 name : 'English' ,
8686 } ,
8787 {
88- code : 'ar-EG ' ,
88+ code : 'ar' ,
8989 file : 'ar.json' ,
9090 name : 'العربية' ,
9191 dir : 'rtl' ,
9292 pluralRule : ( choice : number ) => {
9393 const name = new Intl . PluralRules ( 'ar-EG' ) . select ( choice )
9494 return { zero : 0 , one : 1 , two : 2 , few : 3 , many : 4 , other : 5 } [ name ]
9595 } ,
96- } satisfies LocaleObjectData ,
96+ } ,
9797 /*{
9898 code: 'ckb',
9999 file: 'ckb.json',
@@ -103,7 +103,7 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
103103 const name = new Intl.PluralRules('ckb').select(choice)
104104 return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
105105 },
106- } satisfies LocaleObjectData ,
106+ },
107107 {
108108 code: 'fa-IR',
109109 file: 'fa-IR.json',
@@ -113,7 +113,7 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
113113 const name = new Intl.PluralRules('fa-IR').select(choice)
114114 return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
115115 },
116- } satisfies LocaleObjectData ,
116+ },
117117 {
118118 code: 'ca',
119119 file: 'ca.json',
@@ -177,7 +177,7 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
177177 const name = new Intl . PluralRules ( 'ru-RU' ) . select ( choice )
178178 return { zero : 2 , one : 0 , two : 1 , few : 1 , many : 2 , other : 3 } [ name ]
179179 } ,
180- } satisfies LocaleObjectData ,
180+ } ,
181181 /*{
182182 code: 'ru-RU',
183183 file: 'ru-RU.json',
@@ -278,6 +278,8 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
278278 },*/
279279]
280280
281+ const lunariaJSONFiles : Record < string , string > = { }
282+
281283function buildLocales ( ) {
282284 const useLocales = Object . values ( locales ) . reduce ( ( acc , data ) => {
283285 const locales = countryLocaleVariants [ data . code ]
@@ -289,10 +291,12 @@ function buildLocales() {
289291 name : l . name ,
290292 files : [ data . file as string , `${ l . code } .json` ] ,
291293 }
294+ lunariaJSONFiles [ l . code ] = l . country ? ( data . file as string ) : `${ l . code } .json`
292295 delete entry . file
293296 acc . push ( entry )
294297 } )
295298 } else {
299+ lunariaJSONFiles [ data . code ] = data . file as string
296300 acc . push ( data as LocaleObjectData )
297301 }
298302 return acc
@@ -303,6 +307,8 @@ function buildLocales() {
303307
304308export const currentLocales = buildLocales ( )
305309
310+ export { lunariaJSONFiles }
311+
306312export const datetimeFormats = Object . values ( currentLocales ) . reduce ( ( acc , data ) => {
307313 const dateTimeFormats = data . dateTimeFormats
308314 if ( dateTimeFormats ) {
0 commit comments