tiger
1
Hi,
i don’t find anything in the doc about using variables in 118n function.
my yaml file:
- id: need_register
translation: "Registration needed for {{ .Params.variable }}"
in my partial
{{ i18n "need_register" }}
This is returning
Any help ?
Thank you.
regis
2
You need to pass the context to the i18n
function.
{{ i18n "need_register" . }}
.
being your page here.
See this blog post
tiger
3
What if i’m in a short code ? How can i pass the page context ? i got can’t evaluate field variable in type interface {}
regis
4
Your shortcode has your page context in .Page
.
{{ i18n "need_register" .Page }}
1 Like
tiger
5
Thank you very much ! I actually found your blog posts on google, they are really usefull. Merci !
1 Like
system
Closed
6
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.