1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Update vendor dependencies

This commit is contained in:
Frédéric Guillot 2018-07-06 21:18:14 -07:00
parent 34a3fe426b
commit 459bb4531f
747 changed files with 89857 additions and 39711 deletions

View file

@ -25,8 +25,6 @@ import (
"unicode"
"unicode/utf8"
"golang.org/x/text/message/pipeline"
"golang.org/x/text/language"
"golang.org/x/tools/go/buildutil"
)
@ -35,22 +33,7 @@ func init() {
flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", buildutil.TagsFlagDoc)
}
var (
srcLang = flag.String("srclang", "en-US", "the source-code language")
dir = flag.String("dir", "locales", "default subdirectory to store translation files")
)
func config() (*pipeline.Config, error) {
tag, err := language.Parse(*srcLang)
if err != nil {
return nil, wrap(err, "invalid srclang")
}
return &pipeline.Config{
SourceLanguage: tag,
TranslationsPattern: `messages\.(.*)\.json`,
GenFile: *out,
}, nil
}
var dir = flag.String("dir", "locales", "default subdirectory to store translation files")
// NOTE: the Command struct is copied from the go tool in core.
@ -59,7 +42,7 @@ func config() (*pipeline.Config, error) {
type Command struct {
// Run runs the command.
// The args are the arguments after the command name.
Run func(cmd *Command, c *pipeline.Config, args []string) error
Run func(cmd *Command, args []string) error
// UsageLine is the one-line usage message.
// The first word in the line is taken to be the command name.
@ -141,11 +124,7 @@ func main() {
cmd.Flag.Usage = func() { cmd.Usage() }
cmd.Flag.Parse(args[1:])
args = cmd.Flag.Args()
config, err := config()
if err != nil {
fatalf("gotext: %+v", err)
}
if err := cmd.Run(cmd, config, args); err != nil {
if err := cmd.Run(cmd, args); err != nil {
fatalf("gotext: %+v", err)
}
exit()