Improve i18n string handling

* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
This commit is contained in:
Bjørn Erik Pedersen
2016-08-09 11:41:56 +02:00
parent 8da040342e
commit f1e1cdab3f
3 changed files with 51 additions and 16 deletions

View File

@@ -136,6 +136,12 @@ This uses a definition like this one in `i18n/en-US.yaml`:
- id: wordCount
translation: "This article has {{ .WordCount }} words."
```
To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
```bash
hugo --i18n-warnings | grep i18n
i18n|MISSING_TRANSLATION|en|wordCount
```
### Multilingual Themes support