1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Improve OPML import/export

This commit is contained in:
Frédéric Guillot 2017-11-20 14:35:11 -08:00
parent ace7524905
commit a76c2a8c22
15 changed files with 51 additions and 31 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.731951822 -0800 PST m=+0.044035320
// 2017-11-20 14:18:33.28176883 -0800 PST m=+0.037854908
package template

View file

@ -6,11 +6,6 @@ package template
import (
"bytes"
"github.com/miniflux/miniflux2/errors"
"github.com/miniflux/miniflux2/locale"
"github.com/miniflux/miniflux2/server/route"
"github.com/miniflux/miniflux2/server/template/helper"
"github.com/miniflux/miniflux2/server/ui/filter"
"html/template"
"io"
"log"
@ -18,6 +13,12 @@ import (
"strings"
"time"
"github.com/miniflux/miniflux2/errors"
"github.com/miniflux/miniflux2/locale"
"github.com/miniflux/miniflux2/server/route"
"github.com/miniflux/miniflux2/server/template/helper"
"github.com/miniflux/miniflux2/server/ui/filter"
"github.com/gorilla/mux"
)
@ -61,11 +62,13 @@ func (t *TemplateEngine) ParseAll() {
},
"t": func(key interface{}, args ...interface{}) string {
switch key.(type) {
case string, error:
case string:
return t.currentLocale.Get(key.(string), args...)
case errors.LocalizedError:
err := key.(errors.LocalizedError)
return err.Localize(t.currentLocale)
case error:
return key.(error).Error()
default:
return ""
}

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.712375345 -0800 PST m=+0.024458843
// 2017-11-20 14:18:33.257809595 -0800 PST m=+0.013895673
package template