diff --git a/export/latex/export.go b/export/latex/export.go index 84c1a4c..b846148 100644 --- a/export/latex/export.go +++ b/export/latex/export.go @@ -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" ) @@ -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{