mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-15 08:16:38 -04:00
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:
parent
648f597d67
commit
c714d534f4
@ -136,6 +136,12 @@ This uses a definition like this one in `i18n/en-US.yaml`:
|
|||||||
- id: wordCount
|
- id: wordCount
|
||||||
translation: "This article has {{ .WordCount }} words."
|
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
|
### Multilingual Themes support
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user