translate fetch.go
This commit is contained in:
+4
-2
@@ -11,6 +11,8 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"golang.nytpu.com/comitium/localizations"
|
||||||
|
|
||||||
"golang.nytpu.com/comitium/core"
|
"golang.nytpu.com/comitium/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ func Feed(data *core.FullData, remote *url.URL, title string) error {
|
|||||||
case "gopher", "gophers":
|
case "gopher", "gophers":
|
||||||
return gopherFeed(data, remote.String(), title)
|
return gopherFeed(data, remote.String(), title)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unsupported protocol '%s'", remote.Scheme)
|
return fmt.Errorf(core.Localizer("errors.unsupported_protocol", &localizations.Replacements{"scheme": remote.Scheme})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ func Page(data *core.FullData, remote *url.URL, title string) error {
|
|||||||
case "gopher", "gophers":
|
case "gopher", "gophers":
|
||||||
return gopherPage(data, remote.String(), title)
|
return gopherPage(data, remote.String(), title)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unsupported protocol '%s'", remote.Scheme)
|
return fmt.Errorf(core.Localizer("errors.unsupported_protocol", &localizations.Replacements{"scheme": remote.Scheme})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user