Use a geocoded Town only when the JSON town matches one of the stored translations
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in Photo Club Hub HTML/Ignite/Level 1/OrganizationsPage+makeOrgTable.swift by reading the displayTown closure in makeClubRow and the in-memory sort nearby. Check how Organization.localizedAddresses provides translations across languages, then ensure display and sorting use the same resolved town value. Done when matching JSON towns use the page-language geocode, nonmatching towns retain the JSON label, and row order follows the displayed value.
Written by the indexing model from the issue text.
Description
Follow-up to #159, which made the Clubs table use the geocoded localizedTown_ for all organization types.
Spec
For the Town cell in the generated organization tables:
- If the JSON
townmatches any of that organization's stored translations exactly — i.e. anyLocalizedAddress.localizedTown_in any language — display the geocoded value for the page's language. - If it matches none of them, display the unlocalized JSON
town(today's fallback).
Why
The match test separates translation from relabelling. If the JSON label is itself one of the names the geocoder holds for that place, then label and geocode agree on which name this place has, and showing another language's form of it is a genuine translation. If the label appears in none of them, the geocoder has resolved the coordinates to a larger or smaller area than the one specified — the absorbing municipality, or a hamlet inside the town — and the hand-maintained label should stand.
Note the comparison must be against the translations in all languages, not against Dutch. Fotografiska Berlin has JSON Berlin and geocoded NL Berlijn: an NL-only test would find no match and would stop localizing a museum that works correctly today.
Worked examples
Measured with full geocoding coverage (266 LocalizedAddress rows = 133 organizations × 2 languages):
| Organization | JSON town | geo NL | geo EN | Match? | EN page | NL page |
|---|---|---|---|---|---|---|
| Tokyo club (hypothetical) | Tokyo | Tokio | Tokyo | ✓ via EN | Tokyo | Tokio (JA: 東京) |
| Fotografiska Berlin | Berlin | Berlijn | Berlin | ✓ via EN | Berlin | Berlijn |
| Fotomuseum Antwerpen | Antwerpen | Antwerpen | Antwerp | ✓ via NL | Antwerp | Antwerpen |
| Fotogroep Argus | Den Bosch | 's‑Hertogenbosch | 's‑Hertogenbosch | ✗ | Den Bosch | Den Bosch |
| Fotoclub BeFoAm | Beilen | Hijken | Hijken | ✗ | Beilen | Beilen |
"Den Bosch" is the representative case: a correct, deliberate, colloquial name whose geocode returns the same string in both languages — no translation is on offer, only a relabelling.
Effect on today's data
- 14 of the 15 clubs that #159 changed revert to their JSON label (the full list is in https://github.com/vdhamer/Photo-Club-Hub-HTML/issues/159#issuecomment-5216857582).
- One club still changes: Fotokring Sint-Michielsgestel, whose JSON matches the NL geocode exactly, so EN renders the abbreviation
St-Michielsgestel. Acceptable under this spec; a separate abbreviation question if it ever matters. - All 5 museums whose NL and EN town names genuinely differ keep localizing.
Wanroykeeps showing asWanroy. That is a data error, corrected in the JSON via vdhamer/Photo-Club-Hub#810 — display logic should not mask it.
Where
Photo Club Hub HTML/Ignite/Level 1/OrganizationsPage+makeOrgTable.swift, the displayTown closure in makeClubRow:
let displayTown: String = {
guard let language,
let addr = club.localizedAddress(for: language),
let localizedTown = addr.localizedTown_,
// the JSON label must itself be one of the geocoder's names for this place
club.localizedAddresses.contains(where: { $0.localizedTown_ == club.town })
else { return String("\(club.town)".replacingUTF8Diacritics) }
return localizedTown
}()
Organization.localizedAddresses is public (Organization+ComputedProperties.swift:187), so no package change is needed.
Two implementation notes:
- Sorting must use the same resolved value. The in-memory sort (same file, ~lines 71-75) reads
localizedTown_unconditionally. If display falls back to the JSON label while the sort does not, rows appear out of alphabetical order — the mismatch that existed before #159, reintroduced for exactly the rows this spec protects. - The Country column is unaffected. Level 1 JSON has no country field, so there is no hand-maintained value to compare against; Country is geocoded-only and stays as is.
- Dominant language
- Swift
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vdhamer/Photo-Club-Hub-HTML
-
Bug Good first issue Refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vdhamer/Photo-Club-Hub-HTML#237 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
vdhamer/Photo-Club-Hub-HTML#282 ·
-
Enhancement Ignite
Difficulty 4/5 1-2 days Newbie friendliness 45/100
vdhamer/Photo-Club-Hub-HTML#281 ·
-
Enhancement Ignite
Difficulty 3/5 1-2 days Newbie friendliness 56/100
vdhamer/Photo-Club-Hub-HTML#279 · 1 comment ·
-
Enhancement Ignite
Difficulty 4/5 3-5 days Newbie friendliness 35/100
vdhamer/Photo-Club-Hub-HTML#278 ·
All issues in vdhamer/Photo-Club-Hub-HTML
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nwverse/persona#12800 · 1 comment ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 1/5 Under an hour Newbie friendliness 86/100
ajithrnayak/xpunge#7 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:other issue-rating: 🦪 silver shellfish P2
Difficulty 1/5 Under an hour Newbie friendliness 72/100
steipete/CodexBar#5147 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day