IMP-305: Add tj locale (#334)

This commit is contained in:
Ildar Galeev 2024-08-27 21:18:03 +07:00 committed by GitHub
parent 9d352243a4
commit 0e83d63081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 164 additions and 21 deletions

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "رفض من البنك المصدر", "RejectedByIssuer": "رفض من البنك المصدر",
"PaymentRejected": "تم رفض الدفع", "PaymentRejected": "تم رفض الدفع",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "Buraxılış bankı tərəfindən rədd edildi", "RejectedByIssuer": "Buraxılış bankı tərəfindən rədd edildi",
"PaymentRejected": "Ödəniş rədd edildi", "PaymentRejected": "Ödəniş rədd edildi",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "জারি করা ব্যাংকের দ্বারা প্রত্যাখ্যান করা হয়েছে", "RejectedByIssuer": "জারি করা ব্যাংকের দ্বারা প্রত্যাখ্যান করা হয়েছে",
"PaymentRejected": "পেমেন্ট প্রত্যাখ্যান করা হয়েছে", "PaymentRejected": "পেমেন্ট প্রত্যাখ্যান করা হয়েছে",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "Rejected by issuing bank", "RejectedByIssuer": "Rejected by issuing bank",
"PaymentRejected": "Payment is rejected", "PaymentRejected": "Payment is rejected",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "信用状発行銀行に拒否されました", "RejectedByIssuer": "信用状発行銀行に拒否されました",
"PaymentRejected": "支払いが却下されました", "PaymentRejected": "支払いが却下されました",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "발급 은행에 의해 거부됨", "RejectedByIssuer": "발급 은행에 의해 거부됨",
"PaymentRejected": "결제 거부됨", "PaymentRejected": "결제 거부됨",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -69,7 +69,11 @@
"RejectedByIssuer": "Rejeitado pelo banco emissor", "RejectedByIssuer": "Rejeitado pelo banco emissor",
"PaymentRejected": "Pagamento rejeitado", "PaymentRejected": "Pagamento rejeitado",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": "Отклонено эмитентом", "RejectedByIssuer": "Отклонено эмитентом",
"PaymentRejected": "Платёж отклонен", "PaymentRejected": "Платёж отклонен",
"p2p.gateways": { "p2p.gateways": {
"Сбербанк": "sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Тинькофф", "tinkoff": "Тинькофф",
"raiffeisen": "Райффайзен", "raiffeisen": "Райффайзен",
"sbp": "СБП", "sbp": "СБП",

97
src/assets/locale/tj.json Normal file
View File

@ -0,0 +1,97 @@
{
"info.back": "Қафо",
"info.details": "Тафсилот",
"info.modal.no.available.payment.method": "Методҳои пардохт дастрас нестанд",
"form.header.payment.methods.label": "Усулҳои пардохтро интихоб кунед",
"form.header.netbanking.label": "Бонкро интихоб кунед",
"form.header.pay.card.label": "Пардохт бо корт",
"form.header.final.success.label": "Пардохт муваффақона анҷом ёфт",
"form.header.final.invoice.paid.label": "Пардохт шуд",
"form.header.final.invoice.paid.already.label": "Қаблан пардохт шудааст",
"form.header.final.invoice.cancelled.label": "Инвойс бекор карда шуд",
"form.header.final.invoice.fulfilled.label": "Инвойс пӯшида шуд",
"form.header.final.error.label": "Хато",
"form.header.final.started.label": "Дар раванди иҷро",
"form.header.final.failed.label": "Пардохт нашуд",
"form.header.final.refunded.label": "Пас гардонида шуд",
"form.header.final.pending.label": "Дар раванди иҷро",
"form.header.final.pending.description": "",
"form.header.final.cancelled.label": "Бекор карда шуд",
"form.final.failed.cancelled.text": "Пардохт бекор карда шуд",
"form.final.started.pay.text": "Пардохт дар раванди иҷро аст",
"form.final.need.help": "Чӣ гуна мушкилотро ҳал кардан мумкин аст?",
"form.input.phone.placeholder": "Телефон",
"form.input.card.placeholder": "Рақами корт",
"form.input.expiry.placeholder": "ММ / СС",
"form.input.secure.placeholder": "CVV",
"form.input.cardholder.placeholder": "Номи соҳиби корт",
"form.input.email.placeholder": "Email",
"form.input.amount.placeholder": "Маблағи пардохт",
"form.button.back.to.website": "Ба сайт баргаштан",
"form.button.reload": "Такрор кардан",
"form.button.next.label": "Баъдӣ",
"form.button.pay.again.label": "Дубора кӯшиш кунед",
"form.button.pay.label": "Пардохт кардан",
"form.button.copy.label": "Нусхабардорӣ кардан",
"form.button.copied.label": "Нусхабардорӣ шуд!",
"form.payment.method.name.card.label": "Корт",
"form.payment.method.name.others.label": "Дигар усулҳои пардохт",
"form.serviceProvidersGrid.search": "Ҷустуҷӯ",
"form.qr.code": "Барои пардохт QR-кодро бо барномаи мобилии бонк ё камераи телефон скан кунед",
"form.p2p.error": "Дархостро барои миқдори дигар созед ё дертар кӯшиш кунед.",
"form.p2p.destination.info": "Интиқолро бо истифода аз тафсилоти зерин анҷом диҳед:",
"form.p2p.destination.bank.card.pan": "Рақами корт:",
"form.p2p.destination.bank.name": "Бонк:",
"form.p2p.destination.bank.recipient": "Қабулкунанда:",
"form.p2p.destination.spb.phone": "Рақами телефон:",
"form.p2p.destination.bank.account.account": "Рақами ҳисоб:",
"form.p2p.destination.bank.account.bic": "BIC:",
"form.p2p.destination.bank.account.purpose": "Мақсади пардохт:",
"form.p2p.complete.info": "Пас аз анҷом додани интиқол, тугмаи зерро пахш кунед. Коркарди пардохт то 5 дақиқа вақт мегирад.",
"form.p2p.complete.button": "Интикол анҷом дода шуд",
"form.p2p.complete.loading": "Лутфан интизор шавед",
"form.p2p.destination.amount": "Маблағ:",
"form.p2p.destination.randomizeAmountDescription": "Мо маблағи пасандозро тағир додем, то ба ҳисоб гирифтани маблағҳои шумо суръат бахшад.",
"form.p2p.alert.li": [
"Маблағи дақиқи дар ариза нишондодашударо интиқол диҳед.",
"Тамоми маблағро дар як пардохт интикол дихед."
],
"form.p2p.alert.p": "Дар акси ҳол, пардохт ба ҳисоб гирифта намешавад.",
"form.p2p.gateway.selector.heading": "Метод ё бонкро интихоб кунед",
"form.p2p.default.pane.label": "Ҳар як бонк",
"form.p2p.next.button": "Баъдӣ",
"form.p2p.destinations.heading": "Пардохт",
"form.p2p.copied": "Нусхабардорӣ шуд!",
"InvalidPaymentTool": "Абрези пардохт ғайриқонунӣ аст",
"AccountLimitsExceeded": "Меъёри ҳисоб зиёд шуд",
"InsufficientFunds": "Пули кофӣ нест",
"PreauthorizationFailed": "Претафтизатсия ноком шуд",
"RejectedByIssuer": "Аз ҷониби эмитент рад карда шуд",
"PaymentRejected": "Пардохт рад карда шуд",
"p2p.gateways": {
"сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen",
"sbp": "SBP",
"kapital": "Kapital",
"abb": "ABB"
},
"metadata.addons": {
"pinikle": {
"label": "Шумо ваучер надоред?",
"link": "Харидорӣ кардан"
}
},
"loaderMessages": [
"Загрузка... Лутфан саҳифаро набандед.",
"Ҳанӯз дар ин кор ҳастем... Ин вақти зиёдеро намегирад.",
"Лутфан интизор шавед! Мо дархости шуморо коркард мекунем...",
"Лутфан интизор шавед... Дархости шумо коркард мешавад.",
"Лутфан интизор шавед... Мо қариб ки ба анҷом расидем!",
"Қариб тамом... Ташаккур барои интизорӣ!"
]
}

View File

@ -66,7 +66,11 @@
"RejectedByIssuer": ıkaran banka tarafından reddedildi", "RejectedByIssuer": ıkaran banka tarafından reddedildi",
"PaymentRejected": "Ödeme reddedildi", "PaymentRejected": "Ödeme reddedildi",
"p2p.gateways": { "p2p.gateways": {
"sberbank": "Sberbank", "сбер": "sberbank",
"sber": "sberbank",
"сбербанк": "sberbank",
"сбр": "sberbank",
"sbr": "sberbank",
"tinkoff": "Tinkoff", "tinkoff": "Tinkoff",
"raiffeisen": "Raiffeisen", "raiffeisen": "Raiffeisen",
"sbp": "SBP", "sbp": "SBP",

View File

@ -1,6 +1,6 @@
import { isNil } from './isNil'; import { isNil } from './isNil';
const locales = ['ru', 'en', 'ja', 'pt', 'bn', 'ko', 'tr', 'az', 'ar']; const locales = ['ru', 'en', 'ja', 'pt', 'bn', 'ko', 'tr', 'az', 'ar', 'tj'];
export const detectLocale = (locale: string | null): string => { export const detectLocale = (locale: string | null): string => {
let result; let result;

View File

@ -1,9 +1,13 @@
import { SberbankIcon, TinkoffIcon, RaiffeisenIcon, SBPIcon } from '../icons'; import { SberbankIcon, TinkoffIcon, RaiffeisenIcon, SBPIcon } from '../icons';
export const getGatewayIcon = (gatewayName: string, defaultIcon?: JSX.Element): JSX.Element => { export const getGatewayIcon = (gatewayName: string, defaultIcon?: JSX.Element): JSX.Element => {
switch (gatewayName) { switch (gatewayName.toLowerCase()) {
case 'sberbank': case 'sberbank':
case 'Сбербанк': case 'сбер':
case 'sber':
case 'сбербанк':
case 'сбр':
case 'sbr':
return <SberbankIcon />; return <SberbankIcon />;
case 'tinkoff': case 'tinkoff':
return <TinkoffIcon />; return <TinkoffIcon />;

View File

@ -6,21 +6,22 @@ describe('mapGatewayName', () => {
beforeEach(() => { beforeEach(() => {
locale = { locale = {
'p2p.gateways': { 'p2p.gateways': {
gatewayA: 'Localized Gateway A', gatewaya: 'Localized Gateway A',
gatewayB: 'Localized Gateway B', gatewayb: 'Localized Gateway B',
gatewayC: 'Localized Gateway C', gatewayc: 'Localized Gateway C',
}, },
}; };
}); });
test('should return the localized gateway name when it exists in the locale', () => { test('should return the localized gateway name when it exists in the locale, case insensitive', () => {
expect(mapGatewayName('gatewayA', locale)).toBe('Localized Gateway A'); expect(mapGatewayName('gatewayA', locale)).toBe('Localized Gateway A');
expect(mapGatewayName('gatewayB', locale)).toBe('Localized Gateway B'); expect(mapGatewayName('GATEWAYB', locale)).toBe('Localized Gateway B');
expect(mapGatewayName('gatewayC', locale)).toBe('Localized Gateway C'); expect(mapGatewayName('gatewayc', locale)).toBe('Localized Gateway C');
}); });
test('should return the original gateway name when it does not exist in the locale', () => { test('should return the original gateway name when it does not exist in the locale, regardless of case', () => {
expect(mapGatewayName('unknownGateway', locale)).toBe('unknownGateway'); expect(mapGatewayName('unknownGateway', locale)).toBe('unknownGateway');
expect(mapGatewayName('UNKNOWNGATEWAY', locale)).toBe('UNKNOWNGATEWAY');
}); });
test('should return the original gateway name when the locale does not contain the "p2p.gateways" key', () => { test('should return the original gateway name when the locale does not contain the "p2p.gateways" key', () => {
@ -47,7 +48,7 @@ describe('mapGatewayName', () => {
test('should handle locale with other unrelated keys', () => { test('should handle locale with other unrelated keys', () => {
const complexLocale = { const complexLocale = {
'p2p.gateways': { 'p2p.gateways': {
gatewayA: 'Localized Gateway A', gatewaya: 'Localized Gateway A',
}, },
'other.key': 'some value', 'other.key': 'some value',
}; };

View File

@ -2,5 +2,5 @@ import { Locale } from 'checkout/contexts';
export const mapGatewayName = (gatewayName: string, l: Locale): string => { export const mapGatewayName = (gatewayName: string, l: Locale): string => {
const gateways = l?.['p2p.gateways'] ?? {}; const gateways = l?.['p2p.gateways'] ?? {};
return gateways[gatewayName] ?? gatewayName; return gateways[gatewayName.toLowerCase()] ?? gatewayName;
}; };

View File

@ -48,6 +48,11 @@ const localeInfo = {
short: 'Tr', short: 'Tr',
long: 'Türkçe', long: 'Türkçe',
}, },
tj: {
flag: '🇹🇯',
short: 'Тҷ',
long: 'Тоҷикӣ',
},
}; };
export type LocaleSelectorProps = { export type LocaleSelectorProps = {