Page context handling in i18n

This is a workaround. We need to improve on this, but not today.

Fixes #10782
This commit is contained in:
Bjørn Erik Pedersen
2023-03-04 14:43:23 +01:00
parent ec1c97e7e9
commit 6c798eba60
6 changed files with 115 additions and 9 deletions

3
deps/deps.go vendored
View File

@@ -1,6 +1,7 @@
package deps
import (
"context"
"fmt"
"path/filepath"
"strings"
@@ -71,7 +72,7 @@ type Deps struct {
FileCaches filecache.Caches
// The translation func to use
Translate func(translationID string, templateData any) string `json:"-"`
Translate func(ctx context.Context, translationID string, templateData any) string `json:"-"`
// The language in use. TODO(bep) consolidate with site
Language *langs.Language