Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Latexize localization output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Kittelberger committed Feb 20, 2017
1 parent 9a1ae64 commit 82b620c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion export/latex/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/jinzhu/now"
"github.com/nicksnyder/go-i18n/i18n"

"git.dekart811.net/icedream/workreportmgr/export/latex/stringutil"
"git.dekart811.net/icedream/workreportmgr/project"
)

Expand All @@ -29,11 +30,17 @@ type Exporter struct {
// Export generates LaTeX code from the given project and writes it to the given
// writer.
func (e *Exporter) Export(prj *project.Project, w io.Writer) (err error) {
T, err := i18n.Tfunc(e.Locale)
originalT, err := i18n.Tfunc(e.Locale)
if err != nil {
return
}

// Wrap translations with latexize just to be safe
// type TranslateFunc func(translationID string, args ...interface{}) string
T := func(translationID string, args ...interface{}) string {
return stringutil.Latexize(originalT(translationID, args...))
}

now.FirstDayMonday = prj.FirstDayMonday

exportTemplate = exportTemplate.Funcs(template.FuncMap{
Expand Down

0 comments on commit 82b620c

Please sign in to comment.