mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02: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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user