diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-08-09 12:41:56 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-09-06 18:32:19 +0300 |
commit | f1e1cdab3fd60e256a18149b4e39e6ba5980c803 (patch) | |
tree | a947c83be280751dd16187d2664abc915ec64f40 /commands | |
parent | 8da040342eb0a3098e54dc6ed2cb10bac6173230 (diff) |
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
Diffstat (limited to 'commands')
-rw-r--r-- | commands/hugo.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go index 6c28b78bd..d08851658 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -25,6 +25,8 @@ import ( "sync" "time" + "github.com/spf13/hugo/tpl" + "github.com/spf13/hugo/hugofs" "github.com/spf13/hugo/parser" @@ -242,6 +244,7 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) { cmd.Flags().BoolVar(&preserveTaxonomyNames, "preserveTaxonomyNames", false, `Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`) cmd.Flags().BoolVarP(&forceSync, "forceSyncStatic", "", false, "Copy all files when static is changed.") cmd.Flags().BoolVarP(&noTimes, "noTimes", "", false, "Don't sync modification time of files") + cmd.Flags().BoolVarP(&tpl.Logi18nWarnings, "i18n-warnings", "", false, "Print missing translations") // Set bash-completion. // Each flag must first be defined before using the SetAnnotation() call. |