From 6e87a51dbd0eec27e8619bac260eb89a8fe9c181 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Tue, 21 Jan 2025 17:56:03 +0000 Subject: [PATCH] Translate "and" to Chinese, Russian, Arabic In the metadata component --- CHANGELOG.md | 1 + config/locales/ar.yml | 2 +- config/locales/ru.yml | 2 +- config/locales/zh.yml | 4 ++-- spec/components/metadata_spec.rb | 16 ++++++++++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b666a4f94..7c1b7dcaef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Use component wrapper on contextual footer ([PR #4562](https://github.com/alphagov/govuk_publishing_components/pull/4562)) * Update Govspeak "Warning Text" component styles ([PR #4487](https://github.com/alphagov/govuk_publishing_components/pull/4487)) * Make "Add another" component styles more specific ([PR #4579](https://github.com/alphagov/govuk_publishing_components/pull/4579)) +* Translate "and" connective in metadata component to Chinese, Russian and Arabic ([PR #4580](https://github.com/alphagov/govuk_publishing_components/pull/4580)) ## 49.1.0 diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 0903704897..d12cb5e596 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -129,7 +129,7 @@ ar: navigation_search_subheading: search_text: metadata: - and: + and: و from: من history: المحفوظات last_updated: التحديث الأخير diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 0efebc8320..a9352d4f6c 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -130,7 +130,7 @@ ru: navigation_search_subheading: search_text: metadata: - and: + and: и from: Из history: История last_updated: Последнее обновление diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ca13410bc0..90916e0c16 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -124,8 +124,8 @@ zh: navigation_search_subheading: search_text: metadata: - and: - from: 从 + and: 和 + from: 发自 history: 历史 last_updated: 上次更新 part_of: 一部分 diff --git a/spec/components/metadata_spec.rb b/spec/components/metadata_spec.rb index 57f64ac6fe..b506c463de 100644 --- a/spec/components/metadata_spec.rb +++ b/spec/components/metadata_spec.rb @@ -94,6 +94,22 @@ def component_name end end + it "renders multiples as a single sentence (except history) in a right to left foreign language" do + I18n.with_locale("ar") do + render_component( + from: %w[واحد اثنان], + part_of: %w[ثلاثة أربعة], + other: { + "المواضيع": %w[خمسة ستة سبعة], + }, + ) + + assert_definition("من:", "واحد و اثنان") + assert_definition("جزء من:", "ثلاثة و أربعة") + assert_definition("المواضيع:", "خمسة, ستة و سبعة") + end + end + it "long lists of metadata are truncated and the remainder hidden behind a toggle for from" do links = [ "Ministry of Defence",