diff options
| author | Pradeeep G <[email protected]> | 2025-04-10 23:32:43 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-10 20:02:43 +0200 |
| commit | cdf6dc4a973b8e64069f8b8d98e6921188f08575 (patch) | |
| tree | d396f3906b184b55c108ef6eae15873428c8dfa3 | |
| parent | e2efa601b3f073cbca68fa0d396acbace685a1ce (diff) | |
| download | faker-cdf6dc4a973b8e64069f8b8d98e6921188f08575.tar.xz faker-cdf6dc4a973b8e64069f8b8d98e6921188f08575.zip | |
feat(locale): add Tamil language support (#3468)
| -rw-r--r-- | docs/guide/localization.md | 1 | ||||
| -rw-r--r-- | src/locale/index.ts | 3 | ||||
| -rw-r--r-- | src/locale/ta_IN.ts | 25 | ||||
| -rw-r--r-- | src/locales/index.ts | 3 | ||||
| -rw-r--r-- | src/locales/ta_IN/date/index.ts | 14 | ||||
| -rw-r--r-- | src/locales/ta_IN/date/month.ts | 30 | ||||
| -rw-r--r-- | src/locales/ta_IN/date/weekday.ts | 4 | ||||
| -rw-r--r-- | src/locales/ta_IN/index.ts | 20 | ||||
| -rw-r--r-- | src/locales/ta_IN/metadata.ts | 13 | ||||
| -rw-r--r-- | test/__snapshots__/locale-data.spec.ts.snap | 1 | ||||
| -rw-r--r-- | test/locale-imports.spec.ts | 1 |
11 files changed, 115 insertions, 0 deletions
diff --git a/docs/guide/localization.md b/docs/guide/localization.md index 61abade1..ffab0b76 100644 --- a/docs/guide/localization.md +++ b/docs/guide/localization.md @@ -110,6 +110,7 @@ In this example there are 5 locales. Each of these is checked in order, and the | `sk` | Slovak | `fakerSK` | | `sr_RS_latin` | Serbian (Serbia, Latin) | `fakerSR_RS_latin` | | `sv` | Swedish | `fakerSV` | +| `ta_IN` | Tamil (India) | `fakerTA_IN` | | `th` | Thai | `fakerTH` | | `tr` | Turkish | `fakerTR` | | `uk` | Ukrainian | `fakerUK` | diff --git a/src/locale/index.ts b/src/locale/index.ts index 2ef2120c..b067b6ff 100644 --- a/src/locale/index.ts +++ b/src/locale/index.ts @@ -63,6 +63,7 @@ import { faker as fakerRU } from './ru'; import { faker as fakerSK } from './sk'; import { faker as fakerSR_RS_latin } from './sr_RS_latin'; import { faker as fakerSV } from './sv'; +import { faker as fakerTA_IN } from './ta_IN'; import { faker as fakerTH } from './th'; import { faker as fakerTR } from './tr'; import { faker as fakerUK } from './uk'; @@ -134,6 +135,7 @@ export { faker as fakerRU } from './ru'; export { faker as fakerSK } from './sk'; export { faker as fakerSR_RS_latin } from './sr_RS_latin'; export { faker as fakerSV } from './sv'; +export { faker as fakerTA_IN } from './ta_IN'; export { faker as fakerTH } from './th'; export { faker as fakerTR } from './tr'; export { faker as fakerUK } from './uk'; @@ -206,6 +208,7 @@ export const allFakers = { sk: fakerSK, sr_RS_latin: fakerSR_RS_latin, sv: fakerSV, + ta_IN: fakerTA_IN, th: fakerTH, tr: fakerTR, uk: fakerUK, diff --git a/src/locale/ta_IN.ts b/src/locale/ta_IN.ts new file mode 100644 index 00000000..79092b9a --- /dev/null +++ b/src/locale/ta_IN.ts @@ -0,0 +1,25 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ + +import { Faker } from '../faker'; +import base from '../locales/base'; +import en from '../locales/en'; +import ta_IN from '../locales/ta_IN'; + +/** + * The faker instance for the `ta_IN` locale. + * + * - Language: Tamil (India) + * - Endonym: தமிழ் (இந்தியா) + * + * This instance uses the following locales internally (in descending precedence): + * + * - `ta_IN` + * - `en` + * - `base` + */ +export const faker = new Faker({ + locale: [ta_IN, en, base], +}); diff --git a/src/locales/index.ts b/src/locales/index.ts index f410092d..3d6ed6f7 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -63,6 +63,7 @@ import ru from './ru'; import sk from './sk'; import sr_RS_latin from './sr_RS_latin'; import sv from './sv'; +import ta_IN from './ta_IN'; import th from './th'; import tr from './tr'; import uk from './uk'; @@ -134,6 +135,7 @@ export { default as ru } from './ru'; export { default as sk } from './sk'; export { default as sr_RS_latin } from './sr_RS_latin'; export { default as sv } from './sv'; +export { default as ta_IN } from './ta_IN'; export { default as th } from './th'; export { default as tr } from './tr'; export { default as uk } from './uk'; @@ -206,6 +208,7 @@ export const allLocales = { sk, sr_RS_latin, sv, + ta_IN, th, tr, uk, diff --git a/src/locales/ta_IN/date/index.ts b/src/locales/ta_IN/date/index.ts new file mode 100644 index 00000000..a28ce823 --- /dev/null +++ b/src/locales/ta_IN/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/ta_IN/date/month.ts b/src/locales/ta_IN/date/month.ts new file mode 100644 index 00000000..d9185000 --- /dev/null +++ b/src/locales/ta_IN/date/month.ts @@ -0,0 +1,30 @@ +export default { + wide: [ + 'ஆடி', + 'ஆனி', + 'ஆவணி', + 'ஐப்பசி', + 'கார்த்திகை', + 'சித்திரை', + 'தை', + 'பங்குனி', + 'புரட்டாசி', + 'மாசி', + 'மார்கழி', + 'வைகாசி', + ], + abbr: [ + 'ஆடி', + 'ஆனி', + 'ஆவ', + 'ஐப்', + 'கார்', + 'சித்', + 'தை', + 'பங்', + 'புர', + 'மாசி', + 'மார்', + 'வைகா', + ], +}; diff --git a/src/locales/ta_IN/date/weekday.ts b/src/locales/ta_IN/date/weekday.ts new file mode 100644 index 00000000..4767aca6 --- /dev/null +++ b/src/locales/ta_IN/date/weekday.ts @@ -0,0 +1,4 @@ +export default { + wide: ['சனி', 'செவ்வாய்', 'ஞாயிறு', 'திங்கள்', 'புதன்', 'வியாழன்', 'வெள்ளி'], + abbr: ['ச', 'செ', 'ஞா', 'தி', 'பு', 'வி', 'வெ'], +}; diff --git a/src/locales/ta_IN/index.ts b/src/locales/ta_IN/index.ts new file mode 100644 index 00000000..fd052b27 --- /dev/null +++ b/src/locales/ta_IN/index.ts @@ -0,0 +1,20 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { LocaleDefinition } from '../..'; +import date from './date'; +import metadata from './metadata'; + +/** + * The locale data for the `ta_IN` locale. + * + * - Language: Tamil (India) + * - Endonym: தமிழ் (இந்தியா) + */ +const ta_IN: LocaleDefinition = { + date, + metadata, +}; + +export default ta_IN; diff --git a/src/locales/ta_IN/metadata.ts b/src/locales/ta_IN/metadata.ts new file mode 100644 index 00000000..7c5dbd33 --- /dev/null +++ b/src/locales/ta_IN/metadata.ts @@ -0,0 +1,13 @@ +import type { PreBuiltMetadataDefinitionForCountry } from '../../definitions/metadata'; + +const metadata: PreBuiltMetadataDefinitionForCountry = { + title: 'Tamil (India)', + code: 'ta_IN', + language: 'ta', + country: 'IN', + endonym: 'தமிழ் (இந்தியா)', + dir: 'ltr', + script: 'Taml', +}; + +export default metadata; diff --git a/test/__snapshots__/locale-data.spec.ts.snap b/test/__snapshots__/locale-data.spec.ts.snap index d09bc692..007cdd0c 100644 --- a/test/__snapshots__/locale-data.spec.ts.snap +++ b/test/__snapshots__/locale-data.spec.ts.snap @@ -62,6 +62,7 @@ exports[`locale-data > should only have known characters 1`] = ` "sk": " "#()+-./ABCDEFGHIJKLMNOPRSTUVWXZabcdefghijklmnopqrstuvwxyzÍÚáäéíóôöúýČčĎď켾ňŕřŠšťŽž", "sr_RS_latin": " #()+.ABCDEFGHIJKLMNOPRSTUVWZabcdefghijklmnopqrstuvwyzĆćČčĐ𩹮ž", "sv": " #+,-.ABCDEFGHIJKLMNOPQRSTUVWYZabcdefghijklmnopqrstuvwxyzÄÅÖãäåçéíö", + "ta_IN": "ஆஐகஙசஞடணதனபமயரறளழவாிுெை்", "th": " !#+-.;กขคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลวศษสหฬอฮฯะัาำิีึืุูเแโใไ็่้๊๋์", "tr": " #%&'()+,-.ABCDEFGHIJKLMNOPRSTUVWYZabcdefghijklmnopqrstuvwxyzÂÇÖÜâçéîöûüğİıŞş", "uk": " #()+,-.ЄІАБВГДЕЖЗЙКЛМНОПРСТУФХЦЧШЩЮЯабвгдежзийклмнопрстуфхцчшщьюяєіїґ’", diff --git a/test/locale-imports.spec.ts b/test/locale-imports.spec.ts index eb1bb508..d516c31d 100644 --- a/test/locale-imports.spec.ts +++ b/test/locale-imports.spec.ts @@ -57,6 +57,7 @@ describe.each(keys(allLocales))('locale imports', (locale) => { 'Jpan', 'Kore', 'Latn', + 'Taml', 'Thaa', 'Thai', ]).toContain(metadata.script); |
