This is not a hugo question per se, but I wonder if this community might be able to help. I am attempting to extract strings from my template files (layouts, partials, shortcodes, etc) using go-i18n and not having much luck.
I have the goi18n CLI installed and can run goi18n, but so far - I can only get it to produce empty files called active.en.toml.
To attempt a test, I have a file: /themes/my-theme/layouts/partials/site-navigation.html
Correct. goi18n extract is the command that I’m attempting to use. It produces empty (zero KB) active.en.toml files, but I suspect I’m just not finding the documentation on how to run it on specific files (I’ve tried all the obvious things) or run it recursively on folders. For example, I’ve tried:
Can you put a simple repo online so we can check this out? It’s always good to see the full code, there might be something “blinding” the extract function around the code lines in question.
No, I did not, and I apologize because I got side-tracked on other projects. I still intend to post a sample project where this is failing…it should be pretty trivial to reproduce with a boilerplate Hugo site though (famous last words). I suspect it’s just me using the goi18n incorrectly…but until I show the details of exactly what I’m doing, it won’t be obvious to anyone. It’s not off my radar.