import bilingual descriptions as 2 PartyDescription objects#2669
import bilingual descriptions as 2 PartyDescription objects#2669
Conversation
| 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. | ||
| """ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Refs https://app.asana.com/1/1204880536137786/project/1204880927741389/task/1213304852009908?focus=true