Skip to content

Commit

Permalink
Move search box translations out of code
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Sep 11, 2024
1 parent 4d6dbc5 commit 10c3270
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 2 additions & 10 deletions classes/SectionView/SeneddView.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ protected function display_front_senedd() {
protected function getSearchBox(array $data): \MySociety\TheyWorkForYou\Search\SearchBox{
$search_box = new \MySociety\TheyWorkForYou\Search\SearchBox();
$search_box->homepage_panel_class = "panel--homepage--senedd";
if (LANGUAGE == 'cy') {
$search_box->homepage_subhead = "Senedd";
} else {
$search_box->homepage_subhead = "Senedd / Welsh Parliament";
}
$search_box->homepage_subhead = gettext("Senedd / Welsh Parliament");
$search_box->homepage_desc = "";
$search_box->search_section = "senedd";
$search_box->quick_links = [];
Expand All @@ -122,11 +118,7 @@ protected function getSearchBox(array $data): \MySociety\TheyWorkForYou\Search\S
$constituencies[$member["constituency"]] = 1;
}
$constituencies = array_keys($constituencies);
if (LANGUAGE == 'cy'){
$search_box->add_quick_link('Darganfod mwy am eich Aelodau Cynulliad dros ' . $constituencies[0] . ' a ' . $constituencies[1], '/postcode/?pc=' . $data["mp_data"]['postcode'],'torso');
} else {
$search_box->add_quick_link('Find out more about your MSs for ' . $constituencies[0] . ' and ' . $constituencies[1], '/postcode/?pc=' . $data["mp_data"]['postcode'],'torso');
}
$search_box->add_quick_link(gettext('Find out more about your MSs for ') . $constituencies[0] . gettext(' and ') . $constituencies[1], '/postcode/?pc=' . $data["mp_data"]['postcode'],'torso');
}
$search_box->add_quick_link(gettext('Create and manage email alerts'), '/alert/','megaphone');
$search_box->add_quick_link(gettext('Subscribe to our newsletter'), '/about/#about-mysociety', 'mail');
Expand Down
9 changes: 8 additions & 1 deletion locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ msgstr "Ni allwch chwilio am fwy nag un ystod o ddyddiadau."
msgid "Maximum term length is 255 characters."
msgstr "Yr hyd term mwyaf yw 255 nod."

#: classes/SectionView/SeneddView.php:131
#: classes/SectionView/SeneddView.php:125
msgid "Find out more about your MSs for "
msgstr "Darganfod mwy am eich Aelodau Cynulliad dros "

#: classes/SectionView/SeneddView.php:125
msgid " and "
msgstr " a "

msgid "Create and manage email alerts"
msgstr "Creu hysbysiad"

Expand Down

0 comments on commit 10c3270

Please sign in to comment.