From 3097485c55d818be71464961193a79ea2094f108 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sat, 18 May 2024 23:13:10 +0900 Subject: [PATCH 01/20] test(date): create Intl based tests for date definitions --- test/modules/date.spec.ts | 102 ++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 36 deletions(-) diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index 811bd81bc99..ca781c35de6 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -1,5 +1,5 @@ -import { afterEach, describe, expect, it, vi } from 'vitest'; -import { FakerError, faker, fakerAZ } from '../../src'; +import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; +import { Faker, FakerError, allLocales, base, en, faker } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; @@ -448,26 +448,11 @@ describe('date', () => { expect(faker.definitions.date.month.wide).toContain(month); }); - it('should return random value from date.month.wide_context array for context option', () => { - // Use a locale which has a wide_context array - const month = fakerAZ.date.month({ context: true }); - expect(fakerAZ.definitions.date.month.wide_context).toContain(month); - }); - it('should return random value from date.month.abbr array for abbreviated option', () => { const month = faker.date.month({ abbreviated: true }); expect(faker.definitions.date.month.abbr).toContain(month); }); - it('should return random value from date.month.abbr_context array for abbreviated and context option', () => { - // Use a locale (e.g. az) which has a wide_context array - const month = fakerAZ.date.month({ - abbreviated: true, - context: true, - }); - expect(fakerAZ.definitions.date.month.abbr_context).toContain(month); - }); - it('should return random value from date.month.wide array for context option when date.month.wide_context array is missing', () => { // Use a locale (e.g. the default en) which has no wide_context array const month = faker.date.month({ context: true }); @@ -479,6 +464,38 @@ describe('date', () => { const month = faker.date.month({ abbreviated: true, context: true }); expect(faker.definitions.date.month.abbr).toContain(month); }); + + describe.each(Object.entries(allLocales))( + 'for locale %s', + (locale, fakerLocale) => { + let localizedFaker: Faker; + + beforeAll(() => { + localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); + }); + + it(`should return random value from date.month.wide_context array for context option in ${locale}`, () => { + if (localizedFaker.definitions.date.month.wide_context) { + const month = localizedFaker.date.month({ context: true }); + expect( + localizedFaker.definitions.date.month.wide_context + ).toContain(month); + } + }); + + it(`should return random value from date.month.abbr_context array for abbreviated and context option in ${locale}`, () => { + if (localizedFaker.definitions.date.month.abbr_context) { + const month = localizedFaker.date.month({ + abbreviated: true, + context: true, + }); + expect( + localizedFaker.definitions.date.month.abbr_context + ).toContain(month); + } + }); + } + ); }); describe('weekday()', () => { @@ -487,30 +504,11 @@ describe('date', () => { expect(faker.definitions.date.weekday.wide).toContain(weekday); }); - it('should return random value from date.weekday.wide_context array for context option', () => { - // Use a locale (e.g. az) which has a wide_context array - const weekday = fakerAZ.date.weekday({ context: true }); - expect(fakerAZ.definitions.date.weekday.wide_context).toContain( - weekday - ); - }); - it('should return random value from date.weekday.abbr array for abbreviated option', () => { const weekday = faker.date.weekday({ abbreviated: true }); expect(faker.definitions.date.weekday.abbr).toContain(weekday); }); - it('should return random value from date.weekday.abbr_context array for abbreviated and context option', () => { - // Use a locale (e.g. az) which has a abbr_context array - const weekday = fakerAZ.date.weekday({ - abbreviated: true, - context: true, - }); - expect(fakerAZ.definitions.date.weekday.abbr_context).toContain( - weekday - ); - }); - it('should return random value from date.weekday.wide array for context option when date.weekday.wide_context array is missing', () => { // Use a locale (e.g. the default en) which has no wide_context array const weekday = faker.date.weekday({ context: true }); @@ -525,6 +523,38 @@ describe('date', () => { }); expect(faker.definitions.date.weekday.abbr).toContain(weekday); }); + + describe.each(Object.entries(allLocales))( + 'for locale %s', + (locale, fakerLocale) => { + let localizedFaker: Faker; + + beforeAll(() => { + localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); + }); + + it(`should return random value from date.weekday.wide_context array for context option in ${locale}`, () => { + if (localizedFaker.definitions.date.month.wide_context) { + const weekday = localizedFaker.date.weekday({ context: true }); + expect( + localizedFaker.definitions.date.weekday.wide_context + ).toContain(weekday); + } + }); + + it(`should return random value from date.weekday.abbr_context array for abbreviated and context option in ${locale}`, () => { + if (localizedFaker.definitions.date.month.abbr_context) { + const weekday = localizedFaker.date.weekday({ + abbreviated: true, + context: true, + }); + expect( + localizedFaker.definitions.date.weekday.abbr_context + ).toContain(weekday); + } + }); + } + ); }); describe('birthdate', () => { From 4d3055f48d18a5f2ccbb8edec5afcd2b173fc8ce Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 04:20:47 +0900 Subject: [PATCH 02/20] test: create Intl based test for date definition --- test/modules/date.spec.ts | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index ca781c35de6..f26d681c0d7 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-restricted-globals */ import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; import { Faker, FakerError, allLocales, base, en, faker } from '../../src'; import { seededTests } from '../support/seeded-runs'; @@ -468,7 +469,12 @@ describe('date', () => { describe.each(Object.entries(allLocales))( 'for locale %s', (locale, fakerLocale) => { + if (locale.length > 2) return; let localizedFaker: Faker; + const months = Array.from( + { length: 12 }, + (_, i) => new Date(2020, i, 1) + ); beforeAll(() => { localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); @@ -494,6 +500,28 @@ describe('date', () => { ).toContain(month); } }); + + it('should use Intl.DateTimeFormat to get the month name in the correct locale', () => { + for (const date of months) { + const intlMonth = new Intl.DateTimeFormat(locale, { + month: 'long', + }).format(date); + expect(localizedFaker.definitions.date.month.wide).toContain( + intlMonth + ); + } + }); + + it('should use Intl.DateTimeFormat to get the abbreviated month name in the correct locale', () => { + for (const date of months) { + const intlMonth = new Intl.DateTimeFormat(locale, { + month: 'short', + }).format(date); + expect(localizedFaker.definitions.date.month.abbr).toContain( + intlMonth + ); + } + }); } ); }); @@ -527,7 +555,12 @@ describe('date', () => { describe.each(Object.entries(allLocales))( 'for locale %s', (locale, fakerLocale) => { + if (locale.length > 2) return; let localizedFaker: Faker; + const weekdays = Array.from( + { length: 7 }, + (_, i) => new Date(2020, 0, i + 4) + ); // January 4-10, 2020 are Sunday to Saturday beforeAll(() => { localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); @@ -553,6 +586,28 @@ describe('date', () => { ).toContain(weekday); } }); + + it('should use Intl.DateTimeFormat to get the weekday name in the correct locale', () => { + for (const date of weekdays) { + const intlWeekday = new Intl.DateTimeFormat(locale, { + weekday: 'long', + }).format(date); + expect(localizedFaker.definitions.date.weekday.wide).toContain( + intlWeekday + ); + } + }); + + it('should use Intl.DateTimeFormat to get the abbreviated weekday name in the correct locale', () => { + for (const date of weekdays) { + const intlWeekday = new Intl.DateTimeFormat(locale, { + weekday: 'short', + }).format(date); + expect(localizedFaker.definitions.date.weekday.abbr).toContain( + intlWeekday + ); + } + }); } ); }); From fe8ce704ee263b9cbc45a24df5d9c40bba00f594 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 09:56:43 +0900 Subject: [PATCH 03/20] test : add condition filtering valid Itnl locales --- test/modules/date.spec.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index f26d681c0d7..20aa0ac0c49 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -10,6 +10,15 @@ const converterMap = [ (d: Date) => d.valueOf(), ]; +const validIntlLocales = Object.entries(allLocales).filter(([locale]) => { + try { + new Intl.DateTimeFormat(locale); + return true; + } catch { + return false; + } +}); + const NON_SEEDED_BASED_RUN = 5; const refDate = '2021-02-21T17:09:15.711Z'; @@ -466,10 +475,9 @@ describe('date', () => { expect(faker.definitions.date.month.abbr).toContain(month); }); - describe.each(Object.entries(allLocales))( + describe.each(validIntlLocales)( 'for locale %s', (locale, fakerLocale) => { - if (locale.length > 2) return; let localizedFaker: Faker; const months = Array.from( { length: 12 }, @@ -552,10 +560,9 @@ describe('date', () => { expect(faker.definitions.date.weekday.abbr).toContain(weekday); }); - describe.each(Object.entries(allLocales))( + describe.each(validIntlLocales)( 'for locale %s', (locale, fakerLocale) => { - if (locale.length > 2) return; let localizedFaker: Faker; const weekdays = Array.from( { length: 7 }, From fa73f0a8119848f13a76a517491b45b21b8ddc7d Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 10:05:33 +0900 Subject: [PATCH 04/20] chore : add generate:date command --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a68ad21a1ca..593041980e0 100644 --- a/package.json +++ b/package.json @@ -65,9 +65,10 @@ "build:code": "tsup-node", "build:types": "tsc --project tsconfig.build.json", "build": "run-s build:clean build:code build:types", - "generate": "run-s generate:locales generate:api-docs", + "generate": "run-s generate:locales generate:api-docs generate:date", "generate:api-docs": "tsx ./scripts/apidocs.ts", "generate:locales": "tsx ./scripts/generate-locales.ts", + "generate:date": "tsx ./scripts/generate-date-for-locale.ts", "docs:build": "run-s generate:api-docs docs:build:run", "docs:build:run": "vitepress build docs", "docs:build:ci": "run-s build docs:build", From efb206fb6c591764fe12528406a053ee7d81c91d Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 10:08:18 +0900 Subject: [PATCH 05/20] feat: auto generate/update date files --- scripts/generate-date-for-locale.ts | 212 ++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 scripts/generate-date-for-locale.ts diff --git a/scripts/generate-date-for-locale.ts b/scripts/generate-date-for-locale.ts new file mode 100644 index 00000000000..392b50db154 --- /dev/null +++ b/scripts/generate-date-for-locale.ts @@ -0,0 +1,212 @@ +/* eslint-disable no-restricted-globals */ + +import { constants } from 'node:fs'; +import { + access, + mkdir, + readFile, + readdir, + stat, + writeFile, +} from 'node:fs/promises'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { formatTypescript } from './apidocs/utils/format'; + +// Constants +const pathRoot: string = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const pathLocales: string = resolve(pathRoot, 'src', 'locales'); + +const scriptCommand = 'pnpm run generate:date'; +const autoGeneratedCommentHeader = `/* + * This file is automatically generated. + * Run '${scriptCommand}' to update. + */`; + +// Function to check if a locale is valid +function isValidLocale(locale: string): boolean { + try { + new Intl.DateTimeFormat(locale); + return true; + } catch { + return false; + } +} + +// Function to update weekday values for a given locale +async function updateWeekdaysForLocale(locale: string): Promise { + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); + const weekdayPath: string = resolve(dateFolderPath, 'weekday.ts'); + + // Check if the weekday.ts file exists, if not create it + try { + await access(weekdayPath, constants.R_OK); + } catch { + console.log(`Creating weekday.ts file for locale ${locale}.`); + const defaultWeekdayContent = `export default { "wide": [], "abbr": [] };`; + await writeFile(weekdayPath, await formatTypescript(defaultWeekdayContent)); + } + + // Read the current weekday values + const fileContent: string = await readFile(weekdayPath, 'utf8'); + + // Remove 'export default ' and convert to object + const objectString: string = fileContent + .replace(/export\s+default\s+/, '') + .trim() + .replace(/;$/, ''); + let storedWeekdays: { wide: string[]; abbr: string[] }; + try { + storedWeekdays = eval(`(${objectString})`); + } catch (error) { + console.error(`Failed to parse JSON for locale ${locale}:`, error); + return; + } + + // Generate correct weekday values + const validLocale: string = isValidLocale(locale) ? locale : 'en'; + const wide: string[] = []; + const abbr: string[] = []; + for (let i = 0; i < 7; i++) { + const date: Date = new Date(1970, 0, i + 4); // 1970-01-04 is a Sunday + wide.push( + new Intl.DateTimeFormat(validLocale, { weekday: 'long' }).format(date) + ); + abbr.push( + new Intl.DateTimeFormat(validLocale, { weekday: 'short' }).format(date) + ); + } + + // Update stored weekdays + storedWeekdays.wide = wide; + storedWeekdays.abbr = abbr; + + // Write updated values back to the file + const updatedContent = `${autoGeneratedCommentHeader} +export default ${JSON.stringify(storedWeekdays, null, 2)};`; + await writeFile(weekdayPath, await formatTypescript(updatedContent)); +} + +// Function to update month values for a given locale +async function updateMonthForLocale(locale: string): Promise { + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); + const monthPath: string = resolve(dateFolderPath, 'month.ts'); + + // Check if the month.ts file exists, if not create it + try { + await access(monthPath, constants.R_OK); + } catch { + console.log(`Creating month.ts file for locale ${locale}.`); + const defaultMonthContent = `export default { "wide": [], "abbr": [] };`; + await writeFile(monthPath, await formatTypescript(defaultMonthContent)); + } + + // Read the current month values + const fileContent: string = await readFile(monthPath, 'utf8'); + + // Remove 'export default ' and convert to object + const objectString: string = fileContent + .replace(/export\s+default\s+/, '') + .trim() + .replace(/;$/, ''); + let storedMonths: { wide: string[]; abbr: string[] }; + try { + storedMonths = eval(`(${objectString})`); + } catch (error) { + console.error(`Failed to parse JSON for locale ${locale}:`, error); + return; + } + + // Generate correct month values + const validLocale: string = isValidLocale(locale) ? locale : 'en'; + const wide: string[] = []; + const abbr: string[] = []; + for (let i = 0; i < 12; i++) { + const date: Date = new Date(1970, i, 1); + wide.push( + new Intl.DateTimeFormat(validLocale, { month: 'long' }).format(date) + ); + abbr.push( + new Intl.DateTimeFormat(validLocale, { month: 'short' }).format(date) + ); + } + + // Update stored months + storedMonths.wide = wide; + storedMonths.abbr = abbr; + + // Write updated values back to the file + const updatedContent = `${autoGeneratedCommentHeader} + export default ${JSON.stringify(storedMonths, null, 2)};`; + await writeFile(monthPath, await formatTypescript(updatedContent)); +} + +// Function to create date folder and index.ts file if not exists +async function createDateFolderAndIndex(locale: string): Promise { + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); + const dateIndexPath: string = resolve(dateFolderPath, 'index.ts'); + const localeIndexPath: string = resolve(pathLocales, locale, 'index.ts'); + + // Check if the date folder exists, if not create it + try { + await access(dateFolderPath, constants.R_OK); + } catch { + console.log(`Creating date folder for locale ${locale}.`); + } finally { + await mkdir(dateFolderPath, { recursive: true }); + + // Create a new index.ts file for the date module + const dateIndexContent = ` + ${autoGeneratedCommentHeader} + import type { DateDefinition } from '../../..'; + import month from './month'; + import weekday from './weekday'; + + const date: DateDefinition = { + month, + weekday, + }; + + export default date; + `; + await writeFile(dateIndexPath, await formatTypescript(dateIndexContent)); + } + + // Update the locale index file to include date + let localeIndexContent: string = await readFile(localeIndexPath, 'utf8'); + if (!localeIndexContent.includes("import date from './date';")) { + localeIndexContent = localeIndexContent.replace( + "import type { LocaleDefinition } from '../..';", + "import type { LocaleDefinition } from '../..';\nimport date from './date';" + ); + localeIndexContent = localeIndexContent.replace( + /(const \w+: LocaleDefinition = {)/, + `$1\n date,` + ); + await writeFile( + localeIndexPath, + await formatTypescript(localeIndexContent) + ); + } +} + +// Main function to update all locales +async function updateAllLocales(): Promise { + const locales: string[] = await readdir(pathLocales); + + for (const locale of locales) { + const localePath: string = resolve(pathLocales, locale); + const localeStat = await stat(localePath); + + if (localeStat.isDirectory()) { + await createDateFolderAndIndex(locale); + await updateMonthForLocale(locale); + await updateWeekdaysForLocale(locale); + } else { + console.log(`Skipping ${locale} as it is not a directory.`); + } + } +} + +// Run the script to update weekdays for all locales +await updateAllLocales(); From 49f08f6d2bd8115051a92ee2309fedf3368d0478 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 10:20:36 +0900 Subject: [PATCH 06/20] fix : Add condition that exception case 'vd' --- scripts/generate-date-for-locale.ts | 4 ++++ test/modules/date.spec.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/scripts/generate-date-for-locale.ts b/scripts/generate-date-for-locale.ts index 392b50db154..3244877f35d 100644 --- a/scripts/generate-date-for-locale.ts +++ b/scripts/generate-date-for-locale.ts @@ -35,6 +35,8 @@ function isValidLocale(locale: string): boolean { // Function to update weekday values for a given locale async function updateWeekdaysForLocale(locale: string): Promise { + if (locale === 'dv') return; + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); const weekdayPath: string = resolve(dateFolderPath, 'weekday.ts'); @@ -89,6 +91,8 @@ export default ${JSON.stringify(storedWeekdays, null, 2)};`; // Function to update month values for a given locale async function updateMonthForLocale(locale: string): Promise { + if (locale === 'dv') return; + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); const monthPath: string = resolve(dateFolderPath, 'month.ts'); diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index 20aa0ac0c49..eeb6d7c2c31 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -11,6 +11,7 @@ const converterMap = [ ]; const validIntlLocales = Object.entries(allLocales).filter(([locale]) => { + if (locale === 'dv') return false; try { new Intl.DateTimeFormat(locale); return true; From 9a07a19294f6d5756ab06a89e490daa0903909a2 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 20:10:34 +0900 Subject: [PATCH 07/20] test : restore existing test and remove month, weekday test about countext option in locale --- test/modules/date.spec.ts | 86 +++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index eeb6d7c2c31..3d65e3986a5 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -1,6 +1,14 @@ /* eslint-disable no-restricted-globals */ import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; -import { Faker, FakerError, allLocales, base, en, faker } from '../../src'; +import { + Faker, + FakerError, + allLocales, + base, + en, + faker, + fakerAZ, +} from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; @@ -459,11 +467,26 @@ describe('date', () => { expect(faker.definitions.date.month.wide).toContain(month); }); + it('should return random value from date.month.wide_context array for context option', () => { + // Use a locale which has a wide_context array + const month = fakerAZ.date.month({ context: true }); + expect(fakerAZ.definitions.date.month.wide_context).toContain(month); + }); + it('should return random value from date.month.abbr array for abbreviated option', () => { const month = faker.date.month({ abbreviated: true }); expect(faker.definitions.date.month.abbr).toContain(month); }); + it('should return random value from date.month.abbr_context array for abbreviated and context option', () => { + // Use a locale (e.g. az) which has a wide_context array + const month = fakerAZ.date.month({ + abbreviated: true, + context: true, + }); + expect(fakerAZ.definitions.date.month.abbr_context).toContain(month); + }); + it('should return random value from date.month.wide array for context option when date.month.wide_context array is missing', () => { // Use a locale (e.g. the default en) which has no wide_context array const month = faker.date.month({ context: true }); @@ -489,27 +512,6 @@ describe('date', () => { localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); }); - it(`should return random value from date.month.wide_context array for context option in ${locale}`, () => { - if (localizedFaker.definitions.date.month.wide_context) { - const month = localizedFaker.date.month({ context: true }); - expect( - localizedFaker.definitions.date.month.wide_context - ).toContain(month); - } - }); - - it(`should return random value from date.month.abbr_context array for abbreviated and context option in ${locale}`, () => { - if (localizedFaker.definitions.date.month.abbr_context) { - const month = localizedFaker.date.month({ - abbreviated: true, - context: true, - }); - expect( - localizedFaker.definitions.date.month.abbr_context - ).toContain(month); - } - }); - it('should use Intl.DateTimeFormat to get the month name in the correct locale', () => { for (const date of months) { const intlMonth = new Intl.DateTimeFormat(locale, { @@ -541,11 +543,30 @@ describe('date', () => { expect(faker.definitions.date.weekday.wide).toContain(weekday); }); + it('should return random value from date.weekday.wide_context array for context option', () => { + // Use a locale (e.g. az) which has a wide_context array + const weekday = fakerAZ.date.weekday({ context: true }); + expect(fakerAZ.definitions.date.weekday.wide_context).toContain( + weekday + ); + }); + it('should return random value from date.weekday.abbr array for abbreviated option', () => { const weekday = faker.date.weekday({ abbreviated: true }); expect(faker.definitions.date.weekday.abbr).toContain(weekday); }); + it('should return random value from date.weekday.abbr_context array for abbreviated and context option', () => { + // Use a locale (e.g. az) which has a abbr_context array + const weekday = fakerAZ.date.weekday({ + abbreviated: true, + context: true, + }); + expect(fakerAZ.definitions.date.weekday.abbr_context).toContain( + weekday + ); + }); + it('should return random value from date.weekday.wide array for context option when date.weekday.wide_context array is missing', () => { // Use a locale (e.g. the default en) which has no wide_context array const weekday = faker.date.weekday({ context: true }); @@ -574,27 +595,6 @@ describe('date', () => { localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); }); - it(`should return random value from date.weekday.wide_context array for context option in ${locale}`, () => { - if (localizedFaker.definitions.date.month.wide_context) { - const weekday = localizedFaker.date.weekday({ context: true }); - expect( - localizedFaker.definitions.date.weekday.wide_context - ).toContain(weekday); - } - }); - - it(`should return random value from date.weekday.abbr_context array for abbreviated and context option in ${locale}`, () => { - if (localizedFaker.definitions.date.month.abbr_context) { - const weekday = localizedFaker.date.weekday({ - abbreviated: true, - context: true, - }); - expect( - localizedFaker.definitions.date.weekday.abbr_context - ).toContain(weekday); - } - }); - it('should use Intl.DateTimeFormat to get the weekday name in the correct locale', () => { for (const date of weekdays) { const intlWeekday = new Intl.DateTimeFormat(locale, { From 5005fcba04b0704507238ac65097c36c5e46fa5d Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 20:29:39 +0900 Subject: [PATCH 08/20] test : Refactoring to locale data instead of using a new Faker instance --- test/modules/date.spec.ts | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index 3d65e3986a5..5c2f596a87e 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -1,14 +1,6 @@ /* eslint-disable no-restricted-globals */ -import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; -import { - Faker, - FakerError, - allLocales, - base, - en, - faker, - fakerAZ, -} from '../../src'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { FakerError, allFakers, faker, fakerAZ } from '../../src'; import { seededTests } from '../support/seeded-runs'; import { times } from './../support/times'; @@ -18,7 +10,7 @@ const converterMap = [ (d: Date) => d.valueOf(), ]; -const validIntlLocales = Object.entries(allLocales).filter(([locale]) => { +const validIntlLocales = Object.entries(allFakers).filter(([locale]) => { if (locale === 'dv') return false; try { new Intl.DateTimeFormat(locale); @@ -501,17 +493,12 @@ describe('date', () => { describe.each(validIntlLocales)( 'for locale %s', - (locale, fakerLocale) => { - let localizedFaker: Faker; + (locale, localizedFaker) => { const months = Array.from( { length: 12 }, (_, i) => new Date(2020, i, 1) ); - beforeAll(() => { - localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); - }); - it('should use Intl.DateTimeFormat to get the month name in the correct locale', () => { for (const date of months) { const intlMonth = new Intl.DateTimeFormat(locale, { @@ -584,17 +571,12 @@ describe('date', () => { describe.each(validIntlLocales)( 'for locale %s', - (locale, fakerLocale) => { - let localizedFaker: Faker; + (locale, localizedFaker) => { const weekdays = Array.from( { length: 7 }, (_, i) => new Date(2020, 0, i + 4) ); // January 4-10, 2020 are Sunday to Saturday - beforeAll(() => { - localizedFaker = new Faker({ locale: [fakerLocale, en, base] }); - }); - it('should use Intl.DateTimeFormat to get the weekday name in the correct locale', () => { for (const date of weekdays) { const intlWeekday = new Intl.DateTimeFormat(locale, { From 80ee22a4149d05b3449f5e7d63134bd6ef3a62d1 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 22:27:35 +0900 Subject: [PATCH 09/20] refactor : integrate function that update month, weekDay locale data to generate-locales --- scripts/generate-date-for-locale.ts | 216 ---------------------------- scripts/generate-locales.ts | 164 +++++++++++++++++---- 2 files changed, 140 insertions(+), 240 deletions(-) delete mode 100644 scripts/generate-date-for-locale.ts diff --git a/scripts/generate-date-for-locale.ts b/scripts/generate-date-for-locale.ts deleted file mode 100644 index 3244877f35d..00000000000 --- a/scripts/generate-date-for-locale.ts +++ /dev/null @@ -1,216 +0,0 @@ -/* eslint-disable no-restricted-globals */ - -import { constants } from 'node:fs'; -import { - access, - mkdir, - readFile, - readdir, - stat, - writeFile, -} from 'node:fs/promises'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { formatTypescript } from './apidocs/utils/format'; - -// Constants -const pathRoot: string = resolve(dirname(fileURLToPath(import.meta.url)), '..'); -const pathLocales: string = resolve(pathRoot, 'src', 'locales'); - -const scriptCommand = 'pnpm run generate:date'; -const autoGeneratedCommentHeader = `/* - * This file is automatically generated. - * Run '${scriptCommand}' to update. - */`; - -// Function to check if a locale is valid -function isValidLocale(locale: string): boolean { - try { - new Intl.DateTimeFormat(locale); - return true; - } catch { - return false; - } -} - -// Function to update weekday values for a given locale -async function updateWeekdaysForLocale(locale: string): Promise { - if (locale === 'dv') return; - - const dateFolderPath: string = resolve(pathLocales, locale, 'date'); - const weekdayPath: string = resolve(dateFolderPath, 'weekday.ts'); - - // Check if the weekday.ts file exists, if not create it - try { - await access(weekdayPath, constants.R_OK); - } catch { - console.log(`Creating weekday.ts file for locale ${locale}.`); - const defaultWeekdayContent = `export default { "wide": [], "abbr": [] };`; - await writeFile(weekdayPath, await formatTypescript(defaultWeekdayContent)); - } - - // Read the current weekday values - const fileContent: string = await readFile(weekdayPath, 'utf8'); - - // Remove 'export default ' and convert to object - const objectString: string = fileContent - .replace(/export\s+default\s+/, '') - .trim() - .replace(/;$/, ''); - let storedWeekdays: { wide: string[]; abbr: string[] }; - try { - storedWeekdays = eval(`(${objectString})`); - } catch (error) { - console.error(`Failed to parse JSON for locale ${locale}:`, error); - return; - } - - // Generate correct weekday values - const validLocale: string = isValidLocale(locale) ? locale : 'en'; - const wide: string[] = []; - const abbr: string[] = []; - for (let i = 0; i < 7; i++) { - const date: Date = new Date(1970, 0, i + 4); // 1970-01-04 is a Sunday - wide.push( - new Intl.DateTimeFormat(validLocale, { weekday: 'long' }).format(date) - ); - abbr.push( - new Intl.DateTimeFormat(validLocale, { weekday: 'short' }).format(date) - ); - } - - // Update stored weekdays - storedWeekdays.wide = wide; - storedWeekdays.abbr = abbr; - - // Write updated values back to the file - const updatedContent = `${autoGeneratedCommentHeader} -export default ${JSON.stringify(storedWeekdays, null, 2)};`; - await writeFile(weekdayPath, await formatTypescript(updatedContent)); -} - -// Function to update month values for a given locale -async function updateMonthForLocale(locale: string): Promise { - if (locale === 'dv') return; - - const dateFolderPath: string = resolve(pathLocales, locale, 'date'); - const monthPath: string = resolve(dateFolderPath, 'month.ts'); - - // Check if the month.ts file exists, if not create it - try { - await access(monthPath, constants.R_OK); - } catch { - console.log(`Creating month.ts file for locale ${locale}.`); - const defaultMonthContent = `export default { "wide": [], "abbr": [] };`; - await writeFile(monthPath, await formatTypescript(defaultMonthContent)); - } - - // Read the current month values - const fileContent: string = await readFile(monthPath, 'utf8'); - - // Remove 'export default ' and convert to object - const objectString: string = fileContent - .replace(/export\s+default\s+/, '') - .trim() - .replace(/;$/, ''); - let storedMonths: { wide: string[]; abbr: string[] }; - try { - storedMonths = eval(`(${objectString})`); - } catch (error) { - console.error(`Failed to parse JSON for locale ${locale}:`, error); - return; - } - - // Generate correct month values - const validLocale: string = isValidLocale(locale) ? locale : 'en'; - const wide: string[] = []; - const abbr: string[] = []; - for (let i = 0; i < 12; i++) { - const date: Date = new Date(1970, i, 1); - wide.push( - new Intl.DateTimeFormat(validLocale, { month: 'long' }).format(date) - ); - abbr.push( - new Intl.DateTimeFormat(validLocale, { month: 'short' }).format(date) - ); - } - - // Update stored months - storedMonths.wide = wide; - storedMonths.abbr = abbr; - - // Write updated values back to the file - const updatedContent = `${autoGeneratedCommentHeader} - export default ${JSON.stringify(storedMonths, null, 2)};`; - await writeFile(monthPath, await formatTypescript(updatedContent)); -} - -// Function to create date folder and index.ts file if not exists -async function createDateFolderAndIndex(locale: string): Promise { - const dateFolderPath: string = resolve(pathLocales, locale, 'date'); - const dateIndexPath: string = resolve(dateFolderPath, 'index.ts'); - const localeIndexPath: string = resolve(pathLocales, locale, 'index.ts'); - - // Check if the date folder exists, if not create it - try { - await access(dateFolderPath, constants.R_OK); - } catch { - console.log(`Creating date folder for locale ${locale}.`); - } finally { - await mkdir(dateFolderPath, { recursive: true }); - - // Create a new index.ts file for the date module - const dateIndexContent = ` - ${autoGeneratedCommentHeader} - import type { DateDefinition } from '../../..'; - import month from './month'; - import weekday from './weekday'; - - const date: DateDefinition = { - month, - weekday, - }; - - export default date; - `; - await writeFile(dateIndexPath, await formatTypescript(dateIndexContent)); - } - - // Update the locale index file to include date - let localeIndexContent: string = await readFile(localeIndexPath, 'utf8'); - if (!localeIndexContent.includes("import date from './date';")) { - localeIndexContent = localeIndexContent.replace( - "import type { LocaleDefinition } from '../..';", - "import type { LocaleDefinition } from '../..';\nimport date from './date';" - ); - localeIndexContent = localeIndexContent.replace( - /(const \w+: LocaleDefinition = {)/, - `$1\n date,` - ); - await writeFile( - localeIndexPath, - await formatTypescript(localeIndexContent) - ); - } -} - -// Main function to update all locales -async function updateAllLocales(): Promise { - const locales: string[] = await readdir(pathLocales); - - for (const locale of locales) { - const localePath: string = resolve(pathLocales, locale); - const localeStat = await stat(localePath); - - if (localeStat.isDirectory()) { - await createDateFolderAndIndex(locale); - await updateMonthForLocale(locale); - await updateWeekdaysForLocale(locale); - } else { - console.log(`Skipping ${locale} as it is not a directory.`); - } - } -} - -// Run the script to update weekdays for all locales -await updateAllLocales(); diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 41b2e108e1f..5c14f75aa72 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -4,6 +4,8 @@ * This file contains a script that can be used to update the following files: * * - `src/locale/.ts` + * - `src/locales//date/month.ts` + * - `src/locales//date/weekDay.ts` * - `src/locales//index.ts` * - `src/locales///index.ts` * - `src/docs/guide/localization.md` @@ -14,6 +16,7 @@ * * Run this script using `pnpm run generate:locales` */ + import { constants } from 'node:fs'; import { access, readFile, readdir, stat, writeFile } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; @@ -111,6 +114,135 @@ function escapeField(parent: string, module: string): string { return module; } +function isValidLocale(locale: string): boolean { + if (locale === 'dv') return false; + try { + // eslint-disable-next-line no-restricted-globals + new Intl.DateTimeFormat(locale); + return true; + } catch { + return false; + } +} + +function normalizeDataRecursive(localeData: T): T { + if (typeof localeData !== 'object' || localeData === null) { + // we can only traverse object-like structs + return localeData; + } + + if (Array.isArray(localeData)) { + return ( + [...new Set(localeData)] + // limit entries to 1k + .slice(0, 1000) + // sort entries alphabetically + .sort() as T + ); + } + + const result = {} as T; + for (const key of keys(localeData)) { + result[key] = normalizeDataRecursive(localeData[key]); + } + + return result; +} + +// Function to update weekday values for a given locale +async function updateWeekdaysForLocale(locale: string): Promise { + if (!isValidLocale(locale)) return; + + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); + const weekdayPath: string = resolve(dateFolderPath, 'weekday.ts'); + + // Initialize stored weekdays + let storedWeekdays: { wide: string[]; abbr: string[] } = { + wide: [], + abbr: [], + }; + + // Import the current weekday values + try { + const imported = await import(`file:${weekdayPath}`); + storedWeekdays = imported.default; + } catch { + console.log(`Creating weekday.ts file for locale ${locale}.`); + } + + // Generate correct weekday values + const wide: string[] = []; + const abbr: string[] = []; + // eslint-disable-next-line no-restricted-globals + const intlWeekdayLong = new Intl.DateTimeFormat(locale, { weekday: 'long' }); + // eslint-disable-next-line no-restricted-globals + const intlWeekdayShort = new Intl.DateTimeFormat(locale, { + weekday: 'short', + }); + for (let i = 0; i < 7; i++) { + const date: Date = new Date(2020, 0, i + 4); + // January 4-10, 2020 are Sunday to Saturday + wide.push(intlWeekdayLong.format(date)); + abbr.push(intlWeekdayShort.format(date)); + } + + // Update stored weekdays + storedWeekdays.wide = wide; + storedWeekdays.abbr = abbr; + + // Normalize stored weekdays before saving + const normalizedWeekdays = normalizeDataRecursive(storedWeekdays); + + // Write updated values back to the file + const updatedContent = `${autoGeneratedCommentHeader} +export default ${JSON.stringify(normalizedWeekdays, null, 2)};`; + await writeFile(weekdayPath, await formatTypescript(updatedContent)); +} + +// Function to update month values for a given locale +async function updateMonthForLocale(locale: string): Promise { + if (!isValidLocale(locale)) return; + + const dateFolderPath: string = resolve(pathLocales, locale, 'date'); + const monthPath: string = resolve(dateFolderPath, 'month.ts'); + + // Initialize stored months + let storedMonths: { wide: string[]; abbr: string[] } = { wide: [], abbr: [] }; + + // Import the current month values + try { + const imported = await import(`file:${monthPath}`); + storedMonths = imported.default; + } catch { + console.log(`Creating month.ts file for locale ${locale}.`); + } + + // Generate correct month values + const wide: string[] = []; + const abbr: string[] = []; + // eslint-disable-next-line no-restricted-globals + const intlMonthLong = new Intl.DateTimeFormat(locale, { month: 'long' }); + // eslint-disable-next-line no-restricted-globals + const intlMonthShort = new Intl.DateTimeFormat(locale, { month: 'short' }); + for (let i = 0; i < 12; i++) { + const date: Date = new Date(2020, i, 1); + wide.push(intlMonthLong.format(date)); + abbr.push(intlMonthShort.format(date)); + } + + // Update stored months + storedMonths.wide = wide; + storedMonths.abbr = abbr; + + // Normalize stored months before saving + const normalizedMonths = normalizeDataRecursive(storedMonths); + + // Write updated values back to the file + const updatedContent = `${autoGeneratedCommentHeader} +export default ${JSON.stringify(normalizedMonths, null, 2)};`; + await writeFile(monthPath, await formatTypescript(updatedContent)); +} + async function generateLocaleFile(locale: string): Promise { const parts = locale.split('_'); const locales = [locale]; @@ -286,30 +418,6 @@ async function updateLocaleFileHook( * @param definitionKey The definition key of the current file (ex. 'location'). */ async function normalizeLocaleFile(filePath: string, definitionKey: string) { - function normalizeDataRecursive(localeData: T): T { - if (typeof localeData !== 'object' || localeData === null) { - // we can only traverse object-like structs - return localeData; - } - - if (Array.isArray(localeData)) { - return ( - [...new Set(localeData)] - // limit entries to 1k - .slice(0, 1000) - // sort entries alphabetically - .sort() as T - ); - } - - const result = {} as T; - for (const key of keys(localeData)) { - result[key] = normalizeDataRecursive(localeData[key]); - } - - return result; - } - const legacyDefinitions = ['app', 'cell_phone', 'team']; const definitionsToSkip = [ 'finance', @@ -412,6 +520,14 @@ for (const locale of locales) { localizationLocales += `| \`${locale}\` | ${localeTitle} | \`${localizedFaker}\` |\n`; promises.push( + // src/locales//date/wmonth.ts + // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance + updateMonthForLocale(locale), + + // src/locales//date/weekday.ts + // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance + updateWeekdaysForLocale(locale), + // src/locale/.ts // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance generateLocaleFile(locale), From aff49d5fc79fbf52a477bb60bac20b9af1071af6 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 22:27:51 +0900 Subject: [PATCH 10/20] fix : rollback generate scripts --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 593041980e0..a68ad21a1ca 100644 --- a/package.json +++ b/package.json @@ -65,10 +65,9 @@ "build:code": "tsup-node", "build:types": "tsc --project tsconfig.build.json", "build": "run-s build:clean build:code build:types", - "generate": "run-s generate:locales generate:api-docs generate:date", + "generate": "run-s generate:locales generate:api-docs", "generate:api-docs": "tsx ./scripts/apidocs.ts", "generate:locales": "tsx ./scripts/generate-locales.ts", - "generate:date": "tsx ./scripts/generate-date-for-locale.ts", "docs:build": "run-s generate:api-docs docs:build:run", "docs:build:run": "vitepress build docs", "docs:build:ci": "run-s build docs:build", From 7263f0d93ef748d9901732a4e6c593f7615209c9 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Sun, 19 May 2024 22:38:20 +0900 Subject: [PATCH 11/20] docs : add comments to explain why 'dv' locale is excluded --- scripts/generate-locales.ts | 1 + test/modules/date.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 5c14f75aa72..0be1a30078d 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -115,6 +115,7 @@ function escapeField(parent: string, module: string): string { } function isValidLocale(locale: string): boolean { + // 'dv' (Dhivehi) locale is excluded because it may not be fully supported if (locale === 'dv') return false; try { // eslint-disable-next-line no-restricted-globals diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts index 5c2f596a87e..345ec9547be 100644 --- a/test/modules/date.spec.ts +++ b/test/modules/date.spec.ts @@ -11,6 +11,7 @@ const converterMap = [ ]; const validIntlLocales = Object.entries(allFakers).filter(([locale]) => { + // 'dv' (Dhivehi) locale is excluded because it may not be fully supported if (locale === 'dv') return false; try { new Intl.DateTimeFormat(locale); From 3488e11a16ab4152dfe84bd717db3b0b4b360dcc Mon Sep 17 00:00:00 2001 From: ynnsuis Date: Mon, 20 May 2024 21:02:20 +0900 Subject: [PATCH 12/20] refactor : refactor generate-locales.ts reflecting code review --- scripts/generate-locales.ts | 136 +++++++++++++++++++++++------------- 1 file changed, 89 insertions(+), 47 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 0be1a30078d..add9b014002 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -5,7 +5,7 @@ * * - `src/locale/.ts` * - `src/locales//date/month.ts` - * - `src/locales//date/weekDay.ts` + * - `src/locales//date/weekday.ts` * - `src/locales//index.ts` * - `src/locales///index.ts` * - `src/docs/guide/localization.md` @@ -16,12 +16,15 @@ * * Run this script using `pnpm run generate:locales` */ - -import { constants } from 'node:fs'; +import { constants, promises as fs } from 'node:fs'; import { access, readFile, readdir, stat, writeFile } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -import type { LocaleDefinition, MetadataDefinition } from '../src/definitions'; +import type { + DateEntryDefinition, + LocaleDefinition, + MetadataDefinition, +} from '../src/definitions'; import { keys } from '../src/internal/keys'; import { formatMarkdown, formatTypescript } from './apidocs/utils/format'; @@ -32,6 +35,7 @@ const pathLocale = resolve(pathRoot, 'src', 'locale'); const pathLocales = resolve(pathRoot, 'src', 'locales'); const pathLocaleIndex = resolve(pathLocale, 'index.ts'); const pathLocalesIndex = resolve(pathLocales, 'index.ts'); +const pathDate = (locale: string) => resolve(pathLocales, locale, 'date'); const pathDocsGuideLocalization = resolve( pathRoot, 'docs', @@ -126,6 +130,15 @@ function isValidLocale(locale: string): boolean { } } +async function checkAndCreateFolder(path: string) { + try { + await fs.mkdir(path, { recursive: true }); + } catch (error) { + console.error(`Failed to create directory ${path}:`, error); + return; + } +} + function normalizeDataRecursive(localeData: T): T { if (typeof localeData !== 'object' || localeData === null) { // we can only traverse object-like structs @@ -151,14 +164,13 @@ function normalizeDataRecursive(localeData: T): T { } // Function to update weekday values for a given locale -async function updateWeekdaysForLocale(locale: string): Promise { +async function generateWeekdayFile(locale: string): Promise { if (!isValidLocale(locale)) return; - const dateFolderPath: string = resolve(pathLocales, locale, 'date'); - const weekdayPath: string = resolve(dateFolderPath, 'weekday.ts'); + const weekdayPath: string = resolve(pathDate(locale), 'weekday.ts'); // Initialize stored weekdays - let storedWeekdays: { wide: string[]; abbr: string[] } = { + let storedWeekdays: Partial = { wide: [], abbr: [], }; @@ -195,20 +207,24 @@ async function updateWeekdaysForLocale(locale: string): Promise { const normalizedWeekdays = normalizeDataRecursive(storedWeekdays); // Write updated values back to the file - const updatedContent = `${autoGeneratedCommentHeader} -export default ${JSON.stringify(normalizedWeekdays, null, 2)};`; - await writeFile(weekdayPath, await formatTypescript(updatedContent)); + const updatedContent = ` + ${autoGeneratedCommentHeader} + export default ${JSON.stringify(normalizedWeekdays, null, 2)}; + `; + return writeFile(weekdayPath, await formatTypescript(updatedContent)); } // Function to update month values for a given locale -async function updateMonthForLocale(locale: string): Promise { +async function generateMonthFile(locale: string): Promise { if (!isValidLocale(locale)) return; - const dateFolderPath: string = resolve(pathLocales, locale, 'date'); - const monthPath: string = resolve(dateFolderPath, 'month.ts'); + const monthPath: string = resolve(pathDate(locale), 'month.ts'); // Initialize stored months - let storedMonths: { wide: string[]; abbr: string[] } = { wide: [], abbr: [] }; + let storedMonths: Partial = { + wide: [], + abbr: [], + }; // Import the current month values try { @@ -239,9 +255,11 @@ async function updateMonthForLocale(locale: string): Promise { const normalizedMonths = normalizeDataRecursive(storedMonths); // Write updated values back to the file - const updatedContent = `${autoGeneratedCommentHeader} -export default ${JSON.stringify(normalizedMonths, null, 2)};`; - await writeFile(monthPath, await formatTypescript(updatedContent)); + const updatedContent = ` + ${autoGeneratedCommentHeader} + export default ${JSON.stringify(normalizedMonths, null, 2)}; + `; + return writeFile(monthPath, await formatTypescript(updatedContent)); } async function generateLocaleFile(locale: string): Promise { @@ -268,22 +286,48 @@ async function generateLocaleFile(locale: string): Promise { } let content = ` - ${autoGeneratedCommentHeader} +${autoGeneratedCommentHeader} - import { Faker } from '../faker'; - ${locales - .map((imp) => `import ${imp} from '../locales/${imp}';`) - .join('\n')} +import { Faker } from '../faker'; +${locales.map((imp) => `import ${imp} from '../locales/${imp}';`).join('\n')} - export const faker = new Faker({ - locale: ${ - locales.length === 1 ? locales[0] : `[${locales.join(', ')}]` - }, - }); - `; +export const faker = new Faker({ + locale: ${locales.length === 1 ? locales[0] : `[${locales.join(', ')}]`}, +}); +`; content = await formatTypescript(content); - return writeFile(resolve(pathLocale, `${locale}.ts`), content); + await writeFile(resolve(pathLocale, `${locale}.ts`), content); + + // Generate index.ts for the locale + const localeModulesPath = resolve(pathLocales, locale); + const localeIndexPath = resolve(localeModulesPath, 'index.ts'); + const modules = await readdir(localeModulesPath); + const moduleImports = modules + .filter((module) => module !== 'index.ts') + .map((module) => module.replace('.ts', '')) + .map((module) => `import ${module} from './${module}';`) + .join('\n'); + + const moduleExports = modules + .filter((module) => module !== 'index.ts') + .map((module) => module.replace('.ts', '')) + .join(',\n '); + + const localeDefinitionContent = ` +${autoGeneratedCommentHeader} +import type { LocaleDefinition } from '../..'; +${moduleImports} + +const ${locale}: LocaleDefinition = { + ${moduleExports} +}; + +export default ${locale}; +`; + + const formattedContent = await formatTypescript(localeDefinitionContent); + await writeFile(localeIndexPath, formattedContent); } async function generateLocalesIndexFile( @@ -477,6 +521,19 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { return writeFile(filePath, await formatTypescript(newContent)); } +async function generateDateModule(locale: string) { + if (!isValidLocale(locale)) return; + await checkAndCreateFolder(pathDate(locale)); + await generateWeekdayFile(locale); + await generateMonthFile(locale); + return generateRecursiveModuleIndexes( + pathDate(locale), + locale, + 'DateDefinition', + 2 + ); +} + // Start of actual logic const locales = await readdir(pathLocales); @@ -520,23 +577,8 @@ for (const locale of locales) { localesIndexImports += `import { default as ${locale} } from './${locale}';\n`; localizationLocales += `| \`${locale}\` | ${localeTitle} | \`${localizedFaker}\` |\n`; - promises.push( - // src/locales//date/wmonth.ts - // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance - updateMonthForLocale(locale), - - // src/locales//date/weekday.ts - // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance - updateWeekdaysForLocale(locale), - - // src/locale/.ts - // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance - generateLocaleFile(locale), - - // src/locales/**/index.ts - // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance - generateRecursiveModuleIndexes(pathModules, locale, 'LocaleDefinition', 1) - ); + // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance + promises.push(generateDateModule(locale), generateLocaleFile(locale)); } await Promise.all(promises); From cb80f8dff3cf3454e94dd84200a31b7c405d20e7 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 20 May 2024 18:41:46 +0200 Subject: [PATCH 13/20] chore: review and reduce diff --- scripts/generate-locales.ts | 281 +++++++++++++++--------------------- 1 file changed, 120 insertions(+), 161 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index add9b014002..f2111b167f5 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -1,5 +1,7 @@ #!/usr/bin/env node +/* eslint-disable no-restricted-globals */ + /** * This file contains a script that can be used to update the following files: * @@ -16,8 +18,15 @@ * * Run this script using `pnpm run generate:locales` */ -import { constants, promises as fs } from 'node:fs'; -import { access, readFile, readdir, stat, writeFile } from 'node:fs/promises'; +import { constants } from 'node:fs'; +import { + access, + mkdir, + readFile, + readdir, + stat, + writeFile, +} from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { @@ -35,7 +44,6 @@ const pathLocale = resolve(pathRoot, 'src', 'locale'); const pathLocales = resolve(pathRoot, 'src', 'locales'); const pathLocaleIndex = resolve(pathLocale, 'index.ts'); const pathLocalesIndex = resolve(pathLocales, 'index.ts'); -const pathDate = (locale: string) => resolve(pathLocales, locale, 'date'); const pathDocsGuideLocalization = resolve( pathRoot, 'docs', @@ -122,7 +130,6 @@ function isValidLocale(locale: string): boolean { // 'dv' (Dhivehi) locale is excluded because it may not be fully supported if (locale === 'dv') return false; try { - // eslint-disable-next-line no-restricted-globals new Intl.DateTimeFormat(locale); return true; } catch { @@ -130,15 +137,6 @@ function isValidLocale(locale: string): boolean { } } -async function checkAndCreateFolder(path: string) { - try { - await fs.mkdir(path, { recursive: true }); - } catch (error) { - console.error(`Failed to create directory ${path}:`, error); - return; - } -} - function normalizeDataRecursive(localeData: T): T { if (typeof localeData !== 'object' || localeData === null) { // we can only traverse object-like structs @@ -163,105 +161,6 @@ function normalizeDataRecursive(localeData: T): T { return result; } -// Function to update weekday values for a given locale -async function generateWeekdayFile(locale: string): Promise { - if (!isValidLocale(locale)) return; - - const weekdayPath: string = resolve(pathDate(locale), 'weekday.ts'); - - // Initialize stored weekdays - let storedWeekdays: Partial = { - wide: [], - abbr: [], - }; - - // Import the current weekday values - try { - const imported = await import(`file:${weekdayPath}`); - storedWeekdays = imported.default; - } catch { - console.log(`Creating weekday.ts file for locale ${locale}.`); - } - - // Generate correct weekday values - const wide: string[] = []; - const abbr: string[] = []; - // eslint-disable-next-line no-restricted-globals - const intlWeekdayLong = new Intl.DateTimeFormat(locale, { weekday: 'long' }); - // eslint-disable-next-line no-restricted-globals - const intlWeekdayShort = new Intl.DateTimeFormat(locale, { - weekday: 'short', - }); - for (let i = 0; i < 7; i++) { - const date: Date = new Date(2020, 0, i + 4); - // January 4-10, 2020 are Sunday to Saturday - wide.push(intlWeekdayLong.format(date)); - abbr.push(intlWeekdayShort.format(date)); - } - - // Update stored weekdays - storedWeekdays.wide = wide; - storedWeekdays.abbr = abbr; - - // Normalize stored weekdays before saving - const normalizedWeekdays = normalizeDataRecursive(storedWeekdays); - - // Write updated values back to the file - const updatedContent = ` - ${autoGeneratedCommentHeader} - export default ${JSON.stringify(normalizedWeekdays, null, 2)}; - `; - return writeFile(weekdayPath, await formatTypescript(updatedContent)); -} - -// Function to update month values for a given locale -async function generateMonthFile(locale: string): Promise { - if (!isValidLocale(locale)) return; - - const monthPath: string = resolve(pathDate(locale), 'month.ts'); - - // Initialize stored months - let storedMonths: Partial = { - wide: [], - abbr: [], - }; - - // Import the current month values - try { - const imported = await import(`file:${monthPath}`); - storedMonths = imported.default; - } catch { - console.log(`Creating month.ts file for locale ${locale}.`); - } - - // Generate correct month values - const wide: string[] = []; - const abbr: string[] = []; - // eslint-disable-next-line no-restricted-globals - const intlMonthLong = new Intl.DateTimeFormat(locale, { month: 'long' }); - // eslint-disable-next-line no-restricted-globals - const intlMonthShort = new Intl.DateTimeFormat(locale, { month: 'short' }); - for (let i = 0; i < 12; i++) { - const date: Date = new Date(2020, i, 1); - wide.push(intlMonthLong.format(date)); - abbr.push(intlMonthShort.format(date)); - } - - // Update stored months - storedMonths.wide = wide; - storedMonths.abbr = abbr; - - // Normalize stored months before saving - const normalizedMonths = normalizeDataRecursive(storedMonths); - - // Write updated values back to the file - const updatedContent = ` - ${autoGeneratedCommentHeader} - export default ${JSON.stringify(normalizedMonths, null, 2)}; - `; - return writeFile(monthPath, await formatTypescript(updatedContent)); -} - async function generateLocaleFile(locale: string): Promise { const parts = locale.split('_'); const locales = [locale]; @@ -286,48 +185,22 @@ async function generateLocaleFile(locale: string): Promise { } let content = ` -${autoGeneratedCommentHeader} + ${autoGeneratedCommentHeader} -import { Faker } from '../faker'; -${locales.map((imp) => `import ${imp} from '../locales/${imp}';`).join('\n')} + import { Faker } from '../faker'; + ${locales + .map((imp) => `import ${imp} from '../locales/${imp}';`) + .join('\n')} -export const faker = new Faker({ - locale: ${locales.length === 1 ? locales[0] : `[${locales.join(', ')}]`}, -}); -`; + export const faker = new Faker({ + locale: ${ + locales.length === 1 ? locales[0] : `[${locales.join(', ')}]` + }, + }); + `; content = await formatTypescript(content); - await writeFile(resolve(pathLocale, `${locale}.ts`), content); - - // Generate index.ts for the locale - const localeModulesPath = resolve(pathLocales, locale); - const localeIndexPath = resolve(localeModulesPath, 'index.ts'); - const modules = await readdir(localeModulesPath); - const moduleImports = modules - .filter((module) => module !== 'index.ts') - .map((module) => module.replace('.ts', '')) - .map((module) => `import ${module} from './${module}';`) - .join('\n'); - - const moduleExports = modules - .filter((module) => module !== 'index.ts') - .map((module) => module.replace('.ts', '')) - .join(',\n '); - - const localeDefinitionContent = ` -${autoGeneratedCommentHeader} -import type { LocaleDefinition } from '../..'; -${moduleImports} - -const ${locale}: LocaleDefinition = { - ${moduleExports} -}; - -export default ${locale}; -`; - - const formattedContent = await formatTypescript(localeDefinitionContent); - await writeFile(localeIndexPath, formattedContent); + return writeFile(resolve(pathLocale, `${locale}.ts`), content); } async function generateLocalesIndexFile( @@ -521,17 +394,93 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { return writeFile(filePath, await formatTypescript(newContent)); } +// `src/locales//date/* async function generateDateModule(locale: string) { if (!isValidLocale(locale)) return; - await checkAndCreateFolder(pathDate(locale)); - await generateWeekdayFile(locale); - await generateMonthFile(locale); - return generateRecursiveModuleIndexes( - pathDate(locale), - locale, - 'DateDefinition', - 2 - ); + + const pathDate = resolve(pathLocales, locale, 'date'); + + // `src/locales//date/weekday.ts` + async function generateWeekdayFile(): Promise { + const weekdayPath = resolve(pathDate, 'weekday.ts'); + let storedWeekdays: Partial = {}; + + // Import the current weekday values + try { + const imported = await import(`file:${weekdayPath}`); + storedWeekdays = imported.default; + } catch { + console.log(`Creating weekday.ts file for locale ${locale}.`); + } + + // Generate correct weekday values + const wide: string[] = []; + const abbr: string[] = []; + const intlWeekdayLong = new Intl.DateTimeFormat(locale, { + weekday: 'long', + }); + const intlWeekdayShort = new Intl.DateTimeFormat(locale, { + weekday: 'short', + }); + for (let i = 0; i < 7; i++) { + const date: Date = new Date(2020, 0, i + 4); + // January 4-10, 2020 are Sunday to Saturday + wide.push(intlWeekdayLong.format(date)); + abbr.push(intlWeekdayShort.format(date)); + } + + storedWeekdays.wide = wide; + storedWeekdays.abbr = abbr; + + // Write updated values back to the file + const normalizedWeekdays = normalizeDataRecursive(storedWeekdays); + const updatedContent = ` + ${autoGeneratedCommentHeader} + export default ${JSON.stringify(normalizedWeekdays, null, 2)}; + `; + return writeFile(weekdayPath, await formatTypescript(updatedContent)); + } + + // `src/locales//date/month.ts` + async function generateMonthFile(): Promise { + const monthPath = resolve(pathDate, 'month.ts'); + let storedMonths: Partial = {}; + + // Import the current month values + try { + const imported = await import(`file:${monthPath}`); + storedMonths = imported.default; + } catch { + console.log(`Creating month.ts file for locale ${locale}.`); + } + + // Generate correct month values + const wide: string[] = []; + const abbr: string[] = []; + const intlMonthLong = new Intl.DateTimeFormat(locale, { month: 'long' }); + const intlMonthShort = new Intl.DateTimeFormat(locale, { month: 'short' }); + for (let i = 0; i < 12; i++) { + const date: Date = new Date(2020, i, 1); + wide.push(intlMonthLong.format(date)); + abbr.push(intlMonthShort.format(date)); + } + + storedMonths.wide = wide; + storedMonths.abbr = abbr; + + // Write updated values back to the file + const normalizedMonths = normalizeDataRecursive(storedMonths); + const updatedContent = ` + ${autoGeneratedCommentHeader} + export default ${JSON.stringify(normalizedMonths, null, 2)}; + `; + return writeFile(monthPath, await formatTypescript(updatedContent)); + } + + await mkdir(pathDate, { recursive: true }); + await generateWeekdayFile(); + await generateMonthFile(); + return generateRecursiveModuleIndexes(pathDate, locale, 'DateDefinition', 2); } // Start of actual logic @@ -577,8 +526,18 @@ for (const locale of locales) { localesIndexImports += `import { default as ${locale} } from './${locale}';\n`; localizationLocales += `| \`${locale}\` | ${localeTitle} | \`${localizedFaker}\` |\n`; - // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance - promises.push(generateDateModule(locale), generateLocaleFile(locale)); + // We first need to generate the date module + await generateDateModule(locale); + + promises.push( + // src/locale/.ts + // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance + generateLocaleFile(locale), + + // src/locales/**/index.ts + // eslint-disable-next-line unicorn/prefer-top-level-await -- Disabled for performance + generateRecursiveModuleIndexes(pathModules, locale, 'LocaleDefinition', 1) + ); } await Promise.all(promises); From 8f92366146b6039a2d983b7bb430b041e7aa69a4 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 20 May 2024 19:04:36 +0200 Subject: [PATCH 14/20] chore: generate files --- src/locales/ar/date/month.ts | 30 +++++++++++--------- src/locales/ar/date/weekday.ts | 18 ++++++++++-- src/locales/az/date/month.ts | 28 ++++++++++-------- src/locales/az/date/weekday.ts | 20 +++++++------ src/locales/da/date/month.ts | 4 +++ src/locales/da/date/weekday.ts | 6 +++- src/locales/de/date/month.ts | 6 +++- src/locales/de/date/weekday.ts | 6 +++- src/locales/el/date/index.ts | 14 +++++++++ src/locales/el/date/month.ts | 34 ++++++++++++++++++++++ src/locales/el/date/weekday.ts | 16 +++++++++++ src/locales/el/index.ts | 2 ++ src/locales/en/date/month.ts | 4 +++ src/locales/en/date/weekday.ts | 4 +++ src/locales/eo/date/month.ts | 52 ++++++++++++++++++---------------- src/locales/eo/date/weekday.ts | 4 +++ src/locales/es/date/month.ts | 7 +++-- src/locales/es/date/weekday.ts | 5 +++- src/locales/fa/date/month.ts | 20 +++++++------ src/locales/fa/date/weekday.ts | 8 ++++-- src/locales/fi/date/index.ts | 14 +++++++++ src/locales/fi/date/month.ts | 34 ++++++++++++++++++++++ src/locales/fi/date/weekday.ts | 16 +++++++++++ src/locales/fi/index.ts | 2 ++ src/locales/fr/date/month.ts | 30 +++++++++++--------- src/locales/fr/date/weekday.ts | 20 +++++++------ src/locales/he/date/month.ts | 28 ++++++++++-------- src/locales/he/date/weekday.ts | 6 +++- src/locales/hr/date/month.ts | 6 +++- src/locales/hr/date/weekday.ts | 4 +++ src/locales/hu/date/month.ts | 4 +++ src/locales/hu/date/weekday.ts | 6 +++- src/locales/hy/date/month.ts | 52 ++++++++++++++++++---------------- src/locales/hy/date/weekday.ts | 20 +++++++------ src/locales/it/date/index.ts | 14 +++++++++ src/locales/it/date/month.ts | 34 ++++++++++++++++++++++ src/locales/it/date/weekday.ts | 16 +++++++++++ src/locales/it/index.ts | 2 ++ src/locales/ja/date/index.ts | 14 +++++++++ src/locales/ja/date/month.ts | 34 ++++++++++++++++++++++ src/locales/ja/date/weekday.ts | 8 ++++++ src/locales/ja/index.ts | 2 ++ src/locales/ko/date/month.ts | 4 +++ src/locales/ko/date/weekday.ts | 4 +++ src/locales/lv/date/month.ts | 14 +++++---- src/locales/lv/date/weekday.ts | 14 ++++++++- src/locales/mk/date/month.ts | 26 ++++++++++------- src/locales/mk/date/weekday.ts | 6 +++- src/locales/ne/date/index.ts | 14 +++++++++ src/locales/ne/date/month.ts | 34 ++++++++++++++++++++++ src/locales/ne/date/weekday.ts | 16 +++++++++++ src/locales/ne/index.ts | 2 ++ src/locales/nl/date/month.ts | 4 +++ src/locales/nl/date/weekday.ts | 4 +++ src/locales/pl/date/index.ts | 14 +++++++++ src/locales/pl/date/month.ts | 34 ++++++++++++++++++++++ src/locales/pl/date/weekday.ts | 16 +++++++++++ src/locales/pl/index.ts | 2 ++ src/locales/ro/date/month.ts | 52 ++++++++++++++++++---------------- src/locales/ro/date/weekday.ts | 8 ++++-- src/locales/ru/date/month.ts | 4 +++ src/locales/ru/date/weekday.ts | 20 +++++++------ src/locales/sk/date/index.ts | 14 +++++++++ src/locales/sk/date/month.ts | 34 ++++++++++++++++++++++ src/locales/sk/date/weekday.ts | 16 +++++++++++ src/locales/sk/index.ts | 2 ++ src/locales/sv/date/month.ts | 26 ++++++++++------- src/locales/sv/date/weekday.ts | 6 +++- src/locales/th/date/month.ts | 4 +++ src/locales/th/date/weekday.ts | 4 +++ src/locales/tr/date/index.ts | 14 +++++++++ src/locales/tr/date/month.ts | 34 ++++++++++++++++++++++ src/locales/tr/date/weekday.ts | 16 +++++++++++ src/locales/tr/index.ts | 2 ++ src/locales/uk/date/index.ts | 14 +++++++++ src/locales/uk/date/month.ts | 34 ++++++++++++++++++++++ src/locales/uk/date/weekday.ts | 16 +++++++++++ src/locales/uk/index.ts | 2 ++ src/locales/ur/date/month.ts | 23 +++++++++++++-- src/locales/ur/date/weekday.ts | 8 ++++-- src/locales/vi/date/month.ts | 28 ++++++++++-------- src/locales/vi/date/weekday.ts | 20 +++++++------ 82 files changed, 1030 insertions(+), 233 deletions(-) create mode 100644 src/locales/el/date/index.ts create mode 100644 src/locales/el/date/month.ts create mode 100644 src/locales/el/date/weekday.ts create mode 100644 src/locales/fi/date/index.ts create mode 100644 src/locales/fi/date/month.ts create mode 100644 src/locales/fi/date/weekday.ts create mode 100644 src/locales/it/date/index.ts create mode 100644 src/locales/it/date/month.ts create mode 100644 src/locales/it/date/weekday.ts create mode 100644 src/locales/ja/date/index.ts create mode 100644 src/locales/ja/date/month.ts create mode 100644 src/locales/ja/date/weekday.ts create mode 100644 src/locales/ne/date/index.ts create mode 100644 src/locales/ne/date/month.ts create mode 100644 src/locales/ne/date/weekday.ts create mode 100644 src/locales/pl/date/index.ts create mode 100644 src/locales/pl/date/month.ts create mode 100644 src/locales/pl/date/weekday.ts create mode 100644 src/locales/sk/date/index.ts create mode 100644 src/locales/sk/date/month.ts create mode 100644 src/locales/sk/date/weekday.ts create mode 100644 src/locales/tr/date/index.ts create mode 100644 src/locales/tr/date/month.ts create mode 100644 src/locales/tr/date/weekday.ts create mode 100644 src/locales/uk/date/index.ts create mode 100644 src/locales/uk/date/month.ts create mode 100644 src/locales/uk/date/weekday.ts diff --git a/src/locales/ar/date/month.ts b/src/locales/ar/date/month.ts index f2844bde869..3f6dc446da8 100644 --- a/src/locales/ar/date/month.ts +++ b/src/locales/ar/date/month.ts @@ -1,22 +1,26 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'آب', - 'آذَار', - 'أَيَّار', - 'أَيْلُول', - 'تَمُّوز', - 'تِشْرِين ٱلثَّانِي', - 'تِشْرِين ٱلْأَوَّل', - 'حَزِيرَان', - 'شُبَاط', - 'كَانُون ٱلثَّانِي', - 'كَانُون ٱلْأَوَّل', - 'نَيْسَان', + 'أبريل', + 'أغسطس', + 'أكتوبر', + 'ديسمبر', + 'سبتمبر', + 'فبراير', + 'مارس', + 'مايو', + 'نوفمبر', + 'يناير', + 'يوليو', + 'يونيو', ], abbr: [ + 'أبريل', 'أغسطس', 'أكتوبر', - 'إبريل', 'ديسمبر', 'سبتمبر', 'فبراير', diff --git a/src/locales/ar/date/weekday.ts b/src/locales/ar/date/weekday.ts index 1c74d813966..b3ed4568fc7 100644 --- a/src/locales/ar/date/weekday.ts +++ b/src/locales/ar/date/weekday.ts @@ -1,9 +1,21 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - abbr: null, + abbr: [ + 'الأحد', + 'الأربعاء', + 'الاثنين', + 'الثلاثاء', + 'الجمعة', + 'الخميس', + 'السبت', + ], wide: [ - 'الأحَد', + 'الأحد', 'الأربعاء', - 'الإثنين', + 'الاثنين', 'الثلاثاء', 'الجمعة', 'الخميس', diff --git a/src/locales/az/date/month.ts b/src/locales/az/date/month.ts index 22dbb6c3b8c..adae8be152d 100644 --- a/src/locales/az/date/month.ts +++ b/src/locales/az/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'aprel', @@ -28,18 +32,18 @@ export default { 'января', ], abbr: [ - 'авг.', - 'апр.', - 'дек.', - 'июль', - 'июнь', - 'май', - 'март', - 'нояб.', - 'окт.', - 'сент.', - 'февр.', - 'янв.', + 'apr', + 'avq', + 'dek', + 'fev', + 'iyl', + 'iyn', + 'mar', + 'may', + 'noy', + 'okt', + 'sen', + 'yan', ], abbr_context: [ 'авг.', diff --git a/src/locales/az/date/weekday.ts b/src/locales/az/date/weekday.ts index 5f516fc501f..31d57d63845 100644 --- a/src/locales/az/date/weekday.ts +++ b/src/locales/az/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Bazar', - 'Bazar ertəsi', - 'Cümə', - 'Cümə axşamı', - 'Çərşənbə', - 'Çərşənbə axşamı', - 'Şənbə', + 'bazar', + 'bazar ertəsi', + 'cümə', + 'cümə axşamı', + 'çərşənbə', + 'çərşənbə axşamı', + 'şənbə', ], wide_context: [ 'воскресенье', @@ -17,6 +21,6 @@ export default { 'суббота', 'четверг', ], - abbr: ['BE', 'Ba', 'CA', 'Cü', 'ÇA', 'Çə', 'Şə'], + abbr: ['B.', 'B.E.', 'C.', 'C.A.', 'Ç.', 'Ç.A.', 'Ş.'], abbr_context: ['вс', 'вт', 'пн', 'пт', 'сб', 'ср', 'чт'], }; diff --git a/src/locales/da/date/month.ts b/src/locales/da/date/month.ts index 8f71b356b4d..d590344ef5b 100644 --- a/src/locales/da/date/month.ts +++ b/src/locales/da/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'april', diff --git a/src/locales/da/date/weekday.ts b/src/locales/da/date/weekday.ts index 3cb6c12cf40..026dd519fd7 100644 --- a/src/locales/da/date/weekday.ts +++ b/src/locales/da/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'fredag', @@ -8,5 +12,5 @@ export default { 'tirsdag', 'torsdag', ], - abbr: ['fre.', 'lør.', 'man.', 'ons.', 'søn.', 'tir.', 'tor.'], + abbr: ['fre.', 'lør.', 'man.', 'ons.', 'søn.', 'tirs.', 'tors.'], }; diff --git a/src/locales/de/date/month.ts b/src/locales/de/date/month.ts index f72dcf63ded..14b3dc9f02a 100644 --- a/src/locales/de/date/month.ts +++ b/src/locales/de/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'April', @@ -22,7 +26,7 @@ export default { 'Jul', 'Jun', 'Mai', - 'Mrz', + 'Mär', 'Nov', 'Okt', 'Sep', diff --git a/src/locales/de/date/weekday.ts b/src/locales/de/date/weekday.ts index 6d9e6486f03..d6bc3c92fa2 100644 --- a/src/locales/de/date/weekday.ts +++ b/src/locales/de/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'Dienstag', @@ -8,5 +12,5 @@ export default { 'Samstag', 'Sonntag', ], - abbr: ['Di.', 'Do.', 'Fr.', 'Mi.', 'Mo.', 'Sa.', 'So.'], + abbr: ['Di', 'Do', 'Fr', 'Mi', 'Mo', 'Sa', 'So'], }; diff --git a/src/locales/el/date/index.ts b/src/locales/el/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/el/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/el/date/month.ts b/src/locales/el/date/month.ts new file mode 100644 index 00000000000..83b4b6d2d69 --- /dev/null +++ b/src/locales/el/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Απριλίου', + 'Αυγούστου', + 'Δεκεμβρίου', + 'Ιανουαρίου', + 'Ιουλίου', + 'Ιουνίου', + 'Μαΐου', + 'Μαρτίου', + 'Νοεμβρίου', + 'Οκτωβρίου', + 'Σεπτεμβρίου', + 'Φεβρουαρίου', + ], + abbr: [ + 'Απρ', + 'Αυγ', + 'Δεκ', + 'Ιαν', + 'Ιουλ', + 'Ιουν', + 'Μαΐ', + 'Μαρ', + 'Νοε', + 'Οκτ', + 'Σεπ', + 'Φεβ', + ], +}; diff --git a/src/locales/el/date/weekday.ts b/src/locales/el/date/weekday.ts new file mode 100644 index 00000000000..a4295d4557d --- /dev/null +++ b/src/locales/el/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Δευτέρα', + 'Κυριακή', + 'Πέμπτη', + 'Παρασκευή', + 'Σάββατο', + 'Τετάρτη', + 'Τρίτη', + ], + abbr: ['Δευ', 'Κυρ', 'Πέμ', 'Παρ', 'Σάβ', 'Τετ', 'Τρί'], +}; diff --git a/src/locales/el/index.ts b/src/locales/el/index.ts index 42a1f59a726..82108f3cec1 100644 --- a/src/locales/el/index.ts +++ b/src/locales/el/index.ts @@ -8,6 +8,7 @@ import cell_phone from './cell_phone'; import color from './color'; import commerce from './commerce'; import company from './company'; +import date from './date'; import finance from './finance'; import hacker from './hacker'; import internet from './internet'; @@ -24,6 +25,7 @@ const el: LocaleDefinition = { color, commerce, company, + date, finance, hacker, internet, diff --git a/src/locales/en/date/month.ts b/src/locales/en/date/month.ts index 64bec3c29b0..7a05646d9c7 100644 --- a/src/locales/en/date/month.ts +++ b/src/locales/en/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'April', diff --git a/src/locales/en/date/weekday.ts b/src/locales/en/date/weekday.ts index 83cac6864d2..90241047497 100644 --- a/src/locales/en/date/weekday.ts +++ b/src/locales/en/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'Friday', diff --git a/src/locales/eo/date/month.ts b/src/locales/eo/date/month.ts index 85b4f68ef04..11118c000d8 100644 --- a/src/locales/eo/date/month.ts +++ b/src/locales/eo/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'aprilo', - 'aŭgusto', - 'decembro', - 'februaro', - 'januaro', - 'julio', - 'junio', - 'majo', - 'marto', - 'novembro', - 'oktobro', - 'septembro', + 'Aprilo', + 'Aŭgusto', + 'Decembro', + 'Februaro', + 'Januaro', + 'Julio', + 'Junio', + 'Majo', + 'Marto', + 'Novembro', + 'Oktobro', + 'Septembro', ], abbr: [ - 'apr', - 'aŭg', - 'dec', - 'feb', - 'jan', - 'jul', - 'jun', - 'maj', - 'mar', - 'nov', - 'okt', - 'sep', + 'Apr', + 'Aŭg', + 'Dec', + 'Feb', + 'Jan', + 'Jul', + 'Jun', + 'Maj', + 'Mar', + 'Nov', + 'Okt', + 'Sep', ], }; diff --git a/src/locales/eo/date/weekday.ts b/src/locales/eo/date/weekday.ts index 76bac938b25..1b65bf6a793 100644 --- a/src/locales/eo/date/weekday.ts +++ b/src/locales/eo/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'dimanĉo', diff --git a/src/locales/es/date/month.ts b/src/locales/es/date/month.ts index 60c0dea3fee..e1f367063e3 100644 --- a/src/locales/es/date/month.ts +++ b/src/locales/es/date/month.ts @@ -1,4 +1,7 @@ -// Sources: https://www.wikilengua.org/index.php/Abreviaciones_en_fechas +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'abril', @@ -26,7 +29,7 @@ export default { 'may', 'nov', 'oct', - 'sep', + 'sept', ], abbr_context: [ 'abr.', diff --git a/src/locales/es/date/weekday.ts b/src/locales/es/date/weekday.ts index 954682dded0..0d632d39f2e 100644 --- a/src/locales/es/date/weekday.ts +++ b/src/locales/es/date/weekday.ts @@ -1,4 +1,7 @@ -// Sources: https://www.wikilengua.org/index.php/Abreviaciones_en_fechas +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'domingo', diff --git a/src/locales/fa/date/month.ts b/src/locales/fa/date/month.ts index f73d3ed415f..88a6a3bf25a 100644 --- a/src/locales/fa/date/month.ts +++ b/src/locales/fa/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'آبان', @@ -14,17 +18,17 @@ export default { 'مهر', ], abbr: [ - 'آبا', + 'آبان', 'آذر', - 'ارد', - 'اسف', - 'بهم', + 'اردیبهشت', + 'اسفند', + 'بهمن', 'تیر', - 'خرد', + 'خرداد', 'دی', - 'شهر', - 'فرو', - 'مرد', + 'شهریور', + 'فروردین', + 'مرداد', 'مهر', ], }; diff --git a/src/locales/fa/date/weekday.ts b/src/locales/fa/date/weekday.ts index bdc023b58f4..44c8e81b9db 100644 --- a/src/locales/fa/date/weekday.ts +++ b/src/locales/fa/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['جمعه', 'دوشنبه', 'سه شنبه', 'شنبه', 'پنجشنبه', 'چهارشنبه', 'یکشنبه'], - abbr: ['ج', 'د', 'س', 'ش', 'پ', 'چ', 'ی'], + wide: ['جمعه', 'دوشنبه', 'سه‌شنبه', 'شنبه', 'پنجشنبه', 'چهارشنبه', 'یکشنبه'], + abbr: ['جمعه', 'دوشنبه', 'سه‌شنبه', 'شنبه', 'پنجشنبه', 'چهارشنبه', 'یکشنبه'], }; diff --git a/src/locales/fi/date/index.ts b/src/locales/fi/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/fi/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/fi/date/month.ts b/src/locales/fi/date/month.ts new file mode 100644 index 00000000000..b498c642dd9 --- /dev/null +++ b/src/locales/fi/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'elokuu', + 'heinäkuu', + 'helmikuu', + 'huhtikuu', + 'joulukuu', + 'kesäkuu', + 'lokakuu', + 'maaliskuu', + 'marraskuu', + 'syyskuu', + 'tammikuu', + 'toukokuu', + ], + abbr: [ + 'elo', + 'heinä', + 'helmi', + 'huhti', + 'joulu', + 'kesä', + 'loka', + 'maalis', + 'marras', + 'syys', + 'tammi', + 'touko', + ], +}; diff --git a/src/locales/fi/date/weekday.ts b/src/locales/fi/date/weekday.ts new file mode 100644 index 00000000000..978c7f7acd4 --- /dev/null +++ b/src/locales/fi/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'keskiviikko', + 'lauantai', + 'maanantai', + 'perjantai', + 'sunnuntai', + 'tiistai', + 'torstai', + ], + abbr: ['ke', 'la', 'ma', 'pe', 'su', 'ti', 'to'], +}; diff --git a/src/locales/fi/index.ts b/src/locales/fi/index.ts index 73dabe6f9aa..9a29bb15555 100644 --- a/src/locales/fi/index.ts +++ b/src/locales/fi/index.ts @@ -3,11 +3,13 @@ * Run 'pnpm run generate:locales' to update. */ import type { LocaleDefinition } from '../..'; +import date from './date'; import location from './location'; import metadata from './metadata'; import person from './person'; const fi: LocaleDefinition = { + date, location, metadata, person, diff --git a/src/locales/fr/date/month.ts b/src/locales/fr/date/month.ts index 8700890dea7..34503acad75 100644 --- a/src/locales/fr/date/month.ts +++ b/src/locales/fr/date/month.ts @@ -1,17 +1,21 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Août', - 'Avril', - 'Décembre', - 'Février', - 'Janvier', - 'Juillet', - 'Juin', - 'Mai', - 'Mars', - 'Novembre', - 'Octobre', - 'Septembre', + 'août', + 'avril', + 'décembre', + 'février', + 'janvier', + 'juillet', + 'juin', + 'mai', + 'mars', + 'novembre', + 'octobre', + 'septembre', ], wide_context: [ 'août', @@ -29,7 +33,7 @@ export default { ], abbr: [ 'août', - 'avril', + 'avr.', 'déc.', 'févr.', 'janv.', diff --git a/src/locales/fr/date/weekday.ts b/src/locales/fr/date/weekday.ts index dace479e0c4..57e322964ad 100644 --- a/src/locales/fr/date/weekday.ts +++ b/src/locales/fr/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Dimanche', - 'Jeudi', - 'Lundi', - 'Mardi', - 'Mercredi', - 'Samedi', - 'Vendredi', + 'dimanche', + 'jeudi', + 'lundi', + 'mardi', + 'mercredi', + 'samedi', + 'vendredi', ], wide_context: [ 'dimanche', @@ -17,6 +21,6 @@ export default { 'samedi', 'vendredi', ], - abbr: ['Dim', 'Jeu', 'Lun', 'Mar', 'Mer', 'Sam', 'Ven'], + abbr: ['dim.', 'jeu.', 'lun.', 'mar.', 'mer.', 'sam.', 'ven.'], abbr_context: ['dim', 'jeu', 'lun', 'mar', 'mer', 'sam', 'ven'], }; diff --git a/src/locales/he/date/month.ts b/src/locales/he/date/month.ts index 7c4f5aabdef..af5e7a89348 100644 --- a/src/locales/he/date/month.ts +++ b/src/locales/he/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'אוגוסט', @@ -14,17 +18,17 @@ export default { 'פברואר', ], abbr: [ - 'Apr', - 'Aug', - 'Dec', - 'Feb', - 'Jan', - 'Jul', - 'Jun', - 'Mar', - 'May', - 'Nov', - 'Oct', - 'Sep', + 'אוג׳', + 'אוק׳', + 'אפר׳', + 'דצמ׳', + 'יולי', + 'יוני', + 'ינו׳', + 'מאי', + 'מרץ', + 'נוב׳', + 'ספט׳', + 'פבר׳', ], }; diff --git a/src/locales/he/date/weekday.ts b/src/locales/he/date/weekday.ts index 4d62c140483..0ecdde05942 100644 --- a/src/locales/he/date/weekday.ts +++ b/src/locales/he/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'יום חמישי', 'יום ראשון', 'יום רביעי', + 'יום שבת', 'יום שישי', 'יום שלישי', 'יום שני', - 'שבת', ], abbr: ['יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת'], }; diff --git a/src/locales/hr/date/month.ts b/src/locales/hr/date/month.ts index adfdec7b988..e92d84740dc 100644 --- a/src/locales/hr/date/month.ts +++ b/src/locales/hr/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'kolovoz', @@ -25,6 +29,6 @@ export default { 'stu', 'svi', 'tra', - 'vel', + 'velj', ], }; diff --git a/src/locales/hr/date/weekday.ts b/src/locales/hr/date/weekday.ts index 979860c7765..42ff3f07b0c 100644 --- a/src/locales/hr/date/weekday.ts +++ b/src/locales/hr/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'nedjelja', diff --git a/src/locales/hu/date/month.ts b/src/locales/hu/date/month.ts index 8a241d553c8..8db755070fa 100644 --- a/src/locales/hu/date/month.ts +++ b/src/locales/hu/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'augusztus', diff --git a/src/locales/hu/date/weekday.ts b/src/locales/hu/date/weekday.ts index ab6f1f420bc..7448cf21d8f 100644 --- a/src/locales/hu/date/weekday.ts +++ b/src/locales/hu/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'csütörtök', @@ -8,5 +12,5 @@ export default { 'szombat', 'vasárnap', ], - abbr: ['Csüt', 'Hé', 'Ke', 'Pé', 'Sze', 'Szo', 'Va'], + abbr: ['Cs', 'H', 'K', 'P', 'Sze', 'Szo', 'V'], }; diff --git a/src/locales/hy/date/month.ts b/src/locales/hy/date/month.ts index a111255e5d6..999e5480b12 100644 --- a/src/locales/hy/date/month.ts +++ b/src/locales/hy/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Ապրիլ', - 'Դեկտեմբեր', - 'Հոկտեմբեր', - 'Հուլիս', - 'Հունիս', - 'Հունվար', - 'Մայիս', - 'Մարտ', - 'Նոյեմբեր', - 'Սեպտեմբեր', - 'Փետրվար', - 'Օգոստոս', + 'ապրիլ', + 'դեկտեմբեր', + 'հոկտեմբեր', + 'հուլիս', + 'հունիս', + 'հունվար', + 'մայիս', + 'մարտ', + 'նոյեմբեր', + 'սեպտեմբեր', + 'փետրվար', + 'օգոստոս', ], abbr: [ - 'Ապր', - 'Դկտ', - 'Հլս', - 'Հկտ', - 'Հնս', - 'Հնվ', - 'Մյս', - 'Մրտ', - 'Նմբ', - 'Սպտ', - 'Փտր', - 'Օգս', + 'ապր', + 'դեկ', + 'հլս', + 'հնս', + 'հնվ', + 'հոկ', + 'մյս', + 'մրտ', + 'նոյ', + 'սեպ', + 'փտվ', + 'օգս', ], }; diff --git a/src/locales/hy/date/weekday.ts b/src/locales/hy/date/weekday.ts index 64f70cb761b..824b3db273b 100644 --- a/src/locales/hy/date/weekday.ts +++ b/src/locales/hy/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Երեքշաբթի', - 'Երկուշաբթի', - 'Կիրակի', - 'Հինգշաբթի', - 'Շաբաթ', - 'Ուրբաթ', - 'Չորեքշաբթի', + 'երեքշաբթի', + 'երկուշաբթի', + 'կիրակի', + 'հինգշաբթի', + 'շաբաթ', + 'ուրբաթ', + 'չորեքշաբթի', ], - abbr: ['երկ', 'երք', 'կրկ', 'հնգ', 'շբթ', 'ուրբ', 'չրք'], + abbr: ['երկ', 'երք', 'կիր', 'հնգ', 'շբթ', 'ուր', 'չրք'], }; diff --git a/src/locales/it/date/index.ts b/src/locales/it/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/it/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/it/date/month.ts b/src/locales/it/date/month.ts new file mode 100644 index 00000000000..93b96ec1d11 --- /dev/null +++ b/src/locales/it/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'agosto', + 'aprile', + 'dicembre', + 'febbraio', + 'gennaio', + 'giugno', + 'luglio', + 'maggio', + 'marzo', + 'novembre', + 'ottobre', + 'settembre', + ], + abbr: [ + 'ago', + 'apr', + 'dic', + 'feb', + 'gen', + 'giu', + 'lug', + 'mag', + 'mar', + 'nov', + 'ott', + 'set', + ], +}; diff --git a/src/locales/it/date/weekday.ts b/src/locales/it/date/weekday.ts new file mode 100644 index 00000000000..bd1b07fa268 --- /dev/null +++ b/src/locales/it/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'domenica', + 'giovedì', + 'lunedì', + 'martedì', + 'mercoledì', + 'sabato', + 'venerdì', + ], + abbr: ['dom', 'gio', 'lun', 'mar', 'mer', 'sab', 'ven'], +}; diff --git a/src/locales/it/index.ts b/src/locales/it/index.ts index 5e2af4e8d53..6187f93a96c 100644 --- a/src/locales/it/index.ts +++ b/src/locales/it/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const it: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/ja/date/index.ts b/src/locales/ja/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/ja/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/ja/date/month.ts b/src/locales/ja/date/month.ts new file mode 100644 index 00000000000..b00f915c375 --- /dev/null +++ b/src/locales/ja/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + '10月', + '11月', + '12月', + '1月', + '2月', + '3月', + '4月', + '5月', + '6月', + '7月', + '8月', + '9月', + ], + abbr: [ + '10月', + '11月', + '12月', + '1月', + '2月', + '3月', + '4月', + '5月', + '6月', + '7月', + '8月', + '9月', + ], +}; diff --git a/src/locales/ja/date/weekday.ts b/src/locales/ja/date/weekday.ts new file mode 100644 index 00000000000..d5e8661c125 --- /dev/null +++ b/src/locales/ja/date/weekday.ts @@ -0,0 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: ['土曜日', '日曜日', '月曜日', '木曜日', '水曜日', '火曜日', '金曜日'], + abbr: ['土', '日', '月', '木', '水', '火', '金'], +}; diff --git a/src/locales/ja/index.ts b/src/locales/ja/index.ts index b6d019614bd..82ca97a5ae1 100644 --- a/src/locales/ja/index.ts +++ b/src/locales/ja/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import location from './location'; import lorem from './lorem'; import metadata from './metadata'; @@ -14,6 +15,7 @@ import phone_number from './phone_number'; const ja: LocaleDefinition = { cell_phone, company, + date, location, lorem, metadata, diff --git a/src/locales/ko/date/month.ts b/src/locales/ko/date/month.ts index 7422db7d5bd..5aa0b135a2f 100644 --- a/src/locales/ko/date/month.ts +++ b/src/locales/ko/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ '10월', diff --git a/src/locales/ko/date/weekday.ts b/src/locales/ko/date/weekday.ts index c340f672cc1..4789e59e36c 100644 --- a/src/locales/ko/date/weekday.ts +++ b/src/locales/ko/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: ['금요일', '목요일', '수요일', '월요일', '일요일', '토요일', '화요일'], abbr: ['금', '목', '수', '월', '일', '토', '화'], diff --git a/src/locales/lv/date/month.ts b/src/locales/lv/date/month.ts index 32fdf782ee8..0939949fbeb 100644 --- a/src/locales/lv/date/month.ts +++ b/src/locales/lv/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'aprīlis', @@ -31,15 +35,15 @@ export default { 'apr.', 'aug.', 'dec.', - 'feb.', - 'jan.', + 'febr.', + 'janv.', 'jūl.', 'jūn.', - 'mai.', - 'mar.', + 'maijs', + 'marts', 'nov.', 'okt.', - 'sep.', + 'sept.', ], abbr_context: [ 'apr.', diff --git a/src/locales/lv/date/weekday.ts b/src/locales/lv/date/weekday.ts index bfda7f32a72..ea7d1a1af59 100644 --- a/src/locales/lv/date/weekday.ts +++ b/src/locales/lv/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'Ceturtdiena', @@ -17,6 +21,14 @@ export default { 'svētdien', 'trešdien', ], - abbr: ['Ct', 'Ot', 'Pk', 'Pr', 'Se', 'Sv', 'Tr'], + abbr: [ + 'Ceturtd.', + 'Otrd.', + 'Piektd.', + 'Pirmd.', + 'Sestd.', + 'Svētd.', + 'Trešd.', + ], abbr_context: ['cet.', 'otr.', 'pk.', 'pr.', 'se.', 'sv.', 'tr.'], }; diff --git a/src/locales/mk/date/month.ts b/src/locales/mk/date/month.ts index b9fd48f6773..9d3d874e2d1 100644 --- a/src/locales/mk/date/month.ts +++ b/src/locales/mk/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'август', @@ -14,17 +18,17 @@ export default { 'јуни', ], abbr: [ - 'авг', - 'апр', - 'дек', - 'мар', + 'авг.', + 'апр.', + 'дек.', + 'мар.', 'мај', - 'ное', - 'окт', - 'сеп', - 'фев', - 'јан', - 'јул', - 'јун', + 'ное.', + 'окт.', + 'сеп.', + 'фев.', + 'јан.', + 'јул.', + 'јун.', ], }; diff --git a/src/locales/mk/date/weekday.ts b/src/locales/mk/date/weekday.ts index 5d22e0520ba..ce9de574200 100644 --- a/src/locales/mk/date/weekday.ts +++ b/src/locales/mk/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'вторник', @@ -8,5 +12,5 @@ export default { 'среда', 'четврток', ], - abbr: ['вто', 'нед', 'пет', 'пон', 'саб', 'сре', 'чет'], + abbr: ['вто.', 'нед.', 'пет.', 'пон.', 'саб.', 'сре.', 'чет.'], }; diff --git a/src/locales/ne/date/index.ts b/src/locales/ne/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/ne/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/ne/date/month.ts b/src/locales/ne/date/month.ts new file mode 100644 index 00000000000..d8420ac3f1f --- /dev/null +++ b/src/locales/ne/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'अक्टोबर', + 'अगस्ट', + 'अप्रिल', + 'जनवरी', + 'जुन', + 'जुलाई', + 'डिसेम्बर', + 'नोभेम्बर', + 'फेब्रुअरी', + 'मार्च', + 'मे', + 'सेप्टेम्बर', + ], + abbr: [ + 'अक्टोबर', + 'अगस्ट', + 'अप्रिल', + 'जनवरी', + 'जुन', + 'जुलाई', + 'डिसेम्बर', + 'नोभेम्बर', + 'फेब्रुअरी', + 'मार्च', + 'मे', + 'सेप्टेम्बर', + ], +}; diff --git a/src/locales/ne/date/weekday.ts b/src/locales/ne/date/weekday.ts new file mode 100644 index 00000000000..0716649c64d --- /dev/null +++ b/src/locales/ne/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'आइतबार', + 'बिहिबार', + 'बुधबार', + 'मङ्गलबार', + 'शनिबार', + 'शुक्रबार', + 'सोमबार', + ], + abbr: ['आइत', 'बिहि', 'बुध', 'मङ्गल', 'शनि', 'शुक्र', 'सोम'], +}; diff --git a/src/locales/ne/index.ts b/src/locales/ne/index.ts index 451ad1cf570..fb117026007 100644 --- a/src/locales/ne/index.ts +++ b/src/locales/ne/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const ne: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/nl/date/month.ts b/src/locales/nl/date/month.ts index 95e953c78cf..12ca0ee8924 100644 --- a/src/locales/nl/date/month.ts +++ b/src/locales/nl/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'april', diff --git a/src/locales/nl/date/weekday.ts b/src/locales/nl/date/weekday.ts index fa7ad625822..2e8c37184ab 100644 --- a/src/locales/nl/date/weekday.ts +++ b/src/locales/nl/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'dinsdag', diff --git a/src/locales/pl/date/index.ts b/src/locales/pl/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/pl/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/pl/date/month.ts b/src/locales/pl/date/month.ts new file mode 100644 index 00000000000..c2c79ee79eb --- /dev/null +++ b/src/locales/pl/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'czerwiec', + 'grudzień', + 'kwiecień', + 'lipiec', + 'listopad', + 'luty', + 'maj', + 'marzec', + 'październik', + 'sierpień', + 'styczeń', + 'wrzesień', + ], + abbr: [ + 'cze', + 'gru', + 'kwi', + 'lip', + 'lis', + 'lut', + 'maj', + 'mar', + 'paź', + 'sie', + 'sty', + 'wrz', + ], +}; diff --git a/src/locales/pl/date/weekday.ts b/src/locales/pl/date/weekday.ts new file mode 100644 index 00000000000..a96c4bbf6ba --- /dev/null +++ b/src/locales/pl/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'czwartek', + 'niedziela', + 'piątek', + 'poniedziałek', + 'sobota', + 'wtorek', + 'środa', + ], + abbr: ['czw.', 'niedz.', 'pon.', 'pt.', 'sob.', 'wt.', 'śr.'], +}; diff --git a/src/locales/pl/index.ts b/src/locales/pl/index.ts index bdb734e2576..73250724652 100644 --- a/src/locales/pl/index.ts +++ b/src/locales/pl/index.ts @@ -7,6 +7,7 @@ import animal from './animal'; import cell_phone from './cell_phone'; import color from './color'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import lorem from './lorem'; @@ -22,6 +23,7 @@ const pl: LocaleDefinition = { cell_phone, color, company, + date, internet, location, lorem, diff --git a/src/locales/ro/date/month.ts b/src/locales/ro/date/month.ts index 7a332f536df..7e163928f57 100644 --- a/src/locales/ro/date/month.ts +++ b/src/locales/ro/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Aprilie', - 'August', - 'Decembrie', - 'Februarie', - 'Ianuarie', - 'Iulie', - 'Iunie', - 'Mai', - 'Martie', - 'Noiembrie', - 'Octombrie', - 'Septembrie', + 'aprilie', + 'august', + 'decembrie', + 'februarie', + 'ianuarie', + 'iulie', + 'iunie', + 'mai', + 'martie', + 'noiembrie', + 'octombrie', + 'septembrie', ], abbr: [ - 'Apr', - 'Aug', - 'Dec', - 'Feb', - 'Ian', - 'Iul', - 'Iun', - 'Mai', - 'Mar', - 'Noi', - 'Oct', - 'Sep', + 'apr.', + 'aug.', + 'dec.', + 'feb.', + 'ian.', + 'iul.', + 'iun.', + 'mai', + 'mar.', + 'nov.', + 'oct.', + 'sept.', ], }; diff --git a/src/locales/ro/date/weekday.ts b/src/locales/ro/date/weekday.ts index 47a34c6a109..8c946451060 100644 --- a/src/locales/ro/date/weekday.ts +++ b/src/locales/ro/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['Duminică', 'Joi', 'Luni', 'Marți', 'Miercuri', 'Sâmbătă', 'Vineri'], - abbr: ['Duminică', 'Joi', 'Luni', 'Marți', 'Miercuri', 'Sâmbătă', 'Vineri'], + wide: ['duminică', 'joi', 'luni', 'marți', 'miercuri', 'sâmbătă', 'vineri'], + abbr: ['dum.', 'joi', 'lun.', 'mar.', 'mie.', 'sâm.', 'vin.'], }; diff --git a/src/locales/ru/date/month.ts b/src/locales/ru/date/month.ts index 16e24f005bb..8eff4dd4315 100644 --- a/src/locales/ru/date/month.ts +++ b/src/locales/ru/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'август', diff --git a/src/locales/ru/date/weekday.ts b/src/locales/ru/date/weekday.ts index 53fc9009e08..73e0b907173 100644 --- a/src/locales/ru/date/weekday.ts +++ b/src/locales/ru/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Воскресенье', - 'Вторник', - 'Понедельник', - 'Пятница', - 'Среда', - 'Суббота', - 'Четверг', + 'воскресенье', + 'вторник', + 'понедельник', + 'пятница', + 'среда', + 'суббота', + 'четверг', ], wide_context: [ 'воскресенье', @@ -17,6 +21,6 @@ export default { 'суббота', 'четверг', ], - abbr: ['Вс', 'Вт', 'Пн', 'Пт', 'Сб', 'Ср', 'Чт'], + abbr: ['вс', 'вт', 'пн', 'пт', 'сб', 'ср', 'чт'], abbr_context: ['вс', 'вт', 'пн', 'пт', 'сб', 'ср', 'чт'], }; diff --git a/src/locales/sk/date/index.ts b/src/locales/sk/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/sk/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/sk/date/month.ts b/src/locales/sk/date/month.ts new file mode 100644 index 00000000000..be5a842f19d --- /dev/null +++ b/src/locales/sk/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'apríl', + 'august', + 'december', + 'február', + 'január', + 'júl', + 'jún', + 'marec', + 'máj', + 'november', + 'október', + 'september', + ], + abbr: [ + 'apr', + 'aug', + 'dec', + 'feb', + 'jan', + 'júl', + 'jún', + 'mar', + 'máj', + 'nov', + 'okt', + 'sep', + ], +}; diff --git a/src/locales/sk/date/weekday.ts b/src/locales/sk/date/weekday.ts new file mode 100644 index 00000000000..2d15cd24555 --- /dev/null +++ b/src/locales/sk/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'nedeľa', + 'piatok', + 'pondelok', + 'sobota', + 'streda', + 'utorok', + 'štvrtok', + ], + abbr: ['ne', 'pi', 'po', 'so', 'st', 'ut', 'št'], +}; diff --git a/src/locales/sk/index.ts b/src/locales/sk/index.ts index 3f274dbd0c8..a54ba46f69c 100644 --- a/src/locales/sk/index.ts +++ b/src/locales/sk/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import lorem from './lorem'; @@ -13,6 +14,7 @@ import phone_number from './phone_number'; const sk: LocaleDefinition = { company, + date, internet, location, lorem, diff --git a/src/locales/sv/date/month.ts b/src/locales/sv/date/month.ts index 1e8413ebbd5..fdd750d0863 100644 --- a/src/locales/sv/date/month.ts +++ b/src/locales/sv/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'april', @@ -14,17 +18,17 @@ export default { 'september', ], abbr: [ - 'apr', - 'aug', - 'dec', - 'feb', - 'jan', - 'jul', - 'jun', + 'apr.', + 'aug.', + 'dec.', + 'feb.', + 'jan.', + 'juli', + 'juni', 'maj', - 'mar', - 'nov', - 'okt', - 'sep', + 'mars', + 'nov.', + 'okt.', + 'sep.', ], }; diff --git a/src/locales/sv/date/weekday.ts b/src/locales/sv/date/weekday.ts index 2f1a251a23b..9b95e322647 100644 --- a/src/locales/sv/date/weekday.ts +++ b/src/locales/sv/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: ['fredag', 'lördag', 'måndag', 'onsdag', 'söndag', 'tisdag', 'torsdag'], - abbr: ['fre', 'lör', 'mån', 'ons', 'sön', 'tis', 'tor'], + abbr: ['fre', 'lör', 'mån', 'ons', 'sön', 'tis', 'tors'], }; diff --git a/src/locales/th/date/month.ts b/src/locales/th/date/month.ts index 272a839cc74..73844dadce1 100644 --- a/src/locales/th/date/month.ts +++ b/src/locales/th/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'กรกฎาคม', diff --git a/src/locales/th/date/weekday.ts b/src/locales/th/date/weekday.ts index f6b3fecc596..73ecfb73f9b 100644 --- a/src/locales/th/date/weekday.ts +++ b/src/locales/th/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'วันจันทร์', diff --git a/src/locales/tr/date/index.ts b/src/locales/tr/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/tr/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/tr/date/month.ts b/src/locales/tr/date/month.ts new file mode 100644 index 00000000000..12c40cd6304 --- /dev/null +++ b/src/locales/tr/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Aralık', + 'Ağustos', + 'Ekim', + 'Eylül', + 'Haziran', + 'Kasım', + 'Mart', + 'Mayıs', + 'Nisan', + 'Ocak', + 'Temmuz', + 'Şubat', + ], + abbr: [ + 'Ara', + 'Ağu', + 'Eki', + 'Eyl', + 'Haz', + 'Kas', + 'Mar', + 'May', + 'Nis', + 'Oca', + 'Tem', + 'Şub', + ], +}; diff --git a/src/locales/tr/date/weekday.ts b/src/locales/tr/date/weekday.ts new file mode 100644 index 00000000000..c3cd0fd62c9 --- /dev/null +++ b/src/locales/tr/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Cuma', + 'Cumartesi', + 'Pazar', + 'Pazartesi', + 'Perşembe', + 'Salı', + 'Çarşamba', + ], + abbr: ['Cmt', 'Cum', 'Paz', 'Per', 'Pzt', 'Sal', 'Çar'], +}; diff --git a/src/locales/tr/index.ts b/src/locales/tr/index.ts index b72e18540f7..7a74d7b6187 100644 --- a/src/locales/tr/index.ts +++ b/src/locales/tr/index.ts @@ -6,6 +6,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import color from './color'; import commerce from './commerce'; +import date from './date'; import internet from './internet'; import location from './location'; import lorem from './lorem'; @@ -17,6 +18,7 @@ const tr: LocaleDefinition = { cell_phone, color, commerce, + date, internet, location, lorem, diff --git a/src/locales/uk/date/index.ts b/src/locales/uk/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/uk/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/uk/date/month.ts b/src/locales/uk/date/month.ts new file mode 100644 index 00000000000..6d2a9021b03 --- /dev/null +++ b/src/locales/uk/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'березень', + 'вересень', + 'грудень', + 'жовтень', + 'квітень', + 'липень', + 'листопад', + 'лютий', + 'серпень', + 'січень', + 'травень', + 'червень', + ], + abbr: [ + 'бер.', + 'вер.', + 'груд.', + 'жовт.', + 'квіт.', + 'лип.', + 'лист.', + 'лют.', + 'серп.', + 'січ.', + 'трав.', + 'черв.', + ], +}; diff --git a/src/locales/uk/date/weekday.ts b/src/locales/uk/date/weekday.ts new file mode 100644 index 00000000000..0ee02652ef3 --- /dev/null +++ b/src/locales/uk/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'вівторок', + 'неділя', + 'пʼятниця', + 'понеділок', + 'середа', + 'субота', + 'четвер', + ], + abbr: ['вт', 'нд', 'пн', 'пт', 'сб', 'ср', 'чт'], +}; diff --git a/src/locales/uk/index.ts b/src/locales/uk/index.ts index 31ba1899e67..e92306413db 100644 --- a/src/locales/uk/index.ts +++ b/src/locales/uk/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const uk: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/ur/date/month.ts b/src/locales/ur/date/month.ts index c4b89ff49c4..0f17c4f6412 100644 --- a/src/locales/ur/date/month.ts +++ b/src/locales/ur/date/month.ts @@ -1,16 +1,33 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - abbr: null, + abbr: [ + 'اپریل', + 'اکتوبر', + 'اگست', + 'جنوری', + 'جولائی', + 'جون', + 'دسمبر', + 'ستمبر', + 'فروری', + 'مئی', + 'مارچ', + 'نومبر', + ], wide: [ 'اپریل', 'اکتوبر', 'اگست', 'جنوری', - 'جولائ', + 'جولائی', 'جون', 'دسمبر', 'ستمبر', 'فروری', - 'مئ', + 'مئی', 'مارچ', 'نومبر', ], diff --git a/src/locales/ur/date/weekday.ts b/src/locales/ur/date/weekday.ts index d5ebd0c4d43..2ddeb999a04 100644 --- a/src/locales/ur/date/weekday.ts +++ b/src/locales/ur/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - abbr: null, - wide: ['اتور', 'بدھ', 'جمعرات', 'جمعہ', 'منگل', 'پیر', 'ہفتہ'], + abbr: ['اتوار', 'بدھ', 'جمعرات', 'جمعہ', 'منگل', 'پیر', 'ہفتہ'], + wide: ['اتوار', 'بدھ', 'جمعرات', 'جمعہ', 'منگل', 'پیر', 'ہفتہ'], }; diff --git a/src/locales/vi/date/month.ts b/src/locales/vi/date/month.ts index dbdb788bc4a..28ae2b898f9 100644 --- a/src/locales/vi/date/month.ts +++ b/src/locales/vi/date/month.ts @@ -1,17 +1,21 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Tháng Ba', - 'Tháng Bảy', - 'Tháng Chín', - 'Tháng Giêng', - 'Tháng Hai', - 'Tháng Mười', - 'Tháng Mười Hai', - 'Tháng Mười Một', - 'Tháng Năm', - 'Tháng Sáu', - 'Tháng Tám', - 'Tháng Tư', + 'Tháng 1', + 'Tháng 10', + 'Tháng 11', + 'Tháng 12', + 'Tháng 2', + 'Tháng 3', + 'Tháng 4', + 'Tháng 5', + 'Tháng 6', + 'Tháng 7', + 'Tháng 8', + 'Tháng 9', ], abbr: [ 'Tháng 1', diff --git a/src/locales/vi/date/weekday.ts b/src/locales/vi/date/weekday.ts index 0ad90d0b226..6883ea6fb00 100644 --- a/src/locales/vi/date/weekday.ts +++ b/src/locales/vi/date/weekday.ts @@ -1,14 +1,18 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Chủ nhật', - 'Thứ ba', - 'Thứ bảy', - 'Thứ hai', - 'Thứ năm', - 'Thứ sáu', - 'Thứ tư', + 'Chủ Nhật', + 'Thứ Ba', + 'Thứ Bảy', + 'Thứ Hai', + 'Thứ Năm', + 'Thứ Sáu', + 'Thứ Tư', ], - abbr: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + abbr: ['CN', 'Th 2', 'Th 3', 'Th 4', 'Th 5', 'Th 6', 'Th 7'], abbr_context: [ 'C.Nhật', 'Thứ 2', From 2a84b1991ce9125efa77e5a8970f1faa134750f9 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Thu, 23 May 2024 22:28:47 +0900 Subject: [PATCH 15/20] fix: Replace underscores with dashes in Intl.DateTimeFormat locale --- scripts/generate-locales.ts | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index f2111b167f5..25caca7af6d 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -416,12 +416,18 @@ async function generateDateModule(locale: string) { // Generate correct weekday values const wide: string[] = []; const abbr: string[] = []; - const intlWeekdayLong = new Intl.DateTimeFormat(locale, { - weekday: 'long', - }); - const intlWeekdayShort = new Intl.DateTimeFormat(locale, { - weekday: 'short', - }); + const intlWeekdayLong = new Intl.DateTimeFormat( + locale.replaceAll('_', '-'), + { + weekday: 'long', + } + ); + const intlWeekdayShort = new Intl.DateTimeFormat( + locale.replaceAll('_', '-'), + { + weekday: 'short', + } + ); for (let i = 0; i < 7; i++) { const date: Date = new Date(2020, 0, i + 4); // January 4-10, 2020 are Sunday to Saturday @@ -457,8 +463,13 @@ async function generateDateModule(locale: string) { // Generate correct month values const wide: string[] = []; const abbr: string[] = []; - const intlMonthLong = new Intl.DateTimeFormat(locale, { month: 'long' }); - const intlMonthShort = new Intl.DateTimeFormat(locale, { month: 'short' }); + const intlMonthLong = new Intl.DateTimeFormat(locale.replaceAll('_', '-'), { + month: 'long', + }); + const intlMonthShort = new Intl.DateTimeFormat( + locale.replaceAll('_', '-'), + { month: 'short' } + ); for (let i = 0; i < 12; i++) { const date: Date = new Date(2020, i, 1); wide.push(intlMonthLong.format(date)); From 9ccf7dcbe5a13e2be9435f3d740af53abe3afb5e Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Thu, 23 May 2024 22:31:42 +0900 Subject: [PATCH 16/20] feat: Skip generating locale date files if identical to parent --- scripts/generate-locales.ts | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 25caca7af6d..00e32ccd823 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -400,11 +400,42 @@ async function generateDateModule(locale: string) { const pathDate = resolve(pathLocales, locale, 'date'); + // Function to check if it has the same data as the parent locale + async function isParentLocaleSame( + locale: string, + fileName: string + ): Promise { + const parentLocale = locale.split('_').slice(0, -1).join('_'); + if (!parentLocale) return false; + + const parentFilePath = resolve(pathLocales, parentLocale, 'date', fileName); + const currentFilePath = resolve(pathDate, fileName); + + try { + const [parentFileContent, currentFileContent] = await Promise.all([ + readFile(parentFilePath, 'utf8'), + readFile(currentFilePath, 'utf8'), + ]); + + return parentFileContent === currentFileContent; + } catch { + return false; + } + } + // `src/locales//date/weekday.ts` async function generateWeekdayFile(): Promise { const weekdayPath = resolve(pathDate, 'weekday.ts'); let storedWeekdays: Partial = {}; + // Skip creation if it has the same data as the parent locale + if (await isParentLocaleSame(locale, 'weekday.ts')) { + console.log( + `Skipping weekday file generation for locale ${locale} as it is identical to its parent.` + ); + return; + } + // Import the current weekday values try { const imported = await import(`file:${weekdayPath}`); @@ -452,6 +483,14 @@ async function generateDateModule(locale: string) { const monthPath = resolve(pathDate, 'month.ts'); let storedMonths: Partial = {}; + // Skip creation if it has the same data as the parent locale + if (await isParentLocaleSame(locale, 'month.ts')) { + console.log( + `Skipping month file generation for locale ${locale} as it is identical to its parent.` + ); + return; + } + // Import the current month values try { const imported = await import(`file:${monthPath}`); From 7ab5dd2bdd11ae7f5978f6e78f4883ffcab88ec9 Mon Sep 17 00:00:00 2001 From: jang_yoonsu Date: Fri, 24 May 2024 22:46:33 +0900 Subject: [PATCH 17/20] refactor : Move invalidLocale function inside generateDateModule and update locale format --- scripts/generate-locales.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 00e32ccd823..3e5ed95cf13 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -126,17 +126,6 @@ function escapeField(parent: string, module: string): string { return module; } -function isValidLocale(locale: string): boolean { - // 'dv' (Dhivehi) locale is excluded because it may not be fully supported - if (locale === 'dv') return false; - try { - new Intl.DateTimeFormat(locale); - return true; - } catch { - return false; - } -} - function normalizeDataRecursive(localeData: T): T { if (typeof localeData !== 'object' || localeData === null) { // we can only traverse object-like structs @@ -396,6 +385,17 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { // `src/locales//date/* async function generateDateModule(locale: string) { + function isValidLocale(locale: string): boolean { + // 'dv' (Dhivehi) locale is excluded because it may not be fully supported + if (locale === 'dv') return false; + try { + new Intl.DateTimeFormat(locale.replaceAll('_', '-')); + return true; + } catch { + return false; + } + } + if (!isValidLocale(locale)) return; const pathDate = resolve(pathLocales, locale, 'date'); From a09f70dcbd69051c2018f92aec8f62977e04b9ea Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 18 Jun 2024 23:43:26 +0200 Subject: [PATCH 18/20] chore: generate files only when needed --- scripts/generate-locales.ts | 177 +++++++++++++++++++----------------- 1 file changed, 96 insertions(+), 81 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index bbcce906e85..f3838456fa8 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -150,17 +150,24 @@ function normalizeDataRecursive(localeData: T): T { return result; } +async function exists(path: string): Promise { + try { + await access(path, constants.R_OK); + return true; + } catch { + // file is missing + return false; + } +} + async function generateLocaleFile(locale: string): Promise { const parts = locale.split('_'); const locales = [locale]; for (let i = parts.length - 1; i > 0; i--) { const fallback = parts.slice(0, i).join('_'); - try { - await access(resolve(pathLocales, fallback), constants.R_OK); + if (await exists(resolve(pathLocales, fallback))) { locales.push(fallback); - } catch { - // file is missing } } @@ -202,6 +209,11 @@ async function generateLocalesIndexFile( modules = modules.filter((file) => !file.startsWith('.')); modules = removeIndexTs(modules); modules = removeTsSuffix(modules); + + if (modules.length === 0) { + return; + } + modules.sort(); const content = [autoGeneratedCommentHeader]; @@ -382,86 +394,72 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { } // `src/locales//date/* -async function generateDateModule(locale: string) { - function isValidLocale(locale: string): boolean { +async function generateDateModule(locale: string): Promise { + const intlLocale = locale.replaceAll('_', '-'); + function isValidLocale(intlLocale: string): boolean { // 'dv' (Dhivehi) locale is excluded because it may not be fully supported if (locale === 'dv') return false; try { - new Intl.DateTimeFormat(locale.replaceAll('_', '-')); + new Intl.DateTimeFormat(intlLocale); return true; } catch { return false; } } - if (!isValidLocale(locale)) return; + if (!isValidLocale(intlLocale)) return; 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; - // Function to check if it has the same data as the parent locale - async function isParentLocaleSame( - locale: string, - fileName: string - ): Promise { - const parentLocale = locale.split('_').slice(0, -1).join('_'); - if (!parentLocale) return false; - - const parentFilePath = resolve(pathLocales, parentLocale, 'date', fileName); - const currentFilePath = resolve(pathDate, fileName); - - try { - const [parentFileContent, currentFileContent] = await Promise.all([ - readFile(parentFilePath, 'utf8'), - readFile(currentFilePath, 'utf8'), - ]); + // `src/locales//date/weekday.ts` + async function generateWeekdayFile(): Promise { + function generateWeekdays(intlLocale: string): { + wide: string[]; + abbr: string[]; + } { + const wide: string[] = []; + const abbr: string[] = []; + const intlWeekdayLong = new Intl.DateTimeFormat(intlLocale, { + weekday: 'long', + }); + const intlWeekdayShort = new Intl.DateTimeFormat(intlLocale, { + weekday: 'short', + }); + for (let i = 0; i < 7; i++) { + const date: Date = new Date(2020, 0, i + 4); + // January 4-10, 2020 are Sunday to Saturday + wide.push(intlWeekdayLong.format(date)); + abbr.push(intlWeekdayShort.format(date)); + } - return parentFileContent === currentFileContent; - } catch { - return false; + return { wide: wide.toSorted(), abbr: abbr.toSorted() }; } - } - // `src/locales//date/weekday.ts` - async function generateWeekdayFile(): Promise { const weekdayPath = resolve(pathDate, 'weekday.ts'); let storedWeekdays: Partial = {}; - // Skip creation if it has the same data as the parent locale - if (await isParentLocaleSame(locale, 'weekday.ts')) { - console.log( - `Skipping weekday file generation for locale ${locale} as it is identical to its parent.` - ); - return; - } - // Import the current weekday values try { const imported = await import(`file:${weekdayPath}`); storedWeekdays = imported.default; } catch { - console.log(`Creating weekday.ts file for locale ${locale}.`); + // File does not exist yet } // Generate correct weekday values - const wide: string[] = []; - const abbr: string[] = []; - const intlWeekdayLong = new Intl.DateTimeFormat( - locale.replaceAll('_', '-'), - { - weekday: 'long', - } - ); - const intlWeekdayShort = new Intl.DateTimeFormat( - locale.replaceAll('_', '-'), - { - weekday: 'short', + const { wide, abbr } = generateWeekdays(intlLocale); + + // Skip creation if it has the same data as the parent locale, unless the file exists already + if (parentUsable && Object.keys(storedWeekdays).length === 0) { + const parentWeekdays = generateWeekdays(parentIntlLocale); + if (JSON.stringify(parentWeekdays) === JSON.stringify({ wide, abbr })) { + return; } - ); - for (let i = 0; i < 7; i++) { - const date: Date = new Date(2020, 0, i + 4); - // January 4-10, 2020 are Sunday to Saturday - wide.push(intlWeekdayLong.format(date)); - abbr.push(intlWeekdayShort.format(date)); } storedWeekdays.wide = wide; @@ -473,44 +471,53 @@ async function generateDateModule(locale: string) { ${autoGeneratedCommentHeader} export default ${JSON.stringify(normalizedWeekdays, null, 2)}; `; + await mkdir(pathDate, { recursive: true }); return writeFile(weekdayPath, await formatTypescript(updatedContent)); } // `src/locales//date/month.ts` async function generateMonthFile(): Promise { - const monthPath = resolve(pathDate, 'month.ts'); - let storedMonths: Partial = {}; + function generateMonths(intlLocale: string): { + wide: string[]; + abbr: string[]; + } { + const wide: string[] = []; + const abbr: string[] = []; + const intlMonthLong = new Intl.DateTimeFormat(intlLocale, { + month: 'long', + }); + const intlMonthShort = new Intl.DateTimeFormat(intlLocale, { + month: 'short', + }); + for (let i = 0; i < 12; i++) { + const date: Date = new Date(2020, i, 1); + wide.push(intlMonthLong.format(date)); + abbr.push(intlMonthShort.format(date)); + } - // Skip creation if it has the same data as the parent locale - if (await isParentLocaleSame(locale, 'month.ts')) { - console.log( - `Skipping month file generation for locale ${locale} as it is identical to its parent.` - ); - return; + return { wide: wide.toSorted(), abbr: abbr.toSorted() }; } + const monthPath = resolve(pathDate, 'month.ts'); + let storedMonths: Partial = {}; + // Import the current month values try { const imported = await import(`file:${monthPath}`); storedMonths = imported.default; } catch { - console.log(`Creating month.ts file for locale ${locale}.`); + // File does not exist yet } // Generate correct month values - const wide: string[] = []; - const abbr: string[] = []; - const intlMonthLong = new Intl.DateTimeFormat(locale.replaceAll('_', '-'), { - month: 'long', - }); - const intlMonthShort = new Intl.DateTimeFormat( - locale.replaceAll('_', '-'), - { month: 'short' } - ); - for (let i = 0; i < 12; i++) { - const date: Date = new Date(2020, i, 1); - wide.push(intlMonthLong.format(date)); - abbr.push(intlMonthShort.format(date)); + const { wide, abbr } = generateMonths(intlLocale); + + // Skip creation if it has the same data as the parent locale, unless the file exists already + if (parentUsable && Object.keys(storedMonths).length === 0) { + const parentMonths = generateMonths(parentIntlLocale); + if (JSON.stringify(parentMonths) === JSON.stringify({ wide, abbr })) { + return; + } } storedMonths.wide = wide; @@ -522,13 +529,21 @@ async function generateDateModule(locale: string) { ${autoGeneratedCommentHeader} export default ${JSON.stringify(normalizedMonths, null, 2)}; `; + await mkdir(pathDate, { recursive: true }); return writeFile(monthPath, await formatTypescript(updatedContent)); } - await mkdir(pathDate, { recursive: true }); await generateWeekdayFile(); await generateMonthFile(); - return generateRecursiveModuleIndexes(pathDate, locale, 'DateDefinition', 2); + + if (await exists(pathDate)) { + return generateRecursiveModuleIndexes( + pathDate, + locale, + 'DateDefinition', + 2 + ); + } } // Start of actual logic From aeb62d6daa0958efe39063c9d15a323b45b667ec Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 18 Jun 2024 23:47:20 +0200 Subject: [PATCH 19/20] chore: generate missing files --- src/locales/af_ZA/date/index.ts | 14 +++++++ src/locales/af_ZA/date/month.ts | 34 ++++++++++++++++ src/locales/af_ZA/date/weekday.ts | 16 ++++++++ src/locales/af_ZA/index.ts | 2 + src/locales/cs_CZ/date/month.ts | 52 +++++++++++++------------ src/locales/cs_CZ/date/weekday.ts | 8 +++- src/locales/de_AT/date/index.ts | 12 ++++++ src/locales/de_AT/date/month.ts | 34 ++++++++++++++++ src/locales/de_AT/index.ts | 2 + src/locales/en_AU/date/index.ts | 12 ++++++ src/locales/en_AU/date/month.ts | 34 ++++++++++++++++ src/locales/en_AU/index.ts | 2 + 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 + src/locales/en_GB/date/index.ts | 12 ++++++ src/locales/en_GB/date/month.ts | 34 ++++++++++++++++ src/locales/en_GB/index.ts | 2 + src/locales/en_GH/date/index.ts | 12 ++++++ src/locales/en_GH/date/month.ts | 34 ++++++++++++++++ src/locales/en_GH/index.ts | 2 + src/locales/en_HK/date/index.ts | 12 ++++++ src/locales/en_HK/date/month.ts | 34 ++++++++++++++++ src/locales/en_HK/index.ts | 2 + src/locales/en_IE/date/index.ts | 12 ++++++ src/locales/en_IE/date/month.ts | 34 ++++++++++++++++ src/locales/en_IE/index.ts | 2 + src/locales/en_IN/date/index.ts | 12 ++++++ src/locales/en_IN/date/month.ts | 34 ++++++++++++++++ src/locales/en_IN/index.ts | 2 + src/locales/en_NG/date/index.ts | 12 ++++++ src/locales/en_NG/date/month.ts | 34 ++++++++++++++++ src/locales/en_NG/index.ts | 2 + src/locales/en_ZA/date/index.ts | 12 ++++++ src/locales/en_ZA/date/month.ts | 34 ++++++++++++++++ src/locales/en_ZA/index.ts | 2 + src/locales/es_MX/date/index.ts | 12 ++++++ src/locales/es_MX/date/month.ts | 34 ++++++++++++++++ src/locales/es_MX/index.ts | 2 + src/locales/fr_CA/date/index.ts | 12 ++++++ src/locales/fr_CA/date/month.ts | 34 ++++++++++++++++ src/locales/fr_CA/index.ts | 2 + src/locales/id_ID/date/month.ts | 6 ++- src/locales/id_ID/date/weekday.ts | 4 ++ src/locales/ka_GE/date/index.ts | 14 +++++++ src/locales/ka_GE/date/month.ts | 34 ++++++++++++++++ src/locales/ka_GE/date/weekday.ts | 16 ++++++++ src/locales/ka_GE/index.ts | 2 + src/locales/nb_NO/date/index.ts | 14 +++++++ src/locales/nb_NO/date/month.ts | 34 ++++++++++++++++ src/locales/nb_NO/date/weekday.ts | 16 ++++++++ src/locales/nb_NO/index.ts | 2 + src/locales/pt_BR/date/month.ts | 52 +++++++++++++------------ src/locales/pt_BR/date/weekday.ts | 16 +++++++- src/locales/pt_PT/date/month.ts | 52 +++++++++++++------------ src/locales/pt_PT/date/weekday.ts | 16 +++++++- src/locales/ro_MD/date/month.ts | 52 +++++++++++++------------ src/locales/ro_MD/date/weekday.ts | 8 +++- src/locales/sr_RS_latin/date/month.ts | 52 +++++++++++++------------ src/locales/sr_RS_latin/date/weekday.ts | 20 ++++++---- src/locales/uz_UZ_latin/date/month.ts | 24 +++++++----- src/locales/uz_UZ_latin/date/weekday.ts | 20 ++++++---- src/locales/yo_NG/date/index.ts | 14 +++++++ src/locales/yo_NG/date/month.ts | 34 ++++++++++++++++ src/locales/yo_NG/date/weekday.ts | 8 ++++ src/locales/yo_NG/index.ts | 2 + src/locales/zh_CN/date/month.ts | 4 ++ src/locales/zh_CN/date/weekday.ts | 6 ++- src/locales/zh_TW/date/month.ts | 4 ++ src/locales/zh_TW/date/weekday.ts | 6 ++- src/locales/zu_ZA/date/index.ts | 14 +++++++ src/locales/zu_ZA/date/month.ts | 34 ++++++++++++++++ src/locales/zu_ZA/date/weekday.ts | 16 ++++++++ src/locales/zu_ZA/index.ts | 2 + 75 files changed, 1161 insertions(+), 157 deletions(-) create mode 100644 src/locales/af_ZA/date/index.ts create mode 100644 src/locales/af_ZA/date/month.ts create mode 100644 src/locales/af_ZA/date/weekday.ts create mode 100644 src/locales/de_AT/date/index.ts create mode 100644 src/locales/de_AT/date/month.ts create mode 100644 src/locales/en_AU/date/index.ts create mode 100644 src/locales/en_AU/date/month.ts create mode 100644 src/locales/en_AU_ocker/date/index.ts create mode 100644 src/locales/en_AU_ocker/date/month.ts create mode 100644 src/locales/en_AU_ocker/date/weekday.ts create mode 100644 src/locales/en_GB/date/index.ts create mode 100644 src/locales/en_GB/date/month.ts create mode 100644 src/locales/en_GH/date/index.ts create mode 100644 src/locales/en_GH/date/month.ts create mode 100644 src/locales/en_HK/date/index.ts create mode 100644 src/locales/en_HK/date/month.ts create mode 100644 src/locales/en_IE/date/index.ts create mode 100644 src/locales/en_IE/date/month.ts create mode 100644 src/locales/en_IN/date/index.ts create mode 100644 src/locales/en_IN/date/month.ts create mode 100644 src/locales/en_NG/date/index.ts create mode 100644 src/locales/en_NG/date/month.ts create mode 100644 src/locales/en_ZA/date/index.ts create mode 100644 src/locales/en_ZA/date/month.ts create mode 100644 src/locales/es_MX/date/index.ts create mode 100644 src/locales/es_MX/date/month.ts create mode 100644 src/locales/fr_CA/date/index.ts create mode 100644 src/locales/fr_CA/date/month.ts create mode 100644 src/locales/ka_GE/date/index.ts create mode 100644 src/locales/ka_GE/date/month.ts create mode 100644 src/locales/ka_GE/date/weekday.ts create mode 100644 src/locales/nb_NO/date/index.ts create mode 100644 src/locales/nb_NO/date/month.ts create mode 100644 src/locales/nb_NO/date/weekday.ts create mode 100644 src/locales/yo_NG/date/index.ts create mode 100644 src/locales/yo_NG/date/month.ts create mode 100644 src/locales/yo_NG/date/weekday.ts create mode 100644 src/locales/zu_ZA/date/index.ts create mode 100644 src/locales/zu_ZA/date/month.ts create mode 100644 src/locales/zu_ZA/date/weekday.ts diff --git a/src/locales/af_ZA/date/index.ts b/src/locales/af_ZA/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/af_ZA/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/af_ZA/date/month.ts b/src/locales/af_ZA/date/month.ts new file mode 100644 index 00000000000..1f77457bb55 --- /dev/null +++ b/src/locales/af_ZA/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'April', + 'Augustus', + 'Desember', + 'Februarie', + 'Januarie', + 'Julie', + 'Junie', + 'Maart', + 'Mei', + 'November', + 'Oktober', + 'September', + ], + abbr: [ + 'Apr.', + 'Aug.', + 'Des.', + 'Feb.', + 'Jan.', + 'Jul.', + 'Jun.', + 'Mei', + 'Mrt.', + 'Nov.', + 'Okt.', + 'Sep.', + ], +}; diff --git a/src/locales/af_ZA/date/weekday.ts b/src/locales/af_ZA/date/weekday.ts new file mode 100644 index 00000000000..23a1585cc33 --- /dev/null +++ b/src/locales/af_ZA/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Dinsdag', + 'Donderdag', + 'Maandag', + 'Saterdag', + 'Sondag', + 'Vrydag', + 'Woensdag', + ], + abbr: ['Di.', 'Do.', 'Ma.', 'Sa.', 'So.', 'Vr.', 'Wo.'], +}; diff --git a/src/locales/af_ZA/index.ts b/src/locales/af_ZA/index.ts index 3bde3758c49..83c73e5f8ae 100644 --- a/src/locales/af_ZA/index.ts +++ b/src/locales/af_ZA/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -14,6 +15,7 @@ import phone_number from './phone_number'; const af_ZA: LocaleDefinition = { cell_phone, company, + date, internet, location, metadata, diff --git a/src/locales/cs_CZ/date/month.ts b/src/locales/cs_CZ/date/month.ts index 9b8c1a11fe3..bd4877810e2 100644 --- a/src/locales/cs_CZ/date/month.ts +++ b/src/locales/cs_CZ/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Březen', - 'Duben', - 'Květen', - 'Leden', - 'Listopad', - 'Prosinec', - 'Srpen', - 'Září', - 'Únor', - 'Červen', - 'Červenec', - 'Říjen', + 'březen', + 'duben', + 'květen', + 'leden', + 'listopad', + 'prosinec', + 'srpen', + 'září', + 'únor', + 'červen', + 'červenec', + 'říjen', ], abbr: [ - 'Bře', - 'Dub', - 'Kvě', - 'Led', - 'Lis', - 'Pro', - 'Srp', - 'Zář', - 'Úno', - 'Čer', - 'Črc', - 'Říj', + 'bře', + 'dub', + 'kvě', + 'led', + 'lis', + 'pro', + 'srp', + 'zář', + 'úno', + 'čvc', + 'čvn', + 'říj', ], }; diff --git a/src/locales/cs_CZ/date/weekday.ts b/src/locales/cs_CZ/date/weekday.ts index 0e669c9bcb6..00c7c815bb1 100644 --- a/src/locales/cs_CZ/date/weekday.ts +++ b/src/locales/cs_CZ/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['Neděle', 'Pondělí', 'Pátek', 'Sobota', 'Středa', 'Úterý', 'čtvrtek'], - abbr: ['Ne', 'Po', 'Pá', 'So', 'St', 'Út', 'čt'], + wide: ['neděle', 'pondělí', 'pátek', 'sobota', 'středa', 'úterý', 'čtvrtek'], + abbr: ['ne', 'po', 'pá', 'so', 'st', 'út', 'čt'], }; diff --git a/src/locales/de_AT/date/index.ts b/src/locales/de_AT/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/de_AT/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/de_AT/date/month.ts b/src/locales/de_AT/date/month.ts new file mode 100644 index 00000000000..82309653335 --- /dev/null +++ b/src/locales/de_AT/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'April', + 'August', + 'Dezember', + 'Februar', + 'Juli', + 'Juni', + 'Jänner', + 'Mai', + 'März', + 'November', + 'Oktober', + 'September', + ], + abbr: [ + 'Apr', + 'Aug', + 'Dez', + 'Feb', + 'Jul', + 'Jun', + 'Jän', + 'Mai', + 'Mär', + 'Nov', + 'Okt', + 'Sep', + ], +}; diff --git a/src/locales/de_AT/index.ts b/src/locales/de_AT/index.ts index 8ed90a8d152..8c52455c58b 100644 --- a/src/locales/de_AT/index.ts +++ b/src/locales/de_AT/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -15,6 +16,7 @@ import word from './word'; const de_AT: LocaleDefinition = { cell_phone, company, + date, internet, location, metadata, diff --git a/src/locales/en_AU/date/index.ts b/src/locales/en_AU/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_AU/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_AU/date/month.ts b/src/locales/en_AU/date/month.ts new file mode 100644 index 00000000000..7c6cfa42231 --- /dev/null +++ b/src/locales/en_AU/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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/index.ts b/src/locales/en_AU/index.ts index ee3bf460bf4..9963b0bf29b 100644 --- a/src/locales/en_AU/index.ts +++ b/src/locales/en_AU/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_AU: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_AU_ocker/date/index.ts b/src/locales/en_AU_ocker/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/en_AU_ocker/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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 new file mode 100644 index 00000000000..7c6cfa42231 --- /dev/null +++ b/src/locales/en_AU_ocker/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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 new file mode 100644 index 00000000000..90241047497 --- /dev/null +++ b/src/locales/en_AU_ocker/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * 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 6c406c508ce..2635f773781 100644 --- a/src/locales/en_AU_ocker/index.ts +++ b/src/locales/en_AU_ocker/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_AU_ocker: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_GB/date/index.ts b/src/locales/en_GB/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_GB/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_GB/date/month.ts b/src/locales/en_GB/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_GB/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_GB/index.ts b/src/locales/en_GB/index.ts index ae59fada47b..126dae6f284 100644 --- a/src/locales/en_GB/index.ts +++ b/src/locales/en_GB/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_GB: LocaleDefinition = { cell_phone, + date, internet, location, metadata, diff --git a/src/locales/en_GH/date/index.ts b/src/locales/en_GH/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_GH/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_GH/date/month.ts b/src/locales/en_GH/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_GH/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_GH/index.ts b/src/locales/en_GH/index.ts index c4ca5da3e7e..81379e5842b 100644 --- a/src/locales/en_GH/index.ts +++ b/src/locales/en_GH/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_GH: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_HK/date/index.ts b/src/locales/en_HK/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_HK/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_HK/date/month.ts b/src/locales/en_HK/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_HK/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_HK/index.ts b/src/locales/en_HK/index.ts index cbbfed81797..688dae10483 100644 --- a/src/locales/en_HK/index.ts +++ b/src/locales/en_HK/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_HK: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_IE/date/index.ts b/src/locales/en_IE/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_IE/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_IE/date/month.ts b/src/locales/en_IE/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_IE/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_IE/index.ts b/src/locales/en_IE/index.ts index c54df5435dc..a4c2a0ebe63 100644 --- a/src/locales/en_IE/index.ts +++ b/src/locales/en_IE/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_IE: LocaleDefinition = { cell_phone, + date, internet, location, metadata, diff --git a/src/locales/en_IN/date/index.ts b/src/locales/en_IN/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_IN/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_IN/date/month.ts b/src/locales/en_IN/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_IN/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_IN/index.ts b/src/locales/en_IN/index.ts index df86966d882..26f1f7ae2c6 100644 --- a/src/locales/en_IN/index.ts +++ b/src/locales/en_IN/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_IN: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_NG/date/index.ts b/src/locales/en_NG/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_NG/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_NG/date/month.ts b/src/locales/en_NG/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_NG/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_NG/index.ts b/src/locales/en_NG/index.ts index 5831d9e16b5..fabc853bedc 100644 --- a/src/locales/en_NG/index.ts +++ b/src/locales/en_NG/index.ts @@ -4,6 +4,7 @@ */ import type { LocaleDefinition } from '../..'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -12,6 +13,7 @@ import phone_number from './phone_number'; const en_NG: LocaleDefinition = { company, + date, internet, location, metadata, diff --git a/src/locales/en_ZA/date/index.ts b/src/locales/en_ZA/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/en_ZA/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/en_ZA/date/month.ts b/src/locales/en_ZA/date/month.ts new file mode 100644 index 00000000000..f2f801aff87 --- /dev/null +++ b/src/locales/en_ZA/date/month.ts @@ -0,0 +1,34 @@ +/* + * 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', + 'Jul', + 'Jun', + 'Mar', + 'May', + 'Nov', + 'Oct', + 'Sept', + ], +}; diff --git a/src/locales/en_ZA/index.ts b/src/locales/en_ZA/index.ts index 43199703d1f..8381ccf6a13 100644 --- a/src/locales/en_ZA/index.ts +++ b/src/locales/en_ZA/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -14,6 +15,7 @@ import phone_number from './phone_number'; const en_ZA: LocaleDefinition = { cell_phone, company, + date, internet, location, metadata, diff --git a/src/locales/es_MX/date/index.ts b/src/locales/es_MX/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/es_MX/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/es_MX/date/month.ts b/src/locales/es_MX/date/month.ts new file mode 100644 index 00000000000..fc6adc28212 --- /dev/null +++ b/src/locales/es_MX/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'abril', + 'agosto', + 'diciembre', + 'enero', + 'febrero', + 'julio', + 'junio', + 'marzo', + 'mayo', + 'noviembre', + 'octubre', + 'septiembre', + ], + abbr: [ + 'abr', + 'ago', + 'dic', + 'ene', + 'feb', + 'jul', + 'jun', + 'mar', + 'may', + 'nov', + 'oct', + 'sep', + ], +}; diff --git a/src/locales/es_MX/index.ts b/src/locales/es_MX/index.ts index 334e8e5a401..24c19f8d863 100644 --- a/src/locales/es_MX/index.ts +++ b/src/locales/es_MX/index.ts @@ -7,6 +7,7 @@ import cell_phone from './cell_phone'; import color from './color'; import commerce from './commerce'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import lorem from './lorem'; @@ -20,6 +21,7 @@ const es_MX: LocaleDefinition = { color, commerce, company, + date, internet, location, lorem, diff --git a/src/locales/fr_CA/date/index.ts b/src/locales/fr_CA/date/index.ts new file mode 100644 index 00000000000..8840c1c9c75 --- /dev/null +++ b/src/locales/fr_CA/date/index.ts @@ -0,0 +1,12 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { DateDefinition } from '../../..'; +import month from './month'; + +const date: DateDefinition = { + month, +}; + +export default date; diff --git a/src/locales/fr_CA/date/month.ts b/src/locales/fr_CA/date/month.ts new file mode 100644 index 00000000000..cc609d3eb52 --- /dev/null +++ b/src/locales/fr_CA/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'août', + 'avril', + 'décembre', + 'février', + 'janvier', + 'juillet', + 'juin', + 'mai', + 'mars', + 'novembre', + 'octobre', + 'septembre', + ], + abbr: [ + 'août', + 'avr.', + 'déc.', + 'févr.', + 'janv.', + 'juill.', + 'juin', + 'mai', + 'mars', + 'nov.', + 'oct.', + 'sept.', + ], +}; diff --git a/src/locales/fr_CA/index.ts b/src/locales/fr_CA/index.ts index 0d4a749efbe..24bd947b260 100644 --- a/src/locales/fr_CA/index.ts +++ b/src/locales/fr_CA/index.ts @@ -3,6 +3,7 @@ * Run 'pnpm run generate:locales' to update. */ import type { LocaleDefinition } from '../..'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -10,6 +11,7 @@ import person from './person'; import phone_number from './phone_number'; const fr_CA: LocaleDefinition = { + date, internet, location, metadata, diff --git a/src/locales/id_ID/date/month.ts b/src/locales/id_ID/date/month.ts index d1a3b4930a4..6d8681d0f82 100644 --- a/src/locales/id_ID/date/month.ts +++ b/src/locales/id_ID/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'Agustus', @@ -14,7 +18,7 @@ export default { 'September', ], abbr: [ - 'Ags', + 'Agu', 'Apr', 'Des', 'Feb', diff --git a/src/locales/id_ID/date/weekday.ts b/src/locales/id_ID/date/weekday.ts index bbd76e01b6e..9e90bded07a 100644 --- a/src/locales/id_ID/date/weekday.ts +++ b/src/locales/id_ID/date/weekday.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: ['Jumat', 'Kamis', 'Minggu', 'Rabu', 'Sabtu', 'Selasa', 'Senin'], abbr: ['Jum', 'Kam', 'Min', 'Rab', 'Sab', 'Sel', 'Sen'], diff --git a/src/locales/ka_GE/date/index.ts b/src/locales/ka_GE/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/ka_GE/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/ka_GE/date/month.ts b/src/locales/ka_GE/date/month.ts new file mode 100644 index 00000000000..5d4af5bacf4 --- /dev/null +++ b/src/locales/ka_GE/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'აგვისტო', + 'აპრილი', + 'დეკემბერი', + 'თებერვალი', + 'იანვარი', + 'ივლისი', + 'ივნისი', + 'მაისი', + 'მარტი', + 'ნოემბერი', + 'ოქტომბერი', + 'სექტემბერი', + ], + abbr: [ + 'აგვ', + 'აპრ', + 'დეკ', + 'თებ', + 'იან', + 'ივლ', + 'ივნ', + 'მაი', + 'მარ', + 'ნოე', + 'ოქტ', + 'სექ', + ], +}; diff --git a/src/locales/ka_GE/date/weekday.ts b/src/locales/ka_GE/date/weekday.ts new file mode 100644 index 00000000000..4a9341e816f --- /dev/null +++ b/src/locales/ka_GE/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'კვირა', + 'ოთხშაბათი', + 'ორშაბათი', + 'პარასკევი', + 'სამშაბათი', + 'შაბათი', + 'ხუთშაბათი', + ], + abbr: ['კვი', 'ოთხ', 'ორშ', 'პარ', 'სამ', 'შაბ', 'ხუთ'], +}; diff --git a/src/locales/ka_GE/index.ts b/src/locales/ka_GE/index.ts index ea959663f60..5b6f7e61d13 100644 --- a/src/locales/ka_GE/index.ts +++ b/src/locales/ka_GE/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -14,6 +15,7 @@ import phone_number from './phone_number'; const ka_GE: LocaleDefinition = { cell_phone, company, + date, internet, location, metadata, diff --git a/src/locales/nb_NO/date/index.ts b/src/locales/nb_NO/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/nb_NO/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/nb_NO/date/month.ts b/src/locales/nb_NO/date/month.ts new file mode 100644 index 00000000000..909c4e98adb --- /dev/null +++ b/src/locales/nb_NO/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'april', + 'august', + 'desember', + 'februar', + 'januar', + 'juli', + 'juni', + 'mai', + 'mars', + 'november', + 'oktober', + 'september', + ], + abbr: [ + 'apr', + 'aug', + 'des', + 'feb', + 'jan', + 'jul', + 'jun', + 'mai', + 'mar', + 'nov', + 'okt', + 'sep', + ], +}; diff --git a/src/locales/nb_NO/date/weekday.ts b/src/locales/nb_NO/date/weekday.ts new file mode 100644 index 00000000000..dee22693421 --- /dev/null +++ b/src/locales/nb_NO/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'fredag', + 'lørdag', + 'mandag', + 'onsdag', + 'søndag', + 'tirsdag', + 'torsdag', + ], + abbr: ['fre.', 'lør.', 'man.', 'ons.', 'søn.', 'tir.', 'tor.'], +}; diff --git a/src/locales/nb_NO/index.ts b/src/locales/nb_NO/index.ts index d9fa3d48875..1ef037e432a 100644 --- a/src/locales/nb_NO/index.ts +++ b/src/locales/nb_NO/index.ts @@ -6,6 +6,7 @@ import type { LocaleDefinition } from '../..'; import color from './color'; import commerce from './commerce'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -18,6 +19,7 @@ const nb_NO: LocaleDefinition = { color, commerce, company, + date, internet, location, metadata, diff --git a/src/locales/pt_BR/date/month.ts b/src/locales/pt_BR/date/month.ts index 4b748865089..c76f63e28c7 100644 --- a/src/locales/pt_BR/date/month.ts +++ b/src/locales/pt_BR/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Abril', - 'Agosto', - 'Dezembro', - 'Fevereiro', - 'Janeiro', - 'Julho', - 'Junho', - 'Maio', - 'Março', - 'Novembro', - 'Outubro', - 'Setembro', + 'abril', + 'agosto', + 'dezembro', + 'fevereiro', + 'janeiro', + 'julho', + 'junho', + 'maio', + 'março', + 'novembro', + 'outubro', + 'setembro', ], abbr: [ - 'Abr', - 'Ago', - 'Dez', - 'Fev', - 'Jan', - 'Jul', - 'Jun', - 'Mai', - 'Mar', - 'Nov', - 'Out', - 'Set', + 'abr.', + 'ago.', + 'dez.', + 'fev.', + 'jan.', + 'jul.', + 'jun.', + 'mai.', + 'mar.', + 'nov.', + 'out.', + 'set.', ], }; diff --git a/src/locales/pt_BR/date/weekday.ts b/src/locales/pt_BR/date/weekday.ts index eade3fdc5f0..e782796ba8a 100644 --- a/src/locales/pt_BR/date/weekday.ts +++ b/src/locales/pt_BR/date/weekday.ts @@ -1,4 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['Domingo', 'Quarta', 'Quinta', 'Segunda', 'Sexta', 'Sábado', 'Terça'], - abbr: ['Dom', 'Qua', 'Qui', 'Seg', 'Sex', 'Sáb', 'Ter'], + wide: [ + 'domingo', + 'quarta-feira', + 'quinta-feira', + 'segunda-feira', + 'sexta-feira', + 'sábado', + 'terça-feira', + ], + abbr: ['dom.', 'qua.', 'qui.', 'seg.', 'sex.', 'sáb.', 'ter.'], }; diff --git a/src/locales/pt_PT/date/month.ts b/src/locales/pt_PT/date/month.ts index 4b748865089..c76f63e28c7 100644 --- a/src/locales/pt_PT/date/month.ts +++ b/src/locales/pt_PT/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Abril', - 'Agosto', - 'Dezembro', - 'Fevereiro', - 'Janeiro', - 'Julho', - 'Junho', - 'Maio', - 'Março', - 'Novembro', - 'Outubro', - 'Setembro', + 'abril', + 'agosto', + 'dezembro', + 'fevereiro', + 'janeiro', + 'julho', + 'junho', + 'maio', + 'março', + 'novembro', + 'outubro', + 'setembro', ], abbr: [ - 'Abr', - 'Ago', - 'Dez', - 'Fev', - 'Jan', - 'Jul', - 'Jun', - 'Mai', - 'Mar', - 'Nov', - 'Out', - 'Set', + 'abr.', + 'ago.', + 'dez.', + 'fev.', + 'jan.', + 'jul.', + 'jun.', + 'mai.', + 'mar.', + 'nov.', + 'out.', + 'set.', ], }; diff --git a/src/locales/pt_PT/date/weekday.ts b/src/locales/pt_PT/date/weekday.ts index eade3fdc5f0..930d3a81e81 100644 --- a/src/locales/pt_PT/date/weekday.ts +++ b/src/locales/pt_PT/date/weekday.ts @@ -1,4 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['Domingo', 'Quarta', 'Quinta', 'Segunda', 'Sexta', 'Sábado', 'Terça'], - abbr: ['Dom', 'Qua', 'Qui', 'Seg', 'Sex', 'Sáb', 'Ter'], + wide: [ + 'domingo', + 'quarta-feira', + 'quinta-feira', + 'segunda-feira', + 'sexta-feira', + 'sábado', + 'terça-feira', + ], + abbr: ['domingo', 'quarta', 'quinta', 'segunda', 'sexta', 'sábado', 'terça'], }; diff --git a/src/locales/ro_MD/date/month.ts b/src/locales/ro_MD/date/month.ts index 7a332f536df..7e163928f57 100644 --- a/src/locales/ro_MD/date/month.ts +++ b/src/locales/ro_MD/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Aprilie', - 'August', - 'Decembrie', - 'Februarie', - 'Ianuarie', - 'Iulie', - 'Iunie', - 'Mai', - 'Martie', - 'Noiembrie', - 'Octombrie', - 'Septembrie', + 'aprilie', + 'august', + 'decembrie', + 'februarie', + 'ianuarie', + 'iulie', + 'iunie', + 'mai', + 'martie', + 'noiembrie', + 'octombrie', + 'septembrie', ], abbr: [ - 'Apr', - 'Aug', - 'Dec', - 'Feb', - 'Ian', - 'Iul', - 'Iun', - 'Mai', - 'Mar', - 'Noi', - 'Oct', - 'Sep', + 'apr.', + 'aug.', + 'dec.', + 'feb.', + 'ian.', + 'iul.', + 'iun.', + 'mai', + 'mar.', + 'nov.', + 'oct.', + 'sept.', ], }; diff --git a/src/locales/ro_MD/date/weekday.ts b/src/locales/ro_MD/date/weekday.ts index e334fefb781..a6bb895e7e2 100644 --- a/src/locales/ro_MD/date/weekday.ts +++ b/src/locales/ro_MD/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['Duminică', 'Joi', 'Luni', 'Marți', 'Miercuri', 'Sâmbătă', 'Vineri'], - abbr: ['Du', 'Jo', 'Lu', 'Ma', 'Mi', 'Sâ', 'Vi'], + wide: ['duminică', 'joi', 'luni', 'marți', 'miercuri', 'sâmbătă', 'vineri'], + abbr: ['Dum', 'Joi', 'Lun', 'Mar', 'Mie', 'Sâm', 'Vin'], }; diff --git a/src/locales/sr_RS_latin/date/month.ts b/src/locales/sr_RS_latin/date/month.ts index 756f701be20..24dcbe2c4f8 100644 --- a/src/locales/sr_RS_latin/date/month.ts +++ b/src/locales/sr_RS_latin/date/month.ts @@ -1,30 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'april', - 'avgust', - 'decembar', - 'februar', - 'januar', - 'jul', - 'jun', - 'maj', - 'mart', - 'novembar', - 'oktobar', - 'septembar', + 'август', + 'април', + 'децембар', + 'март', + 'мај', + 'новембар', + 'октобар', + 'септембар', + 'фебруар', + 'јануар', + 'јул', + 'јун', ], abbr: [ - 'apr', - 'avg', - 'dec', - 'feb', - 'jan', - 'jul', - 'jun', - 'maj', - 'mar', - 'nov', - 'okt', - 'sep', + 'авг', + 'апр', + 'дец', + 'мар', + 'мај', + 'нов', + 'окт', + 'сеп', + 'феб', + 'јан', + 'јул', + 'јун', ], }; diff --git a/src/locales/sr_RS_latin/date/weekday.ts b/src/locales/sr_RS_latin/date/weekday.ts index a08f11ccfd4..0c58979be55 100644 --- a/src/locales/sr_RS_latin/date/weekday.ts +++ b/src/locales/sr_RS_latin/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'nedelja', - 'petak', - 'ponedeljak', - 'sreda', - 'subota', - 'utorak', - 'četvrtak', + 'недеља', + 'петак', + 'понедељак', + 'среда', + 'субота', + 'уторак', + 'четвртак', ], - abbr: ['ned', 'pet', 'pon', 'sre', 'sub', 'uto', 'čet'], + abbr: ['нед', 'пет', 'пон', 'сре', 'суб', 'уто', 'чет'], }; diff --git a/src/locales/uz_UZ_latin/date/month.ts b/src/locales/uz_UZ_latin/date/month.ts index cd80acd9b4d..0d457cf3d10 100644 --- a/src/locales/uz_UZ_latin/date/month.ts +++ b/src/locales/uz_UZ_latin/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ 'Aprel', @@ -9,22 +13,22 @@ export default { 'Mart', 'May', 'Noyabr', - 'Oktyabr', - 'Sentyabr', + 'Oktabr', + 'Sentabr', 'Yanvar', ], abbr: [ - 'Apr.', - 'Avg.', - 'Dek.', - 'Fev.', + 'Apr', + 'Avg', + 'Dek', + 'Fev', 'Iyl', 'Iyn', 'Mar', 'May', - 'Noy.', - 'Okt.', - 'Sen.', - 'Yan.', + 'Noy', + 'Okt', + 'Sen', + 'Yan', ], }; diff --git a/src/locales/uz_UZ_latin/date/weekday.ts b/src/locales/uz_UZ_latin/date/weekday.ts index d34a71d01a7..73cb973d8a7 100644 --- a/src/locales/uz_UZ_latin/date/weekday.ts +++ b/src/locales/uz_UZ_latin/date/weekday.ts @@ -1,12 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ - 'Chorshanba', - 'Dushanba', - 'Juma', - 'Payshanba', - 'Seshanba', - 'Shanba', - 'Yakshanba', + 'chorshanba', + 'dushanba', + 'juma', + 'payshanba', + 'seshanba', + 'shanba', + 'yakshanba', ], - abbr: ['Ch', 'Du', 'Ju', 'Pa', 'Se', 'Sh', 'Ya'], + abbr: ['Chor', 'Dush', 'Jum', 'Pay', 'Sesh', 'Shan', 'Yak'], }; diff --git a/src/locales/yo_NG/date/index.ts b/src/locales/yo_NG/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/yo_NG/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/yo_NG/date/month.ts b/src/locales/yo_NG/date/month.ts new file mode 100644 index 00000000000..d77206985a7 --- /dev/null +++ b/src/locales/yo_NG/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Agẹmọ', + 'Bélú', + 'Owewe', + 'Èrèlè', + 'Ìgbé', + 'Ògún', + 'Òkúdu', + 'Ṣẹ́rẹ́', + 'Ẹrẹ̀nà', + 'Ẹ̀bibi', + 'Ọ̀pẹ̀', + 'Ọ̀wàrà', + ], + abbr: [ + 'Ag', + 'Bé', + 'Ow', + 'Èr', + 'Ìg', + 'Òg', + 'Òk', + 'Ṣẹ́', + 'Ẹr', + 'Ẹ̀b', + 'Ọ̀p', + 'Ọ̀w', + ], +}; diff --git a/src/locales/yo_NG/date/weekday.ts b/src/locales/yo_NG/date/weekday.ts new file mode 100644 index 00000000000..cfa04ce1135 --- /dev/null +++ b/src/locales/yo_NG/date/weekday.ts @@ -0,0 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: ['Ajé', 'Àbámẹ́ta', 'Àìkú', 'Ìsẹ́gun', 'Ẹtì', 'Ọjọ́bọ', 'Ọjọ́rú'], + abbr: ['Aj', 'Àbám', 'Àìk', 'Ìsẹ́g', 'Ẹt', 'Ọjọ́b', 'Ọjọ́r'], +}; diff --git a/src/locales/yo_NG/index.ts b/src/locales/yo_NG/index.ts index 967e785c2fd..c0f3edde51c 100644 --- a/src/locales/yo_NG/index.ts +++ b/src/locales/yo_NG/index.ts @@ -3,10 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { LocaleDefinition } from '../..'; +import date from './date'; import metadata from './metadata'; import person from './person'; const yo_NG: LocaleDefinition = { + date, metadata, person, }; diff --git a/src/locales/zh_CN/date/month.ts b/src/locales/zh_CN/date/month.ts index ff2d0a3198d..674b19e4c4c 100644 --- a/src/locales/zh_CN/date/month.ts +++ b/src/locales/zh_CN/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ '一月', diff --git a/src/locales/zh_CN/date/weekday.ts b/src/locales/zh_CN/date/weekday.ts index 39458f702c1..8e8f60d63d0 100644 --- a/src/locales/zh_CN/date/weekday.ts +++ b/src/locales/zh_CN/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['星期一', '星期三', '星期二', '星期五', '星期六', '星期四', '星期天'], + wide: ['星期一', '星期三', '星期二', '星期五', '星期六', '星期四', '星期日'], abbr: ['周一', '周三', '周二', '周五', '周六', '周四', '周日'], }; diff --git a/src/locales/zh_TW/date/month.ts b/src/locales/zh_TW/date/month.ts index 43552860234..b00f915c375 100644 --- a/src/locales/zh_TW/date/month.ts +++ b/src/locales/zh_TW/date/month.ts @@ -1,3 +1,7 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { wide: [ '10月', diff --git a/src/locales/zh_TW/date/weekday.ts b/src/locales/zh_TW/date/weekday.ts index 01cc05e09f0..ac5c36d5767 100644 --- a/src/locales/zh_TW/date/weekday.ts +++ b/src/locales/zh_TW/date/weekday.ts @@ -1,4 +1,8 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ export default { - wide: ['星期一', '星期三', '星期二', '星期五', '星期六', '星期四', '星期天'], + wide: ['星期一', '星期三', '星期二', '星期五', '星期六', '星期四', '星期日'], abbr: ['週一', '週三', '週二', '週五', '週六', '週四', '週日'], }; diff --git a/src/locales/zu_ZA/date/index.ts b/src/locales/zu_ZA/date/index.ts new file mode 100644 index 00000000000..a28ce823bb8 --- /dev/null +++ b/src/locales/zu_ZA/date/index.ts @@ -0,0 +1,14 @@ +/* + * 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/zu_ZA/date/month.ts b/src/locales/zu_ZA/date/month.ts new file mode 100644 index 00000000000..296858f2d5b --- /dev/null +++ b/src/locales/zu_ZA/date/month.ts @@ -0,0 +1,34 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'Agasti', + 'Disemba', + 'Ephreli', + 'Februwari', + 'Januwari', + 'Julayi', + 'Juni', + 'Mashi', + 'Meyi', + 'Novemba', + 'Okthoba', + 'Septhemba', + ], + abbr: [ + 'Aga', + 'Dis', + 'Eph', + 'Feb', + 'Jan', + 'Jul', + 'Jun', + 'Mas', + 'Mey', + 'Nov', + 'Okt', + 'Sep', + ], +}; diff --git a/src/locales/zu_ZA/date/weekday.ts b/src/locales/zu_ZA/date/weekday.ts new file mode 100644 index 00000000000..808bba72097 --- /dev/null +++ b/src/locales/zu_ZA/date/weekday.ts @@ -0,0 +1,16 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +export default { + wide: [ + 'ISonto', + 'ULwesibili', + 'ULwesihlanu', + 'ULwesine', + 'ULwesithathu', + 'UMgqibelo', + 'UMsombuluko', + ], + abbr: ['Bil', 'Hla', 'Mgq', 'Mso', 'Sin', 'Son', 'Tha'], +}; diff --git a/src/locales/zu_ZA/index.ts b/src/locales/zu_ZA/index.ts index 0e86ac702ec..79b86578739 100644 --- a/src/locales/zu_ZA/index.ts +++ b/src/locales/zu_ZA/index.ts @@ -5,6 +5,7 @@ import type { LocaleDefinition } from '../..'; import cell_phone from './cell_phone'; import company from './company'; +import date from './date'; import internet from './internet'; import location from './location'; import metadata from './metadata'; @@ -14,6 +15,7 @@ import phone_number from './phone_number'; const zu_ZA: LocaleDefinition = { cell_phone, company, + date, internet, location, metadata, From 78c7183a1fbcb70a9210b5fcd3c712016910f513 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 18 Jun 2024 23:57:40 +0200 Subject: [PATCH 20/20] 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,