@bep Can I still use the i18n
function with either of those? For what it’s worth, I tried the following in my config.toml
hoping that would work:
[module]
[[module.mounts]]
source="data"
target="data"
[[module.mounts]]
source="i18n"
target="data/i18n"
The i18n
function still worked and I could still use things like .Site.Language.Lang
, but {{ $.Site.Data.i18n.en | jsonify }}
still came back as nil.
I’ll have to look into the resources.Match
and transform.Unmarshal
and I’ll report back on my findings.
For what it’s worth, the reason why I’m attempting this is that I have a Hugo site for an international audience where 95% of it is handled by Hugo. There’s a small javascript (React) app that is also embedded on a page. I’d like to have all the site translations in one location, and then have the React app grab those translations for use in its own i18n functions. Worst case, I can do something separate or maybe go the opposite route of storing the {lang}.yml
files more closely affiliated with the React app and mount them into the /i18n
directory.