QLFW-36: убрать пометки о непроверенном переводе #58
@ -31,6 +31,7 @@
|
||||
- QLFW-49: translationReview и sections.review остаются внутренними данными, публично не выводятся; Footer показывает foundationEmail через emailLinkHtml (email_off). Новости без текста/фото уже скрывает visibleNews.
|
||||
- QLFW-66: дубль QLFW-62 (обложка уже на main); добавлено только alt «Обложка: название книги» на главной и в проектах.
|
||||
- QLFW-64: «О фонде» без общей пометки о переводе (SectionPage review={false}); поля глобала foundation имеют defaultValue из defaultFoundationPeople — админка показывает текущих людей. Снимки админки: playwright-core из ~/.npm/_npx + системный Chrome, сохранение в Payload — Meta+s (кнопка «Сохранить» неактивна до изменений).
|
||||
- QLFW-36: поля translationReview и sections.review удалены из словарей и страниц — пометок о переводе на сайте нет; не возвращать.
|
||||
|
||||
## Грабли
|
||||
- QLFW-6: админка — коллекции Projects/Media, глобалы About (текст на /about) и SiteSettings (контакты); у новостей поле cover приоритетнее imageUrl (newsImage). Миграции пишем руками (снапшотов нет). Тесты страниц мокают ./content — новые загрузчики (loadProjects/loadSettings/loadAbout) добавлять в моки. Инструкция: docs/admin-guide.md.
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
## Решение
|
||||
Поля пометок удалены из словарей и типов вместо того, чтобы очистить значения: так пометка не вернётся случайно. Когда перевод проверен, внешний вид страниц не меняется. Статус проверки команда ведёт вне сайта.
|
||||
@ -0,0 +1,9 @@
|
||||
## Why
|
||||
Посетитель видел внутренние пометки команды: «Аударманы тексеру қажет» на /kk и «Translation awaiting review» на /en.
|
||||
|
||||
## What Changes
|
||||
- Убрана пометка о непроверенном переводе со всех публичных страниц.
|
||||
- Удалены сами поля `translationReview` и `sections.review` из словарей и вывод их в страницах.
|
||||
|
||||
## Impact
|
||||
Страницы главной, «Проекты», книга и разделы сайта; i18n-словари.
|
||||
@ -0,0 +1,14 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Публичные страницы без внутренних пометок о переводе
|
||||
Публичные страницы SHALL NOT показывать пометки о непроверенном переводе на любом языке.
|
||||
|
||||
#### Scenario: Казахская версия
|
||||
- **GIVEN** открыта страница /kk
|
||||
- **WHEN** посетитель читает страницу
|
||||
- **THEN** фразы «Аударманы тексеру қажет» нет
|
||||
|
||||
#### Scenario: Английская версия
|
||||
- **GIVEN** открыта страница /en
|
||||
- **WHEN** посетитель читает страницу
|
||||
- **THEN** фразы «Translation awaiting review» нет
|
||||
@ -0,0 +1,3 @@
|
||||
## 1. Реализация
|
||||
- [x] 1.1 Убрать вывод пометок и поля из словарей
|
||||
- [x] 1.2 Обновить тесты: пометок нет на kk/en
|
||||
19
openspec/specs/site/spec.md
Normal file
19
openspec/specs/site/spec.md
Normal file
@ -0,0 +1,19 @@
|
||||
# site Specification
|
||||
|
||||
## Purpose
|
||||
TBD - created by archiving change qlfw-36-hide-translation-notes. Update Purpose after archive.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirement: Публичные страницы без внутренних пометок о переводе
|
||||
Публичные страницы SHALL NOT показывать пометки о непроверенном переводе на любом языке.
|
||||
|
||||
#### Scenario: Казахская версия
|
||||
- **GIVEN** открыта страница /kk
|
||||
- **WHEN** посетитель читает страницу
|
||||
- **THEN** фразы «Аударманы тексеру қажет» нет
|
||||
|
||||
#### Scenario: Английская версия
|
||||
- **GIVEN** открыта страница /en
|
||||
- **WHEN** посетитель читает страницу
|
||||
- **THEN** фразы «Translation awaiting review» нет
|
||||
@ -25,7 +25,7 @@ export default async function Page({ params }: { params: Promise<{ locale: strin
|
||||
const about = await loadAbout(locale)
|
||||
const aboutText = paragraphs(about?.text)
|
||||
const aboutPhoto = mediaOf(about?.photo)
|
||||
return <SectionPage legal={await loadLegal(locale)} t={t} locale={locale} path="/about" title={t.sections.about} showNews={m.news.length > 0} review={false}>
|
||||
return <SectionPage legal={await loadLegal(locale)} t={t} locale={locale} path="/about" title={t.sections.about} showNews={m.news.length > 0}>
|
||||
{aboutText.length > 0 && <section className="mb-12 max-w-3xl">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- загруженные сотрудниками фото отдаёт Payload */}
|
||||
{aboutPhoto && <img src={aboutPhoto.url} alt={aboutPhoto.alt} className="mb-6 h-auto w-full" />}
|
||||
|
||||
@ -89,7 +89,6 @@ export default async function Home({ params }: { params: Promise<{ locale: strin
|
||||
<p className="mb-3 text-muted">{t.book.author}</p>
|
||||
<h3 className="font-serif text-2xl leading-snug sm:text-3xl">{t.book.title}</h3>
|
||||
{t.book.paragraphs.map((text) => <p key={text} className="mt-5 text-muted">{text}</p>)}
|
||||
{t.book.translationReview && <p className="mt-4 text-sm">{t.book.translationReview}</p>}
|
||||
<Link href={`/${locale}/projects/ermek-serkebayev`} className="mt-6 mr-6 inline-block underline underline-offset-4">{t.projects.more}</Link>
|
||||
<BookWhere t={t.book} tbc={t.tbc} />
|
||||
</div>
|
||||
|
||||
@ -37,7 +37,6 @@ export default async function BookProject({ params }: { params: Promise<{ locale
|
||||
<div className="min-w-0">
|
||||
<p className="text-muted">{t.book.author}</p>
|
||||
<h1 className="mt-3 break-words font-serif text-3xl leading-tight text-burgundy sm:text-4xl">{t.book.title}</h1>
|
||||
{t.book.translationReview && <p className="mt-5 border-l-2 border-burgundy pl-4 text-sm">{t.book.translationReview}</p>}
|
||||
{[...t.book.paragraphs, ...t.book.additions].map(text => <p key={text} className="mt-5 leading-relaxed">{text}</p>)}
|
||||
<BookLink url={bookUrl} t={t.book} />
|
||||
<BookWhere t={t.book} />
|
||||
|
||||
@ -3,12 +3,11 @@ import { Footer } from './Footer'
|
||||
import type { CmsLegal } from '@/lib/legal-model'
|
||||
import type { Dict, Locale } from '@/i18n'
|
||||
|
||||
export function SectionPage({ t, locale, path, title, showNews, legal, children, review = true }: { t: Dict; locale: Locale; path: string; title: string; showNews: boolean; legal: CmsLegal | null; children: React.ReactNode; review?: boolean }) {
|
||||
export function SectionPage({ t, locale, path, title, showNews, legal, children }: { t: Dict; locale: Locale; path: string; title: string; showNews: boolean; legal: CmsLegal | null; children: React.ReactNode }) {
|
||||
return <>
|
||||
<Header t={t} locale={locale} path={path} showProjects showNews={showNews} />
|
||||
<main className="mx-auto max-w-6xl px-5 pb-20 pt-64 sm:px-8 sm:pt-56 md:pt-44">
|
||||
<h1 className="mb-10 break-words font-serif text-4xl text-burgundy sm:text-5xl">{title}</h1>
|
||||
{review && t.sections.review && <p className="mb-8 text-sm">{t.sections.review}</p>}
|
||||
{children}
|
||||
</main>
|
||||
<Footer t={t} locale={locale} legal={legal} />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { Dict } from './types'
|
||||
|
||||
export const en: Dict = {
|
||||
sections: {"about": "About the foundation", "contacts": "Contacts", "partners": "Partners", "goals": "Goals", "goalText": "Collect and organise archives, manuscripts and recordings; publish books and music collections; make the legacy available to a wide audience in digital form; support young musicians and researchers; build ties with cultural organisations abroad.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "director": "Director", "chair": "Chair", "boardMember": "Member of the Board of Trustees", "read": "Read", "source": "Source", "review": "Translation awaiting review."},
|
||||
sections: {"about": "About the foundation", "contacts": "Contacts", "partners": "Partners", "goals": "Goals", "goalText": "Collect and organise archives, manuscripts and recordings; publish books and music collections; make the legacy available to a wide audience in digital form; support young musicians and researchers; build ties with cultural organisations abroad.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "director": "Director", "chair": "Chair", "boardMember": "Member of the Board of Trustees", "read": "Read", "source": "Source"},
|
||||
siteName: 'Qazaq Legacy Foundation',
|
||||
metaTitle: 'Qazaq Legacy Foundation — a private foundation for Kazakhstan’s heritage',
|
||||
metaDescription:
|
||||
@ -72,7 +72,6 @@ export const en: Dict = {
|
||||
},
|
||||
},
|
||||
book: {
|
||||
translationReview: "Translation awaiting review",
|
||||
gallery: "Photographs of the book",
|
||||
additions: ["The second edition adds chapters on Yermek Serkebayev and his era, Soviet patriotic music, chamber music, Kazakh folk song, and his teachers.", "The author researched the biographies of Serkebayev’s teachers, K. G. Brückner and A. M. Kurganov. The book also includes the singer’s discography."],
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { Dict } from './types'
|
||||
|
||||
export const kk: Dict = {
|
||||
sections: {"about": "Қор туралы", "contacts": "Байланыс", "partners": "Серіктестер", "goals": "Мақсаттар", "goalText": "Мұрағаттарды, қолжазбалар мен жазбаларды жинап, жүйелеу; кітаптар мен музыкалық жинақтар шығару; мұраны кең аудиторияға цифрлық түрде ұсыну; жас музыканттар мен зерттеушілерге қолдау көрсету; шетелдік мәдени ұйымдармен байланыс орнату.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "director": "Директор", "chair": "Төраға", "boardMember": "Қамқоршылық кеңестің мүшесі", "read": "Оқу", "source": "Дереккөз", "review": "Аударманы тексеру қажет."},
|
||||
sections: {"about": "Қор туралы", "contacts": "Байланыс", "partners": "Серіктестер", "goals": "Мақсаттар", "goalText": "Мұрағаттарды, қолжазбалар мен жазбаларды жинап, жүйелеу; кітаптар мен музыкалық жинақтар шығару; мұраны кең аудиторияға цифрлық түрде ұсыну; жас музыканттар мен зерттеушілерге қолдау көрсету; шетелдік мәдени ұйымдармен байланыс орнату.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "director": "Директор", "chair": "Төраға", "boardMember": "Қамқоршылық кеңестің мүшесі", "read": "Оқу", "source": "Дереккөз"},
|
||||
siteName: 'Qazaq Legacy Foundation',
|
||||
metaTitle: 'Qazaq Legacy Foundation — Қазақстан мұрасының жеке қоры',
|
||||
metaDescription:
|
||||
@ -72,7 +72,6 @@ export const kk: Dict = {
|
||||
},
|
||||
},
|
||||
book: {
|
||||
translationReview: "Аударманы тексеру қажет",
|
||||
gallery: "Кітаптың фотосуреттері",
|
||||
additions: ["Екінші басылымға «Ермек Серкебаев және оның дәуірі», «Кеңестік патриоттық музыка», «Камералық музыка», «Қазақтың халық әні», «Ұстаздар» тараулары қосылды.", "Автор Ермек Серкебаевтың ұстаздары К. Г. Брюкнер мен А. М. Кургановтың өмірбаяндарын зерттеді. Кітапта әншінің дискографиясы да берілген."],
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { Dict } from './types'
|
||||
|
||||
export const ru: Dict = {
|
||||
sections: {"about": "О фонде", "contacts": "Контакты", "partners": "Партнёры", "goals": "Цели", "goalText": "Собирать и систематизировать архивы, рукописи и записи; издавать книги и музыкальные сборники; открывать наследие широкой аудитории в цифровом виде; помогать молодым музыкантам и исследователям; выстраивать связи с зарубежными культурными организациями.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "director": "Директор", "chair": "Председатель", "boardMember": "Член Попечительского совета", "read": "Читать", "source": "Источник", "review": ""},
|
||||
sections: {"about": "О фонде", "contacts": "Контакты", "partners": "Партнёры", "goals": "Цели", "goalText": "Собирать и систематизировать архивы, рукописи и записи; издавать книги и музыкальные сборники; открывать наследие широкой аудитории в цифровом виде; помогать молодым музыкантам и исследователям; выстраивать связи с зарубежными культурными организациями.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "director": "Директор", "chair": "Председатель", "boardMember": "Член Попечительского совета", "read": "Читать", "source": "Источник"},
|
||||
siteName: 'Qazaq Legacy Foundation',
|
||||
metaTitle: 'Qazaq Legacy Foundation — частный фонд наследия Казахстана',
|
||||
metaDescription:
|
||||
@ -72,7 +72,6 @@ export const ru: Dict = {
|
||||
},
|
||||
},
|
||||
book: {
|
||||
translationReview: "",
|
||||
gallery: "Фотографии книги",
|
||||
additions: ["Во втором издании появились главы «Ермек Серкебаев и его эпоха», «Советская патриотическая музыка», «Камерная музыка», «Казахская народная песня», «Учителя».", "Автор исследовала биографии педагогов Ермека Серкебаева — К. Г. Брюкнера и А. М. Курганова. В книге также представлена дискография певца."],
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ export const locales = ['ru', 'kk', 'en'] as const
|
||||
export type Locale = (typeof locales)[number]
|
||||
|
||||
export type Dict = {
|
||||
sections: { about: string; contacts: string; partners: string; goals: string; goalText: string; founder: string; leadership: string; board: string; director: string; chair: string; boardMember: string; read: string; source: string; review: string }
|
||||
sections: { about: string; contacts: string; partners: string; goals: string; goalText: string; founder: string; leadership: string; board: string; director: string; chair: string; boardMember: string; read: string; source: string }
|
||||
siteName: string
|
||||
metaTitle: string
|
||||
metaDescription: string
|
||||
@ -13,7 +13,7 @@ export type Dict = {
|
||||
mission: { title: string; text: string; missing: string }
|
||||
directions: { title: string; items: { title: string; text: string }[] }
|
||||
projects: { title: string; more: string }
|
||||
book: { title: string; author: string; paragraphs: string[]; get: string; getNote: string; buy: { intro: string; platforms: string[]; storesIntro: string; stores: string[]; note: string } | null; cover: string; photo: string; photoClose: string; photoPrev: string; photoNext: string; role: string; translationReview: string; gallery: string; additions: string[] }
|
||||
book: { title: string; author: string; paragraphs: string[]; get: string; getNote: string; buy: { intro: string; platforms: string[]; storesIntro: string; stores: string[]; note: string } | null; cover: string; photo: string; photoClose: string; photoPrev: string; photoNext: string; role: string; gallery: string; additions: string[] }
|
||||
news: { title: string; news: string; event: string }
|
||||
collaboration: { title: string; text: string; write: string; instagram: string }
|
||||
contacts: { title: string; description: string; lead: string; emailLabel: string; phoneLabel: string; addressLabel: string; socialsLabel: string }
|
||||
|
||||
@ -18,7 +18,7 @@ describe('Подтверждённая страница книги', () => {
|
||||
for (const language of locales) expect(html).toContain(`/${language}/projects/ermek-serkebayev`)
|
||||
expect(html).toContain('cover.jpg')
|
||||
for (const n of [1, 2, 3, 4]) expect(html).toContain(`photo-${n}.jpg`)
|
||||
if (locale !== 'ru') expect(html).toContain(t.book.translationReview)
|
||||
expect(html).not.toMatch(/Аударманы тексеру|Translation awaiting review/)
|
||||
expect(html).not.toContain(t.tbc)
|
||||
expect(html).not.toMatch(/Организатор|Ұйымдастырушы|organiser/i)
|
||||
})
|
||||
|
||||
@ -26,7 +26,6 @@ describe('Руководство фонда на казахском и англ
|
||||
expect(lines.filter(l => l === t.sections.boardMember)).toHaveLength(2)
|
||||
expect(lines.join('\n')).not.toContain(mark)
|
||||
expect(lines.join('\n')).not.toContain(t.tbc)
|
||||
expect(lines.join('\n')).not.toContain(t.book.translationReview)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user