Skip to content

Fix address widget labels for countries with mixed subdivision types#2931

Open
Lunga001 wants to merge 6 commits into
senaite:2.xfrom
bikalims:laboratory-address-city-label
Open

Fix address widget labels for countries with mixed subdivision types#2931
Lunga001 wants to merge 6 commits into
senaite:2.xfrom
bikalims:laboratory-address-city-label

Conversation

@Lunga001

@Lunga001 Lunga001 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Description of the issue/feature this PR addresses

Linked issue: #2930

Current behavior before PR

The address widget may display two fields labelled "City" when the
selected country is Zimbabwe.

Desired behavior after PR is merged

The first-level subdivision field should be labelled appropriately

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@ramonski ramonski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two minor things that would be nice to tackle in this PR.
Alsom resolve the conflicts please

label = _("State")
if subdivisions:
label = _(subdivisions[0].type)
label = geo.get_subdivision_type(subdivisions, _("State"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please change to _(u"label_subdivision_state", default=u"State") to not clash with the workflow state

label = _("District")
if subdivisions:
label = _(subdivisions[0].type)
label = geo.get_subdivision_type(subdivisions, _("District"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here: _(u"label_subdivision_district", default=u"District")

@Lunga001

Copy link
Copy Markdown
Contributor Author

Thank you @ramonski I've made the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants