Skip to content

Commit

Permalink
Merge pull request #4580 from alphagov/3162-add-translations-of-the-w…
Browse files Browse the repository at this point in the history
…ord-and-for-chinese-russian-and-arabic-to-the-metadata-component-m

Translate "and" connective in metadata component to Chinese, Russian and Arabic
  • Loading branch information
unoduetre authored Jan 22, 2025
2 parents 3851236 + 6e87a51 commit 2acff8c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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

Expand Down
2 changes: 1 addition & 1 deletion config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ar:
navigation_search_subheading:
search_text:
metadata:
and:
and: و
from: من
history: المحفوظات
last_updated: التحديث الأخير
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ru:
navigation_search_subheading:
search_text:
metadata:
and:
and: и
from: Из
history: История
last_updated: Последнее обновление
Expand Down
4 changes: 2 additions & 2 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ zh:
navigation_search_subheading:
search_text:
metadata:
and:
from:
and:
from: 发自
history: 历史
last_updated: 上次更新
part_of: 一部分
Expand Down
16 changes: 16 additions & 0 deletions spec/components/metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
"<a href=\"/government/organisations/ministry-of-defence\">Ministry of Defence</a>",
Expand Down

0 comments on commit 2acff8c

Please sign in to comment.