diff --git a/go.mod b/go.mod index 681d32d..ed0835f 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( ) require ( + github.com/chekoopa/go-localize v0.4.0 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/stretchr/testify v1.7.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect diff --git a/go.sum b/go.sum index 0baee01..743caa7 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,11 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/bouncepaw/mycomarkup/v3 v3.5.2 h1:AEcGFxFa6OlTkjBwi6+zlTxV7St89bDr8UM2TSmkRcw= github.com/bouncepaw/mycomarkup/v3 v3.5.2/go.mod h1:BpiGUVsYCgRZCDxF0iIdc08LJokm/Ab36S/Hif0J6D0= +github.com/chekoopa/go-localize v0.4.0 h1:XUgliKdAE0fff2MOEfjHP/Sj1Iy6Yxn4zXOj3jXfDE8= +github.com/chekoopa/go-localize v0.4.0/go.mod h1:bMeziCOnL4H5lGOy2o0eWBRNht2x2RRNWGKZ4oDuxNU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-ini/ini v1.63.2 h1:kwN3umicd2HF3Tgvap4um1ZG52/WyKT9GGdPx0CJk6Y= @@ -49,5 +53,7 @@ golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/views/stuff.qtpl b/views/stuff.qtpl index 357838c..0ddaed6 100644 --- a/views/stuff.qtpl +++ b/views/stuff.qtpl @@ -182,7 +182,6 @@ It outputs a poorly formatted JSON, but it works and is valid.
  • {%s lc.GetWithLocale(lang, "help.prevnext") %}
  • {%s lc.GetWithLocale(lang, "help.top_bar") %}
  • {%s lc.GetWithLocale(lang, "help.sibling_hyphae") %}
  • -
  • ...
  • {%s lc.GetWithLocale(lang, "help.special_pages") %} @@ -197,7 +196,6 @@ It outputs a poorly formatted JSON, but it works and is valid.
  • {%s lc.GetWithLocale(lang, "help.lock") %}
  • {%s lc.GetWithLocale(lang, "help.whitelist") %}
  • {%s lc.GetWithLocale(lang, "help.telegram") %}
  • -
  • ...
  • diff --git a/views/stuff.qtpl.go b/views/stuff.qtpl.go index 7ffd2c6..63899d7 100644 --- a/views/stuff.qtpl.go +++ b/views/stuff.qtpl.go @@ -703,168 +703,166 @@ func streamhelpTopicsHTML(qw422016 *qt422016.Writer, lang string, lc *l18n.Local qw422016.E().S(lc.GetWithLocale(lang, "help.sibling_hyphae")) //line views/stuff.qtpl:184 qw422016.N().S(` -
  • ...
  • `) -//line views/stuff.qtpl:188 +//line views/stuff.qtpl:187 qw422016.E().S(lc.GetWithLocale(lang, "help.special_pages")) -//line views/stuff.qtpl:188 +//line views/stuff.qtpl:187 qw422016.N().S(`
  • `) -//line views/stuff.qtpl:194 +//line views/stuff.qtpl:193 qw422016.E().S(lc.GetWithLocale(lang, "help.configuration")) -//line views/stuff.qtpl:194 +//line views/stuff.qtpl:193 qw422016.N().S(`
  • `) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 } -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 func writehelpTopicsHTML(qq422016 qtio422016.Writer, lang string, lc *l18n.Localizer) { -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 streamhelpTopicsHTML(qw422016, lang, lc) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 } -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 func helpTopicsHTML(lang string, lc *l18n.Localizer) string { -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 writehelpTopicsHTML(qb422016, lang, lc) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 return qs422016 -//line views/stuff.qtpl:205 +//line views/stuff.qtpl:203 } -//line views/stuff.qtpl:207 +//line views/stuff.qtpl:205 func streamhelpTopicBadgeHTML(qw422016 *qt422016.Writer, lang, topic string) { -//line views/stuff.qtpl:207 +//line views/stuff.qtpl:205 qw422016.N().S(` ? `) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 } -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 func writehelpTopicBadgeHTML(qq422016 qtio422016.Writer, lang, topic string) { -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 streamhelpTopicBadgeHTML(qw422016, lang, topic) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 } -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 func helpTopicBadgeHTML(lang, topic string) string { -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 writehelpTopicBadgeHTML(qb422016, lang, topic) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 return qs422016 -//line views/stuff.qtpl:209 +//line views/stuff.qtpl:207 } -//line views/stuff.qtpl:211 +//line views/stuff.qtpl:209 func StreamUserListHTML(qw422016 *qt422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:211 +//line views/stuff.qtpl:209 qw422016.N().S(`

    `) -//line views/stuff.qtpl:214 +//line views/stuff.qtpl:212 qw422016.E().S(lc.Get("ui.users_heading")) -//line views/stuff.qtpl:214 +//line views/stuff.qtpl:212 qw422016.N().S(`

    `) -//line views/stuff.qtpl:216 +//line views/stuff.qtpl:214 var ( admins = make([]string, 0) moderators = make([]string, 0) @@ -884,149 +882,149 @@ func StreamUserListHTML(qw422016 *qt422016.Writer, lc *l18n.Localizer) { sort.Strings(moderators) sort.Strings(editors) -//line views/stuff.qtpl:234 +//line views/stuff.qtpl:232 qw422016.N().S(`

    `) -//line views/stuff.qtpl:236 +//line views/stuff.qtpl:234 qw422016.E().S(lc.Get("ui.users_admins")) -//line views/stuff.qtpl:236 +//line views/stuff.qtpl:234 qw422016.N().S(`

      `) -//line views/stuff.qtpl:237 +//line views/stuff.qtpl:235 for _, name := range admins { +//line views/stuff.qtpl:235 + qw422016.N().S(` +
    1. `) +//line views/stuff.qtpl:236 + qw422016.E().S(name) +//line views/stuff.qtpl:236 + qw422016.N().S(`
    2. + `) //line views/stuff.qtpl:237 - qw422016.N().S(` -
    3. `) -//line views/stuff.qtpl:238 - qw422016.E().S(name) -//line views/stuff.qtpl:238 - qw422016.N().S(`
    4. - `) -//line views/stuff.qtpl:239 } -//line views/stuff.qtpl:239 +//line views/stuff.qtpl:237 qw422016.N().S(`

    `) -//line views/stuff.qtpl:242 +//line views/stuff.qtpl:240 qw422016.E().S(lc.Get("ui.users_moderators")) -//line views/stuff.qtpl:242 +//line views/stuff.qtpl:240 qw422016.N().S(`

      `) -//line views/stuff.qtpl:243 +//line views/stuff.qtpl:241 for _, name := range moderators { -//line views/stuff.qtpl:243 +//line views/stuff.qtpl:241 qw422016.N().S(`
    1. `) -//line views/stuff.qtpl:244 +//line views/stuff.qtpl:242 qw422016.E().S(name) -//line views/stuff.qtpl:244 +//line views/stuff.qtpl:242 qw422016.N().S(`
    2. `) -//line views/stuff.qtpl:245 +//line views/stuff.qtpl:243 } -//line views/stuff.qtpl:245 +//line views/stuff.qtpl:243 qw422016.N().S(`

    `) -//line views/stuff.qtpl:248 +//line views/stuff.qtpl:246 qw422016.E().S(lc.Get("ui.users_editors")) -//line views/stuff.qtpl:248 +//line views/stuff.qtpl:246 qw422016.N().S(`

      `) -//line views/stuff.qtpl:249 +//line views/stuff.qtpl:247 for _, name := range editors { -//line views/stuff.qtpl:249 +//line views/stuff.qtpl:247 qw422016.N().S(`
    1. `) -//line views/stuff.qtpl:250 +//line views/stuff.qtpl:248 qw422016.E().S(name) -//line views/stuff.qtpl:250 +//line views/stuff.qtpl:248 qw422016.N().S(`
    2. `) -//line views/stuff.qtpl:251 +//line views/stuff.qtpl:249 } -//line views/stuff.qtpl:251 +//line views/stuff.qtpl:249 qw422016.N().S(`
    `) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 } -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 func WriteUserListHTML(qq422016 qtio422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 StreamUserListHTML(qw422016, lc) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 } -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 func UserListHTML(lc *l18n.Localizer) string { -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 WriteUserListHTML(qb422016, lc) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 return qs422016 -//line views/stuff.qtpl:255 +//line views/stuff.qtpl:253 } -//line views/stuff.qtpl:257 +//line views/stuff.qtpl:255 func StreamHyphaListHTML(qw422016 *qt422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:257 +//line views/stuff.qtpl:255 qw422016.N().S(`

    `) -//line views/stuff.qtpl:260 +//line views/stuff.qtpl:258 qw422016.E().S(lc.Get("ui.list_heading")) -//line views/stuff.qtpl:260 +//line views/stuff.qtpl:258 qw422016.N().S(`

    `) -//line views/stuff.qtpl:261 +//line views/stuff.qtpl:259 qw422016.E().S(lc.GetPlural("ui.list_desc", hyphae.Count())) -//line views/stuff.qtpl:261 +//line views/stuff.qtpl:259 qw422016.N().S(`

    `) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 } -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 func WriteHyphaListHTML(qq422016 qtio422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 StreamHyphaListHTML(qw422016, lc) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 } -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 func HyphaListHTML(lc *l18n.Localizer) string { -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 WriteHyphaListHTML(qb422016, lc) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 return qs422016 -//line views/stuff.qtpl:283 +//line views/stuff.qtpl:281 } -//line views/stuff.qtpl:285 +//line views/stuff.qtpl:283 func StreamAboutHTML(qw422016 *qt422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:285 +//line views/stuff.qtpl:283 qw422016.N().S(`

    `) -//line views/stuff.qtpl:289 +//line views/stuff.qtpl:287 qw422016.E().S(lc.Get("ui.about_title", &l18n.Replacements{"name": cfg.WikiName})) -//line views/stuff.qtpl:289 +//line views/stuff.qtpl:287 qw422016.N().S(`

    • `) -//line views/stuff.qtpl:291 +//line views/stuff.qtpl:289 qw422016.N().S(lc.Get("ui.about_version", &l18n.Replacements{"pre": "", "post": ""})) -//line views/stuff.qtpl:291 +//line views/stuff.qtpl:289 qw422016.N().S(` 1.7.0
    • `) -//line views/stuff.qtpl:292 +//line views/stuff.qtpl:290 if cfg.UseAuth { -//line views/stuff.qtpl:292 +//line views/stuff.qtpl:290 qw422016.N().S(`
    • `) -//line views/stuff.qtpl:293 +//line views/stuff.qtpl:291 qw422016.E().S(lc.Get("ui.about_usercount")) -//line views/stuff.qtpl:293 +//line views/stuff.qtpl:291 qw422016.N().S(` `) -//line views/stuff.qtpl:293 +//line views/stuff.qtpl:291 qw422016.N().DUL(user.Count()) -//line views/stuff.qtpl:293 +//line views/stuff.qtpl:291 qw422016.N().S(`
    • `) -//line views/stuff.qtpl:294 +//line views/stuff.qtpl:292 qw422016.E().S(lc.Get("ui.about_homepage")) -//line views/stuff.qtpl:294 +//line views/stuff.qtpl:292 qw422016.N().S(` `) -//line views/stuff.qtpl:294 +//line views/stuff.qtpl:292 qw422016.E().S(cfg.HomeHypha) -//line views/stuff.qtpl:294 +//line views/stuff.qtpl:292 qw422016.N().S(`
    • `) -//line views/stuff.qtpl:295 +//line views/stuff.qtpl:293 qw422016.E().S(lc.Get("ui.about_admins")) -//line views/stuff.qtpl:295 +//line views/stuff.qtpl:293 qw422016.N().S(``) -//line views/stuff.qtpl:295 +//line views/stuff.qtpl:293 for i, username := range user.ListUsersWithGroup("admin") { -//line views/stuff.qtpl:296 +//line views/stuff.qtpl:294 if i > 0 { -//line views/stuff.qtpl:296 +//line views/stuff.qtpl:294 qw422016.N().S(` `) -//line views/stuff.qtpl:297 +//line views/stuff.qtpl:295 } -//line views/stuff.qtpl:297 +//line views/stuff.qtpl:295 qw422016.N().S(` `) -//line views/stuff.qtpl:298 +//line views/stuff.qtpl:296 qw422016.E().S(username) -//line views/stuff.qtpl:298 +//line views/stuff.qtpl:296 qw422016.N().S(``) -//line views/stuff.qtpl:298 +//line views/stuff.qtpl:296 } +//line views/stuff.qtpl:296 + qw422016.N().S(`
    • +`) +//line views/stuff.qtpl:297 + } else { +//line views/stuff.qtpl:297 + qw422016.N().S(`
    • `) +//line views/stuff.qtpl:298 + qw422016.E().S(lc.Get("ui.about_noauth")) //line views/stuff.qtpl:298 qw422016.N().S(`
    • `) //line views/stuff.qtpl:299 - } else { -//line views/stuff.qtpl:299 - qw422016.N().S(`
    • `) -//line views/stuff.qtpl:300 - qw422016.E().S(lc.Get("ui.about_noauth")) -//line views/stuff.qtpl:300 - qw422016.N().S(`
    • -`) -//line views/stuff.qtpl:301 } -//line views/stuff.qtpl:301 +//line views/stuff.qtpl:299 qw422016.N().S(`

    `) -//line views/stuff.qtpl:303 +//line views/stuff.qtpl:301 qw422016.N().S(lc.Get("ui.about_hyphae", &l18n.Replacements{"link": "/list"})) -//line views/stuff.qtpl:303 +//line views/stuff.qtpl:301 qw422016.N().S(`

    `) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 } -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 func WriteAboutHTML(qq422016 qtio422016.Writer, lc *l18n.Localizer) { -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 StreamAboutHTML(qw422016, lc) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 } -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 func AboutHTML(lc *l18n.Localizer) string { -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 WriteAboutHTML(qb422016, lc) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 return qs422016 -//line views/stuff.qtpl:307 +//line views/stuff.qtpl:305 } -//line views/stuff.qtpl:309 +//line views/stuff.qtpl:307 func StreamCommonScripts(qw422016 *qt422016.Writer) { -//line views/stuff.qtpl:309 +//line views/stuff.qtpl:307 qw422016.N().S(` `) -//line views/stuff.qtpl:310 +//line views/stuff.qtpl:308 for _, scriptPath := range cfg.CommonScripts { -//line views/stuff.qtpl:310 +//line views/stuff.qtpl:308 qw422016.N().S(` `) -//line views/stuff.qtpl:312 +//line views/stuff.qtpl:310 } -//line views/stuff.qtpl:312 +//line views/stuff.qtpl:310 qw422016.N().S(` `) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 } -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 func WriteCommonScripts(qq422016 qtio422016.Writer) { -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 qw422016 := qt422016.AcquireWriter(qq422016) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 StreamCommonScripts(qw422016) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 qt422016.ReleaseWriter(qw422016) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 } -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 func CommonScripts() string { -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 qb422016 := qt422016.AcquireByteBuffer() -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 WriteCommonScripts(qb422016) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 qs422016 := string(qb422016.B) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 qt422016.ReleaseByteBuffer(qb422016) -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 return qs422016 -//line views/stuff.qtpl:313 +//line views/stuff.qtpl:311 }