From 2b03e7e514f59e5d0f8601568206a9b3e19b3f05 Mon Sep 17 00:00:00 2001 From: Fringg Date: Sun, 29 Mar 2026 05:18:40 +0300 Subject: [PATCH] feat: send language in payment requests for localized descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add language field to balance topup and landing purchase requests - Cap news article featured image height with max-h-96 Cherry-picked from PR #362 (without favicon change — files don't exist) --- src/api/balance.ts | 3 +++ src/api/landings.ts | 1 + src/pages/NewsArticle.tsx | 2 +- src/pages/QuickPurchase.tsx | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/balance.ts b/src/api/balance.ts index 9e5ab91..8ae249f 100644 --- a/src/api/balance.ts +++ b/src/api/balance.ts @@ -1,4 +1,5 @@ import apiClient from './client'; +import i18n from '../i18n'; import type { Balance, Transaction, @@ -54,6 +55,7 @@ export const balanceApi = { amount_kopeks: number; payment_method: string; payment_option?: string; + language?: string; } = { amount_kopeks: amountKopeks, payment_method: paymentMethod, @@ -61,6 +63,7 @@ export const balanceApi = { if (paymentOption) { payload.payment_option = paymentOption; } + payload.language = i18n.language || 'ru'; const response = await apiClient.post('/cabinet/balance/topup', payload); return response.data; }, diff --git a/src/api/landings.ts b/src/api/landings.ts index d6cdb8a..83437c5 100644 --- a/src/api/landings.ts +++ b/src/api/landings.ts @@ -101,6 +101,7 @@ export interface PurchaseRequest { gift_recipient_type?: 'email' | 'telegram'; gift_recipient_value?: string; gift_message?: string; + language?: string; } export interface PurchaseResponse { diff --git a/src/pages/NewsArticle.tsx b/src/pages/NewsArticle.tsx index 85de576..979ec06 100644 --- a/src/pages/NewsArticle.tsx +++ b/src/pages/NewsArticle.tsx @@ -408,7 +408,7 @@ export default function NewsArticlePage() { {article.title} diff --git a/src/pages/QuickPurchase.tsx b/src/pages/QuickPurchase.tsx index f981d13..8dc3877 100644 --- a/src/pages/QuickPurchase.tsx +++ b/src/pages/QuickPurchase.tsx @@ -927,6 +927,7 @@ export default function QuickPurchase() { contact_type: detectContactType(contactValue), contact_value: contactValue.trim(), payment_method: paymentMethod, + language: i18n.language, is_gift: isGift, };