QLFW-42: «Где купить книгу» на казахском и английском #29

Merged
peppa-bot merged 1 commits from task/qlfw-42 into main 2026-11-17 18:35:55 +05:00
6 changed files with 25 additions and 9 deletions

View File

@ -0,0 +1,4 @@
## Why
На kk/en в блоке «Где купить книгу» стояла пометка «нужно уточнить», хотя магазины известны (как на ru).
## What
Добавить перевод `book.buy` для kk и en; названия магазинов как на ru. Решение: пустой `buy` по-прежнему скрывает список (пометка остаётся только если данных нет).

View File

@ -0,0 +1 @@
- [x] kk/en book.buy, тест

View File

@ -1,12 +1,13 @@
import React from 'react'
import type { Dict } from '@/i18n'
export function BookWhere({ t, tbc }: { t: Dict['book']; tbc: string }) {
export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
const buy = t.buy
if (!buy) return null
return (
<div className="mt-8">
<h4 className="font-serif text-xl sm:text-2xl">{t.get}</h4>
{buy ? (
{(
<>
<p className="mt-3 text-muted">{buy.intro}</p>
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
@ -15,8 +16,6 @@ export function BookWhere({ t, tbc }: { t: Dict['book']; tbc: string }) {
<p className="mt-3 text-muted">{buy.stores}</p>
<p className="mt-3 text-muted">{buy.note}</p>
</>
) : (
<p className="mt-3 text-muted">{tbc}</p>
)}
</div>
)

View File

@ -18,10 +18,12 @@ describe('Сценарий: где купить книгу', () => {
expect(html).toContain('<p class="mt-3 text-muted">Наличие и стоимость книги уточняйте непосредственно у продавцов.</p>')
expect(html).not.toContain('<a')
})
it.each(['kk', 'en'] as const)('язык %s: пометка вместо выдуманного перевода', (l) => {
it.each(['kk', 'en'] as const)('язык %s: те же магазины, без пометок', (l) => {
const html = render(l)
expect(html).toContain(getDict(l).tbc)
expect(html).not.toContain('Marwin')
expect(html).toContain('<li>Marwin</li><li>Flip.kz</li>')
expect(html).toContain('Эрудит')
expect(html).toContain('Книжный мир')
expect(html).not.toContain(getDict(l).tbc)
expect(html).not.toContain('<a')
})
})

View File

@ -87,7 +87,12 @@ export const en: Dict = {
],
"getNote": "The book is available on Flip. The link opens the book’s page.",
"get": "Where to get the book",
"buy": null,
"buy": {
"intro": "Irina Serkebayeva’s book “Ermek Serkebayev. И жизнь, и молодость, и счастье. Новые страницы” is available online on these platforms:",
"platforms": ["Marwin", "Flip.kz"],
"stores": "It is also sold in the bookshops “Эрудит” and “Книжный мир”.",
"note": "Please check availability and price directly with the sellers."
},
"cover": "Cover",
"photo": "Photo",
"role": "The foundation’s role"

View File

@ -87,7 +87,12 @@ export const kk: Dict = {
],
"getNote": "Кітап Flip сайтында қолжетімді. Сілтеме арқылы кітаптың парақшасы ашылады.",
"get": "Қайдан алуға болады",
"buy": null,
"buy": {
"intro": "Ирина Серкебаеваның «Ермек Серкебаев. И жизнь, и молодость, и счастье. Новые страницы» кітабын онлайн мына платформалардан сатып алуға болады:",
"platforms": ["Marwin", "Flip.kz"],
"stores": "Сондай-ақ «Эрудит» және «Книжный мир» кітап дүкендерінен.",
"note": "Кітаптың бар-жоғы мен бағасын сатушылардан тікелей нақтылаңыз."
},
"cover": "Мұқаба",
"photo": "Фото",
"role": "Қордың рөлі"