Skip to content

import bilingual descriptions as 2 PartyDescription objects#2669

Merged
chris48s merged 1 commit intomasterfrom
descriptions20260224
Mar 2, 2026
Merged

import bilingual descriptions as 2 PartyDescription objects#2669
chris48s merged 1 commit intomasterfrom
descriptions20260224

Conversation

@chris48s
Copy link
Copy Markdown
Member

Comment on lines +264 to +274
def test_bilingual_description_marked_inactive(self, FakeEmblemPath):
"""
We used to import these as a single pipe seperated description e.g:
"Make Good Use of Bad Rubbish | Gwneud Defnydd Da o Sbwriel Gwael"
We now import
- "Make Good Use of Bad Rubbish" and
- "Gwneud Defnydd Da o Sbwriel Gwael"
as 2 different PartyDescription objects.
However, there are existing candidacies with FKs out to the old
bilingual ones. They should be kept around and marked inactive.
"""
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment here is really the key thing.

As I've written it, this PR will import

  • "Make Good Use of Bad Rubbish" and
  • "Gwneud Defnydd Da o Sbwriel Gwael"

as 2 different PartyDescription objects

and mark the existing pipe separated "Make Good Use of Bad Rubbish | Gwneud Defnydd Da o Sbwriel Gwael" as Inactive.

I think that is what you said you wanted?

However, the other decision we could make here is that we import:

  • "Make Good Use of Bad Rubbish" and
  • "Gwneud Defnydd Da o Sbwriel Gwael"
  • "Make Good Use of Bad Rubbish | Gwneud Defnydd Da o Sbwriel Gwael"
  • "Gwneud Defnydd Da o Sbwriel Gwael | Make Good Use of Bad Rubbish"

as 4 different PartyDescription objects, which might actually be more in line with the range of options the guidance allows.

Happy to re-jig it to do that if you prefer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation here, at the moment, is to get description matching working better. The translated versions mess with string matching in tricky ways, and splitting them up will make this better.

If we were trying to model what the ballot / SOPN actually says, with every combination of translations / additional words, then we might approach this differently.

I think this is more right more of the time than the current situation. The only iteration I think we might want to do is to record the related description object...e.g we're currently dropping the relationship between the translations.

This isn't important enough to add now, but I can see that being the next step to us trying to model the ballot paper correctly.

I can also see some work in the future to clean up the old descriptions, but for now this is ok. I think this approach will look odd on e.g https://whocanivotefor.co.uk/parties/party:2802/abolish-the-welsh-assembly-party, but we can always just filter out | on those pages.

@chris48s chris48s merged commit cb465bb into master Mar 2, 2026
7 checks passed
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.

2 participants