diff --git a/contrib/backends/srndv2/src/srnd/i18n.go b/contrib/backends/srndv2/src/srnd/i18n.go index e540e78..c8e43b5 100644 --- a/contrib/backends/srndv2/src/srnd/i18n.go +++ b/contrib/backends/srndv2/src/srnd/i18n.go @@ -18,7 +18,7 @@ type I18N struct { // root directory for translations translation_dir string // name of locale - name string + Name string } var I18nProvider *I18N = nil @@ -71,7 +71,7 @@ func NewI18n(locale, dir string) (*I18N, error) { } return &I18N{ - name: locale, + Name: locale, translation_dir: dir, Formats: formats.Options(), Translations: translations.Options(), diff --git a/contrib/backends/srndv2/src/srnd/model_mem.go b/contrib/backends/srndv2/src/srnd/model_mem.go index 809c909..36a173a 100644 --- a/contrib/backends/srndv2/src/srnd/model_mem.go +++ b/contrib/backends/srndv2/src/srnd/model_mem.go @@ -486,7 +486,11 @@ func (self *post) Attachments() []AttachmentModel { } func (self *post) PostURL() string { - return fmt.Sprintf("%st/%s/#%s", self.Prefix(), HashMessageID(self.Parent), self.PostHash()) + i18n := self._i18n + if i18n == nil { + i18n = I18nProvider + } + return fmt.Sprintf("%st/%s/?lang=%s#%s", self.Prefix(), HashMessageID(self.Parent), i18n.Name, self.PostHash()) } func (self *post) Prefix() string { diff --git a/contrib/backends/srndv2/src/srnd/null_cache.go b/contrib/backends/srndv2/src/srnd/null_cache.go index cc9d49d..1e03daa 100644 --- a/contrib/backends/srndv2/src/srnd/null_cache.go +++ b/contrib/backends/srndv2/src/srnd/null_cache.go @@ -29,7 +29,7 @@ type nullHandler struct { func (self *nullHandler) GetI18N(r *http.Request) *I18N { lang := r.URL.Query().Get("lang") if lang == "" { - lang = I18nProvider.name + lang = I18nProvider.Name } self.access.Lock() i, ok := self.i18n[lang] diff --git a/contrib/templates/placebo/board.mustache b/contrib/templates/placebo/board.mustache index d253053..4c1715f 100644 --- a/contrib/templates/placebo/board.mustache +++ b/contrib/templates/placebo/board.mustache @@ -24,7 +24,7 @@ - +
Name | +{{#i18n.Translations}}{{name}}{{/i18n.Translations}} | |
---|---|---|
Subject | +{{#i18n.Translations}}{{subject}}{{/i18n.Translations}} | |
Comment | +{{#i18n.Translations}}{{comment}}{{/i18n.Translations}} | |
File | +{{#i18n.Translations}}{{file}}{{/i18n.Translations}} |
|