From e14a4250efb828262347f5a4bbc4067cd71d885f Mon Sep 17 00:00:00 2001 From: grm Date: Mon, 14 Sep 2026 01:32:25 +0300 Subject: Add languages: English and Greek, chosen per blog on the Settings tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every blog and its dashboard were hard-wired to English. A blogger can now pick the language of their blog; it switches the whole dashboard and the blog's fixed text — post dates, archive months, the RSS link, the pager, the 404 page — while what the blogger wrote is left alone. The new internal/i18n package keys translations by the English string, so an untranslated key renders as English rather than blank, and TestGreekCatalogComplete scans the templates and handlers to fail when the Greek catalog misses a key or keeps a stale one. Templates are compiled once per language with t/tf/date/postdate/month closed over the language, so they need no data plumbing. The language lives in settings.language (blog migration 00002), not in the theme, so "Reset design" does not touch it. Public pages use the blog's language; management pages use the logged-in user's own blog's, so a superadmin editing someone else's blog keeps theirs; the login page follows Accept-Language. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/module_form.html | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'internal/web/templates/dashboard/module_form.html') diff --git a/internal/web/templates/dashboard/module_form.html b/internal/web/templates/dashboard/module_form.html index b63b405..0cd27fa 100644 --- a/internal/web/templates/dashboard/module_form.html +++ b/internal/web/templates/dashboard/module_form.html @@ -2,32 +2,32 @@ {{define "content"}} {{$m := .Data.module}}
-

{{.Data.name}} in the {{lower .Data.area}}

+

{{.Data.name}} {{tf "in the %s" (lower .Data.area)}}

{{if or (eq $m.Kind "recent") (eq $m.Kind "archive") (eq $m.Kind "sitemap") (and (eq $m.Kind "html") (or (eq $m.Area "left") (eq $m.Area "right") (eq $m.Area "footer")))}} - + {{end}} {{if eq $m.Kind "recent"}} -
-

The newest published posts from every page of your blog, newest first.

+
+

{{t "The newest published posts from every page of your blog, newest first."}}

{{else if eq $m.Kind "archive"}} -

Every published post grouped by year and month, newest first. Years and months fold open and shut; the latest year starts open.

+

{{t "Every published post grouped by year and month, newest first. Years and months fold open and shut; the latest year starts open."}}

{{else if eq $m.Kind "sitemap"}} -

Links to every page of your blog.

+

{{t "Links to every page of your blog."}}

{{else if eq $m.Kind "html"}} - -

Put into your page exactly as written — embeds, badges and scripts all work. Anything broken here (an unclosed tag, say) can break the page around it, so check your blog after saving. 20 KB at most.

+ +

{{t "Put into your page exactly as written — embeds, badges and scripts all work. Anything broken here (an unclosed tag, say) can break the page around it, so check your blog after saving. 20 KB at most."}}

{{else if eq $m.Kind "text"}} - - -

Plain text; each line becomes its own paragraph.

+ + +

{{t "Plain text; each line becomes its own paragraph."}}

{{end}}

- - View blog ↗ - Back to layout + + {{t "View blog"}} ↗ + {{t "Back to layout"}}

-- cgit v1.2.3