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

@ -28,12 +28,8 @@ import (
// - handle features (gender, plural)
// - message rewriting
// - %m substitutions
// - `msg:"etc"` tags
// - msg/Msg top-level vars and strings.
// Extract extracts all strings form the package defined in Config.
func Extract(c *Config) (*State, error) {
func Extract(c *Config) (*Locale, error) {
conf := loader.Config{}
prog, err := loadPackages(&conf, c.Packages)
if err != nil {
@ -145,11 +141,9 @@ func Extract(c *Config) (*State, error) {
ph := placeholders{index: map[string]string{}}
trimmed, _, _ := trimWS(fmtMsg)
p := fmtparser.Parser{}
p.Reset(simArgs)
for p.SetFormat(trimmed); p.Scan(); {
for p.SetFormat(fmtMsg); p.Scan(); {
switch p.Status {
case fmtparser.StatusText:
msg += p.Text()
@ -195,14 +189,11 @@ func Extract(c *Config) (*State, error) {
}
}
return &State{
Config: *c,
program: prog,
Extracted: Messages{
Language: c.SourceLanguage,
Messages: messages,
},
}, nil
out := &Locale{
Language: c.SourceLanguage,
Messages: messages,
}
return out, nil
}
func posString(conf loader.Config, info *loader.PackageInfo, pos token.Pos) string {
@ -251,7 +242,7 @@ func strip(s string) string {
if unicode.IsSpace(r) || r == '-' {
return '_'
}
if !unicode.In(r, unicode.Letter, unicode.Mark, unicode.Number) {
if !unicode.In(r, unicode.Letter, unicode.Mark) {
return -1
}
return r