From 78c7183a1fbcb70a9210b5fcd3c712016910f513 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 18 Jun 2024 23:57:40 +0200 Subject: [PATCH] fix: parentIntl detection --- scripts/generate-locales.ts | 6 ++--- src/locales/en_AU_ocker/date/index.ts | 14 ---------- src/locales/en_AU_ocker/date/month.ts | 34 ------------------------- src/locales/en_AU_ocker/date/weekday.ts | 16 ------------ src/locales/en_AU_ocker/index.ts | 2 -- 5 files changed, 3 insertions(+), 69 deletions(-) delete mode 100644 src/locales/en_AU_ocker/date/index.ts delete mode 100644 src/locales/en_AU_ocker/date/month.ts delete mode 100644 src/locales/en_AU_ocker/date/weekday.ts diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index f3838456fa8..ec8b2b0b521 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -411,10 +411,10 @@ async function generateDateModule(locale: string): Promise { const pathDate = resolve(pathLocales, locale, 'date'); const parentLocale = locale.substring(0, locale.lastIndexOf('_')) || 'base'; - const pathParentLocale = resolve(pathLocales, parentLocale); - const parentExists = await exists(pathParentLocale); const parentIntlLocale = parentLocale.replaceAll('_', '-'); - const parentUsable = isValidLocale(parentLocale) && parentExists; + const parentUsable = + isValidLocale(parentIntlLocale) && + (await exists(resolve(pathLocales, parentLocale))); // `src/locales//date/weekday.ts` async function generateWeekdayFile(): Promise { diff --git a/src/locales/en_AU_ocker/date/index.ts b/src/locales/en_AU_ocker/date/index.ts deleted file mode 100644 index a28ce823bb8..00000000000 --- a/src/locales/en_AU_ocker/date/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This file is automatically generated. - * Run 'pnpm run generate:locales' to update. - */ -import type { DateDefinition } from '../../..'; -import month from './month'; -import weekday from './weekday'; - -const date: DateDefinition = { - month, - weekday, -}; - -export default date; diff --git a/src/locales/en_AU_ocker/date/month.ts b/src/locales/en_AU_ocker/date/month.ts deleted file mode 100644 index 7c6cfa42231..00000000000 --- a/src/locales/en_AU_ocker/date/month.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is automatically generated. - * Run 'pnpm run generate:locales' to update. - */ -export default { - wide: [ - 'April', - 'August', - 'December', - 'February', - 'January', - 'July', - 'June', - 'March', - 'May', - 'November', - 'October', - 'September', - ], - abbr: [ - 'Apr', - 'Aug', - 'Dec', - 'Feb', - 'Jan', - 'July', - 'June', - 'Mar', - 'May', - 'Nov', - 'Oct', - 'Sept', - ], -}; diff --git a/src/locales/en_AU_ocker/date/weekday.ts b/src/locales/en_AU_ocker/date/weekday.ts deleted file mode 100644 index 90241047497..00000000000 --- a/src/locales/en_AU_ocker/date/weekday.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * This file is automatically generated. - * Run 'pnpm run generate:locales' to update. - */ -export default { - wide: [ - 'Friday', - 'Monday', - 'Saturday', - 'Sunday', - 'Thursday', - 'Tuesday', - 'Wednesday', - ], - abbr: ['Fri', 'Mon', 'Sat', 'Sun', 'Thu', 'Tue', 'Wed'], -}; diff --git a/src/locales/en_AU_ocker/index.ts b/src/locales/en_AU_ocker/index.ts index 2635f773781..6c406c508ce 100644 --- a/src/locales/en_AU_ocker/index.ts +++ b/src/locales/en_AU_ocker/index.ts @@ -4,7 +4,6 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; -import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -13,7 +12,6 @@ import phone_number from './phone_number'; const en_AU_ocker: LocaleDefinition = { company, - date, internet, location, metadata,