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/overview.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'internal/web/templates/dashboard/overview.html') diff --git a/internal/web/templates/dashboard/overview.html b/internal/web/templates/dashboard/overview.html index acd539d..e021495 100644 --- a/internal/web/templates/dashboard/overview.html +++ b/internal/web/templates/dashboard/overview.html @@ -1,35 +1,35 @@ {{define "title"}}{{.Blog.Title}} · Blogspace{{end}} {{define "content"}}

{{.Blog.Title}}

-

Your blog is live at {{.BlogURL}}. Every change you save here shows up there as soon as you refresh.

+

{{t "Your blog is live at"}} {{.BlogURL}}. {{t "Every change you save here shows up there as soon as you refresh."}}

-

Pages

+

{{t "Pages"}}

    - {{range .Data.pages}}
  • {{.Title}} ({{.PostCount}} posts{{if .IsHome}}, home{{end}}{{if not .ShowInNav}}, hidden from menu{{end}})
  • {{end}} + {{range .Data.pages}}
  • {{.Title}} ({{tf "%d posts" .PostCount}}{{if .IsHome}}, {{t "home"}}{{end}}{{if not .ShowInNav}}, {{t "hidden from menu"}}{{end}})
  • {{end}}
-

Latest posts

+

{{t "Latest posts"}}

{{if .Data.posts}} - + {{range .Data.posts}} - + - + {{end}}
TitlePageDate
{{t "Title"}}{{t "Page"}}{{t "Date"}}
{{.Title}}{{if not .Published}} hidden{{end}}{{.Title}}{{if not .Published}} {{t "hidden"}}{{end}} {{.PageTitle}} {{date .CreatedAt}}view ↗{{t "view"}} ↗
-

All posts

- {{else}}

No posts yet. Write the first one.

{{end}} +

{{t "All posts"}}

+ {{else}}

{{t "No posts yet."}} {{t "Write the first one."}}

{{end}}
{{end}} -- cgit v1.2.3