Skip to content

Conversation

@struan
Copy link
Member

@struan struan commented Nov 18, 2025

This updates all the strings in the front end and wraps them in gettext calls for translation.

In general I've gone with the theory of more context is better over excluding HTML so some of these include quite a bit of HTML which I think is reasonable, especially where the text is linked. I've also tried to extract things that might change, e.g URLs with tracking codes, to avoid small changes requiring recompiling the translations.

For longer bits of text it passes things through Parsedown to strip out lots of p tags.

It does not translate the stats pages, the fictional postcodes page and the overseas correspondence pages.

Fixes #516

@struan struan changed the base branch from master to 515-language-switcher November 18, 2025 17:45
@struan struan force-pushed the 516-front-end-string-translation branch from 48abbf5 to dec690f Compare November 24, 2025 17:05
@struan struan force-pushed the 515-language-switcher branch from b3ebf3a to 420ada1 Compare November 25, 2025 10:57
@struan struan force-pushed the 516-front-end-string-translation branch from 1e599d9 to 644f8ef Compare November 25, 2025 11:06
@struan struan changed the base branch from 515-language-switcher to 509-welsh-translation-staging November 25, 2025 11:06
@struan struan force-pushed the 516-front-end-string-translation branch 3 times, most recently from 6cb7ce5 to 0273cb9 Compare November 26, 2025 12:10
@struan struan requested review from ajparsons and dracos November 26, 2025 14:11
@struan struan force-pushed the 509-welsh-translation-staging branch from 420ada1 to 15b5a28 Compare November 27, 2025 16:43
Note that some of the strings for this page are in votingarea.php which
is where xgettext finds them. However, they end up getting passed
through gettext again here because they are held in data structures that
get parsed before the locale is set. That's why there are things like
`$v['rep_name'] = _($va_rep_name[$vat]);` in the code.
Adds translations on the compose, preview and confirmation email sent
pages
This uses parsedown for the longer answers to hopefully make it a bit
easier to translate as you don't need to wrap things in p tags
@struan struan force-pushed the 516-front-end-string-translation branch from f4d316c to cfeed17 Compare November 27, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update all strings in front end to use gettext

2 participants