Skip to content

Internationalisation, many settings, and other improvements#153

Open
nuest wants to merge 22 commits into
TIBHannover:mainfrom
nuest:main
Open

Internationalisation, many settings, and other improvements#153
nuest wants to merge 22 commits into
TIBHannover:mainfrom
nuest:main

Conversation

@nuest nuest marked this pull request as ready for review April 21, 2026 12:32
@nuest nuest changed the title Internationalisation Internationalisation and other improvements Apr 21, 2026
…TIBHannover#23

partial implementation of TIBHannover#23

also fixes some tests that are only related
@nuest nuest changed the title Internationalisation and other improvements Internationalisation, many settings, and other improvements Apr 23, 2026
nuest added 10 commits April 23, 2026 12:09
…IBHannover#60

Rewrites write/read/display so geometries that cross the 180° meridian
are RFC 7946 §3.1.9 compliant, meta-tag-correct, and visually contiguous.

Write: new AntimeridianSplitter (classes/Geo/AntimeridianSplitter.inc.php)
runs on the Publication::edit hook; a crossing Polygon / LineString is
rewritten as a single MultiPolygon / MultiLineString feature with one
part per hemisphere. Idempotent on already-split input.

Centroid: antimeridian-aware envelope in bboxFromGeoJson (widest-gap
heuristic), crossing-aware mid-longitude in fromBbox, and PDOEngine's
Cartesian ST_Envelope is skipped for crossing geometries so ICBM /
geo.position tags are no longer biased toward Greenwich. DC.box /
ISO 19139 emission is unchanged — east<west is a valid crossing.

JS: shared helpers in _map_js_globals.tpl (geoMetadata_normalizeLng,
splitLegacyPolygonForDisplay, unwrapForDisplay, prepareFeaturesForDisplay).
On write, each .lng read in submission.js is wrapped through normalizeLng
so Leaflet's post-drag out-of-range lngs are stored in (-180, 180].
On read, legacy unsplit records are rewritten in-memory so the map still
fits them correctly, and split MultiPolygon / MultiLineString features
have their negative longitudes unwrapped by +360 for display so the two
halves render as one continuous shape across the dateline instead of
two disconnected pieces at opposite edges of the world map.

Admin-unit overlay: inline bboxToLeafletLayers helper in submission.js
and article_details.js emits two rectangles and an unwrapped fitBounds
when the GeoNames bbox has east<west (Russia, NZ, Fiji, parts of the US).
Deletes the "// TODO handle crossing dateline" marker.

UX: worldCopyJump:true on all four Leaflet maps; a small muted note
below the editing maps explains the split-on-save behaviour in en_US,
de_DE, fr_FR, es_ES (messages.mo regenerated).
@nuest
Copy link
Copy Markdown
Collaborator Author

nuest commented Apr 24, 2026

@tomniers It would be great if you can take a look at this, no time pressure at all.
No need to review line-by-line, but let me know if you can follow the changes broadly. Not all tests complete yet.

@nuest nuest requested a review from tomniers April 24, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment