New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions don't work in translated strings #10083
Comments
The texttemplate parser validates function existence, but that is currently limited to built-in template functions. For example, this works fine in an i18n file.
Not sure why Hugo's functions aren't in the function map at this point. |
The This is unfortunate, and is probably fixable ... but I would strongly recommend keeping the i18n files as simple as possible. The example in the intro could easily be rewritten as lastmod:
other: 'Last modified' Which In my head is a better setup (separation of concerns and all that). Then you can do templating/formatting in the layout template, e.g.: {{ i18n "lastmod" }}: {{ .Date | time.Format ":date_full" }} |
Yeah, the shorthand is somewhat appealing, but that could quickly get out of control:
|
One weekend project I was thinking of doing, to get a better grasp of what's possible with the recent outflow of local large language models (e.g. Llama 2) to create some tooling to translate |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
Issue description
I have the following translation in
i18n/en.yaml
:I then use it in a template this way:
I get the following error when building the site:
The text was updated successfully, but these errors were encountered: