]> Sergey Matveev's repositories - sgblog.git/blobdiff - cmd/sgblog/gemini.go
Raise copyright years
[sgblog.git] / cmd / sgblog / gemini.go
index 1a7bc574fe685b01c62c254b8543fc53d98c9444..1b1131bcc67d5f0b418a13d278ff8d138fa23d03 100644 (file)
@@ -1,6 +1,6 @@
 /*
 SGBlog -- Git-backed CGI/UCSPI blogging/phlogging/gemlogging engine
-Copyright (C) 2020-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2020-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
@@ -32,6 +32,7 @@ import (
        "github.com/go-git/go-git/v5"
        "github.com/go-git/go-git/v5/plumbing"
        "github.com/go-git/go-git/v5/plumbing/object"
+       "github.com/vorlif/spreak"
        "go.stargrave.org/sgblog"
 )
 
@@ -55,6 +56,7 @@ func serveGemini(cfgPath string) {
        if err != nil {
                log.Fatalln(err)
        }
+       initLocalizer(cfg.Lang)
 
        headHash, err := initRepo(cfg)
        if err != nil {
@@ -145,6 +147,7 @@ func serveGemini(cfgPath string) {
                        offsetPrev = 0
                }
                err = TmplGemMenu.Execute(os.Stdout, struct {
+                       T          *spreak.Localizer
                        Cfg        *Cfg
                        Topic      string
                        Offset     int
@@ -155,6 +158,7 @@ func serveGemini(cfgPath string) {
                        Topics     []string
                        Version    string
                }{
+                       T:          localizer,
                        Cfg:        cfg,
                        Topic:      topic,
                        Offset:     offset,
@@ -175,6 +179,7 @@ func serveGemini(cfgPath string) {
                }
                title := msgSplit(commit.Message)[0]
                err = TmplGemEntry.Execute(os.Stdout, struct {
+                       T            *spreak.Localizer
                        Title        string
                        Commit       *object.Commit
                        When         string
@@ -185,6 +190,7 @@ func serveGemini(cfgPath string) {
                        Version      string
                        TitleEscaped string
                }{
+                       T:        localizer,
                        Title:    title,
                        Commit:   commit,
                        When:     commit.Author.When.Format(sgblog.WhenFmt),