From c714d534f4011c85fd9bc963b35f04e39f58aa0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 9 Aug 2016 11:41:56 +0200 Subject: [PATCH] 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 --- content/content/multilingual.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/content/multilingual.md b/content/content/multilingual.md index f23a6afcf..f5ff46f9c 100644 --- a/content/content/multilingual.md +++ b/content/content/multilingual.md @@ -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