Multi-language News — product requirements
Multi-language News is a news portal in eight languages — Tiếng Việt, English, 中文, Français, ไทย, 日本語, Deutsch and العربية (right-to-left). Each language has a home page with a top story and section blocks, ten section pages, article pages with related stories, search tuned to its script, local date formats and a language switcher. The catalogue is 28 Vietnamese articles, 8 of which are translated into every other language; a small JSON API serves all of it.
Problem. Readers want today's news grouped by topic, in their own language and script, and want to find stories without typing every accent, tone mark or script variant exactly.
Users
- News reader — See the newest story first, browse by section and read an article with related stories.
- Searcher — Find stories without having to type tone marks exactly.
- International reader — Switch to English, Chinese, French, Thai, Japanese, German or Arabic and stay on the same story, with dates and layout that feel native.
- Integrator — Fetch sections, articles and languages over a simple API.
Goals
- Stories are ordered newest first and every section holds exactly its own stories.
- Search is forgiving of accents, case and script variants, and never renders user input as markup.
- Article text is shown exactly as written, with proper-noun capitals intact.
- Every language gets translated chrome, local dates and the right text direction, and the switcher never loses the reader's place.
Out of scope
- Images (thumbnails are colour blocks)
- Comments, login, video
- Machine translation — only 8 stories are translated
Contents
Home page
Header, section navigation, top story and section blocks.
- Title "Multi-language News - Tin tức Việt Nam mỗi ngày"; html lang="vi"
- Header: logo link, current date as "<weekday>, d/m/yyyy, hh:mm (GMT+7)", search box "Tìm kiếm"
- Nav "Chuyên mục": home icon then Thời sự, Thế giới, Kinh doanh, Khoa học công nghệ, Giải trí, Thể thao, Pháp luật, Giáo dục, Sức khỏe, Du lịch
- Footer "© 2026. Toàn bộ bản quyền thuộc Multi-language News (mô phỏng)."
- Top story: "Hà Nội phân luồng giao thông phục vụ thi công cầu Trần Hưng Đạo"
- Side headlines: "TP HCM mở rộng tuyến buýt điện…", "Cao tốc Bắc - Nam đoạn qua Khánh Hòa…", "Bộ Giao thông Vận tải đề xuất…"
- Section blocks Thời sự, Thế giới, Kinh doanh, Khoa học công nghệ show two stories each
Section pages
One page per section.
- "Thể thao" opens /news/the-thao, title "Thể thao - Multi-language News", heading "Thể thao", exactly 2 stories
- The active nav link has aria-current="page" and is bold
- Thời sự 6; Thế giới 4; Kinh doanh 4; every other section 2
- GET /api/news/articles reports total 28
- Heading "404 - Không tìm thấy trang"; header and nav still present
- Applies to /news/khong-ton-tai and /news/abc-9999999.html
Article pages
Story detail, canonical URLs and related stories.
- URL form /news/<slug>-<id>.html; title "<headline> - Multi-language News"
- Breadcrumb "Thời sự" links to /news/thoi-su; time "Chủ nhật, 18/10/2026, 08:23 (GMT+7)" for the top story
- Body of three paragraphs
- "Tin liên quan" shows three other stories from the same section, never the current one
- The first paragraph of the top story contains "Hà Nội phân luồng giao thông…" with "Hà" capitalised
- /news/wrong-slug-4800100.html redirects (301 or 302) to the canonical top-story URL
Search
Accent- and case-insensitive Vietnamese search.
- "giao thông" goes to /news/tim-kiem?q=giao+th%C3%B4ng with heading "Kết quả tin tức cho từ khóa giao thông"
- 6 matching stories; the search box still contains "giao thông"
- "giao thong" and "GIAO THONG" return the same 6 stories as "giao thông"
- "duong" and "đường" return the same 3 stories
Languages
Eight locales, switcher, hreflang, local dates, RTL and per-script search.
- Each link carries hreflang and lang; the current language has aria-current
- /news/en/ has html lang="en", title "Multi-language News - Daily news in your language", nav Current affairs … Travel and footer "© 2026 Multi-language News (simulated). All rights reserved."
- The top story is the newest translated story; section blocks are the first four sections that have stories
- /news/en redirects 301 to /news/en/; /news/vi/ redirects to /news/; an unknown code is 404
- Latin-script languages (en, fr, de) use /news/<code>/<slug>-<id>.html; zh, th, ja and ar use /news/<code>/<id>.html
- From the top story, "Français" opens /news/fr/hanoi-devie-la-circulation-pour-les-travaux-du-pont-tran-hung-dao-4800100.html and "日本語" opens /news/ja/4800100.html
- /news/en/sports → "Deutsch" → /news/de/sports
- Story 4800100: alternates vi, en, zh-Hans, fr, th, ja, de, ar and x-default
- A Vietnamese-only story has only vi and x-default
- en "Sunday, October 18, 2026, 8:23 AM (GMT+7)"
- fr "dimanche 18 octobre 2026, 08:23 (GMT+7)"; de "Sonntag, 18. Oktober 2026, 08:23 (GMT+7)"
- zh "2026年10月18日 星期日 08:23 (GMT+7)"; ja "2026年10月18日(日) 08:23 (GMT+7)"
- th "วันอาทิตย์ที่ 18 ตุลาคม 2569 เวลา 08:23 น. (GMT+7)" (Buddhist era)
- ar "الأحد، ١٨ أكتوبر ٢٠٢٦، ٠٨:٢٣ (GMT+7)" (Arabic-Indic digits)
- html lang="ar" dir="rtl" on home, section, article, search and 404 pages
- Logo on the right, search on the left, side headlines to the left of the top story
- /news/en/4800102.html: 404, "404 - Page not found", "This story is available in: Tiếng Việt" linking to the Vietnamese URL
- Vietnamese section slugs under another language (/news/en/the-thao) are 404
- en "AIRPORT" and fr "aeroport" find the Tan Son Nhat airport story; fr "l'ONU" finds "L’ONU appelle…"
- de "Strasse" finds "Hanoi sperrt Straßen…"
- ja half-width "ハノイ" finds "ハノイ、…"
- ar "تحول" and "الامم" find "تحوّل" and "الأمم"
- de "fuer" returns the same three stories as "für"
- /news/en/sports: title "Sports - Multi-language News", 1 story
- /news/en/law: "No stories in this section yet."; /news/de/law: "In diesem Ressort gibt es noch keine Artikel."
Articles API
JSON endpoints for sections, articles and languages.
- section=the-thao: total 2
- section=kinh-doanh&q=gia: total 2
- Each article has id, section, title, lead, body, time and url (/news/<slug>-<id>.html)
- locales: code, tag, name, dir (ar "rtl"), home, search and article count (vi 28, others 8)
- articles?lang=ja: total 8; each item adds lang and translations
- sections?lang=fr: English slugs with French names
- lang=xx: HTTP 400 {error:"validation"}
Non-functional requirements
- ?q=<b>x</b> shows the literal <b>x</b>