You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the toml files : the template contains client application functions : goi18n application fails to convert it the flat file into json because those client applications functions are not known at that moment ;
I have to write by my self the json files ;
in my application, I just want to get the template as pass it to the client application for processing : again, it fails cause the Execute() function is called when getting the template and there is no arguments so far to make the execution correctly.
I don't known how to get this working in the end ...
I am not familiar with cobra, but you are correct that go-i18n does always execute the template (if the string contains at least one {{ in it).
text/template allows customizing the delimiter, so if you have access to the template from cobra then you can change the default delimiter there (and update your strings to use that delimiter).
go-i18n should ideally allow you to customize the delimiter too (but it doesn't currently). This would essentially allow you to disable templating in go-i18n strings by setting a delimiter that is never used.
Hi,
First of all, thank you for this nice tool !
My use case :
I am facing what follows with templates :
toml
files : the template contains client application functions :goi18n
application fails to convert it the flat file intojson
because those client applications functions are not known at that moment ;json
files ;Execute()
function is called when getting the template and there is no arguments so far to make the execution correctly.Digging into the code, I must admit that the
Execute()
function on template is always called even if there is no arguments (https://github.com/nicksnyder/go-i18n/blob/master/i18n/translation/template.go#L37 called by https://github.com/nicksnyder/go-i18n/blob/master/i18n/bundle/bundle.go#L387).Do you have any clue on how to manage this use case : let client application handle template execution ?
The text was updated successfully, but these errors were encountered: