I have tried to place the {{ i18n "nav_home" }} in the index.html page as well as in a template (in layouts folder) however I get the following error output from the Hugo server
ERROR: 2016/09/08 07:52:23 general.go:212: Error while rendering homepage: template: index.html:18:4: executing "index.html" at <i18n "nav_home">: error calling i18n: i18n not initialized, have you configured everything properly?
I was wondering if I have missed an option to configure/initialize i18n?
Thanks!
pascal
OK, I believe I see what is happening here. We might get some clever RFC 5646 inheritance support in the future, but the current behavior is this:
For your site with language en it looks for a i81n file with that base name. If a language file doesn’t exist for a given language code, it tries to fall back to the DefaultLanugageCode (en if not set). In your case the language in the i18n is more specific than the site definition and there is also no default file to fall back on.
@abourget may have some thoughts on this, but currently en-US and en-BR (or whatever) must be considered as two totally separate languages.
I’m not sure if we should of how we could improve this, but I’m open to suggestions.
It would save me some work if you could just “edit it in place” and GitHub will create a pull request for it. I will also make the error message mentioned above more clear as what to expect.