Starting with Go Templates, what does the T indicate in {{T "post_nav_prev"}}

Issue

Trying to understand Go templates in Hugo. I find the subject construct {{T "post_nav_prev"}}. I see post_nav_prev defined in i18n yaml file en.yaml, but can’t seem to find what T is or where it is defined. Sorry for the lack of basic knowledge. Thanks for any guidance.

Solution

T is an alias for lang.Translate

source : https://gohugo.io/functions/lang/#langtranslate

It define here

Answered By – Rahmat Fathoni

Answer Checked By – Senaida (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.