Skip to content
quarry View Ticket
Login

View Ticket

2026-09-24
00:52 • Ticket [cfef2718e1] Localisation: a language selector and translatable interface strings status still Open with 1 other change artifact: 13185d27ec user: zeitgeist
2026-09-12
15:58 • Ticket [cfef2718e1]: 2 changes artifact: 107c12bcc8 user: zeitgeist
2026-08-19
12:10 • Ticket [cfef2718e1]: 1 change artifact: 22138cf2b2 user: dmestas
11:04 • Ticket [cfef2718e1]: 2 changes artifact: 04fffdf5c5 user: dmestas
2026-08-18
19:37 • New ticket [cfef2718e1]. artifact: 27b475233b user: dmestas

Localisation: a language selector and translatable interface strings

Opencfef2718e1ba1f49a8ff59d9e9f9948287b9379aCreated 104.2 days agoUpdated 68.0 days ago
Description2026-08-18 19:37:21
Forgejo carries a language selector in its footer. quarry has the slot for one; what it does not have is anything to select between.

## What has to happen first

Every visible string is currently a literal inside a Go template. Translation needs them extracted to a catalogue keyed by message id, with the templates calling a lookup. That is the bulk of the work and it is mechanical.

## Choosing a language, without JavaScript

The theme switcher already establishes the pattern this should follow: a form POST to `/lang`, a cookie, and the choice resolved server-side before the first byte. That keeps the one-script rule and avoids a flash of the wrong language. `Accept-Language` supplies the default when no cookie is set, which is the "system" state of the same three-way shape.

## What must NOT be translated

Repository content. Check-in comments, wiki pages, tickets and file names are the corpus, in whatever language their authors wrote. Only quarry chrome is translatable, and the boundary needs to be explicit or a translator will reasonably assume otherwise.

## Two things that will bite

- Dates already go through a relative-time helper (`ago`), which is English-only and pluralises in English. It needs the catalogue too, and plural rules are not uniform across languages — this is the part that cannot be done by string substitution alone. - The layout is currently sized by English. German compounds and Japanese line-breaking will both find the places where a width was chosen by eye.

Not urgent, but worth deciding before the string count grows much further: extraction gets more expensive per screen added.

2026-09-12 15:58:21

Needs dmestas's decision before implementation. Localisation decides whether quarry's copy is content or code. Every page in this codebase carries its reasoning in the markup and the copy is written as prose, not as keys; extracting it to a catalogue changes how every future page is written. It also interacts with the no-copy-pins test rule. Worth your call on whether the interface strings become a translatable surface at all.

(Recorded as a comment because quarry's own tracker defines no assignee field — its schema carries title, type, status, severity, priority, subsystem and nothing else, while tcl's carries assignee, submitter, closer and closedate. Assigning here needs both halves: the field added to quarry's ticket schema, and #0eafaa19 so quarry can write any field a tracker defines rather than fossil's default list.)