Skip to content

feat(locale): add Tamil language support #3468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/guide/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
3 changes: 3 additions & 0 deletions src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 25 additions & 0 deletions src/locale/ta_IN.ts
Original file line number Diff line number Diff line change
@@ -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],
});
3 changes: 3 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -206,6 +208,7 @@ export const allLocales = {
sk,
sr_RS_latin,
sv,
ta_IN,
th,
tr,
uk,
Expand Down
14 changes: 14 additions & 0 deletions src/locales/ta_IN/date/index.ts
Original file line number Diff line number Diff line change
@@ -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;
30 changes: 30 additions & 0 deletions src/locales/ta_IN/date/month.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default {
wide: [
'ஆடி',
'ஆனி',
'ஆவணி',
'ஐப்பசி',
'கார்த்திகை',
'சித்திரை',
'தை',
'பங்குனி',
'புரட்டாசி',
'மாசி',
'மார்கழி',
'வைகாசி',
],
abbr: [
'ஆடி',
'ஆனி',
'ஆவ',
'ஐப்',
'கார்',
'சித்',
'தை',
'பங்',
'புர',
'மாசி',
'மார்',
'வைகா',
],
};
4 changes: 4 additions & 0 deletions src/locales/ta_IN/date/weekday.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
wide: ['சனி', 'செவ்வாய்', 'ஞாயிறு', 'திங்கள்', 'புதன்', 'வியாழன்', 'வெள்ளி'],
abbr: ['ச', 'செ', 'ஞா', 'தி', 'பு', 'வி', 'வெ'],
};
20 changes: 20 additions & 0 deletions src/locales/ta_IN/index.ts
Original file line number Diff line number Diff line change
@@ -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;
13 changes: 13 additions & 0 deletions src/locales/ta_IN/metadata.ts
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions test/__snapshots__/locale-data.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": " #()+,-.ЄІАБВГДЕЖЗЙКЛМНОПРСТУФХЦЧШЩЮЯабвгдежзийклмнопрстуфхцчшщьюяєіїґ’",
Expand Down
1 change: 1 addition & 0 deletions test/locale-imports.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe.each(keys(allLocales))('locale imports', (locale) => {
'Latn',
'Thaa',
'Thai',
'Taml',
]).toContain(metadata.script);
expect(metadata.endonym).toBeTypeOf('string');
expect(metadata.dir).toBeTypeOf('string');
Expand Down