mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-05 19:18:18 +00:00
Help: Remove all mentions of Russian docs
I hope
This commit is contained in:
parent
16114f5e83
commit
36edcf6b77
@ -9,7 +9,7 @@
|
||||
|
||||
{% func beautifulLink(hyphaName string) %}<a href="/hypha/{%s= hyphaName %}">{%s util.BeautifulName(hyphaName) %}</a>{% endfunc %}
|
||||
|
||||
{% func mycoLink(lc *l18n.Localizer) %}<a href="/help/{%s lc.Locale %}/mycomarkup" class="shy-link">{%s lc.Get("ui.notexist_write_myco") %}</a>{% endfunc %}
|
||||
{% func mycoLink(lc *l18n.Localizer) %}<a href="/help/en/mycomarkup" class="shy-link">{%s lc.Get("ui.notexist_write_myco") %}</a>{% endfunc %}
|
||||
|
||||
{% func nonExistentHyphaNotice(h *hyphae.Hypha, u *user.User, lc *l18n.Localizer) %}
|
||||
<section class="non-existent-hypha">
|
||||
|
@ -82,11 +82,7 @@ func beautifulLink(hyphaName string) string {
|
||||
//line views/hypha.qtpl:12
|
||||
func streammycoLink(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
|
||||
//line views/hypha.qtpl:12
|
||||
qw422016.N().S(`<a href="/help/`)
|
||||
//line views/hypha.qtpl:12
|
||||
qw422016.E().S(lc.Locale)
|
||||
//line views/hypha.qtpl:12
|
||||
qw422016.N().S(`/mycomarkup" class="shy-link">`)
|
||||
qw422016.N().S(`<a href="/help/en/mycomarkup" class="shy-link">`)
|
||||
//line views/hypha.qtpl:12
|
||||
qw422016.E().S(lc.Get("ui.notexist_write_myco"))
|
||||
//line views/hypha.qtpl:12
|
||||
|
@ -42,7 +42,7 @@
|
||||
</button>
|
||||
{% endfor %}
|
||||
</section>
|
||||
<p class="edit-toolbar__ad">{%s= lc.Get("edit.help", &l18n.Replacements{"link": fmt.Sprintf("<a href=\"/help/%s/mycomarkup\" target=\"_blank\" class=\"shy-link\">%s</a>", lc.Locale, lc.Get("edit.help_link"))}) %}</p>
|
||||
<p class="edit-toolbar__ad">{%s= lc.Get("edit.help", &l18n.Replacements{"link": fmt.Sprintf("<a href=\"/help/en/mycomarkup\" target=\"_blank\" class=\"shy-link\">%s</a>", lc.Get("edit.help_link"))}) %}</p>
|
||||
</aside>
|
||||
<aside class="edit-toolbar action-toolbar layout-card">
|
||||
<h2 class="edit-toolbar__title layout-card__title">{%s lc.Get("edit.actions")%}</h2>
|
||||
|
@ -98,7 +98,7 @@ func StreamToolbar(qw422016 *qt422016.Writer, u *user.User, lc *l18n.Localizer)
|
||||
</section>
|
||||
<p class="edit-toolbar__ad">`)
|
||||
//line views/mutators.qtpl:45
|
||||
qw422016.N().S(lc.Get("edit.help", &l18n.Replacements{"link": fmt.Sprintf("<a href=\"/help/%s/mycomarkup\" target=\"_blank\" class=\"shy-link\">%s</a>", lc.Locale, lc.Get("edit.help_link"))}))
|
||||
qw422016.N().S(lc.Get("edit.help", &l18n.Replacements{"link": fmt.Sprintf("<a href=\"/help/en/mycomarkup\" target=\"_blank\" class=\"shy-link\">%s</a>", lc.Get("edit.help_link"))}))
|
||||
//line views/mutators.qtpl:45
|
||||
qw422016.N().S(`</p>
|
||||
</aside>
|
||||
|
@ -19,9 +19,9 @@
|
||||
<main class="main-width attachment-tab">
|
||||
<h1>{%s= lc.Get("ui.attach_title", &l18n.Replacements{"name": beautifulLink(h.Name)}) %}</h1>
|
||||
{% if h.BinaryPath == "" %}
|
||||
<p class="explanation">{%s lc.Get("ui.attach_empty") %} <a href="/help/{%s lc.Locale %}/attachment" class="shy-link">{%s lc.Get("ui.attach_link") %}</a></p>
|
||||
<p class="explanation">{%s lc.Get("ui.attach_empty") %} <a href="/help/en/attachment" class="shy-link">{%s lc.Get("ui.attach_link") %}</a></p>
|
||||
{% else %}
|
||||
<p class="explanation">{%s lc.Get("ui.attach_tip") %} <a href="/help/{%s lc.Locale %}/attachment" class="shy-link">{%s lc.Get("ui.attach_link") %}</a></p>
|
||||
<p class="explanation">{%s lc.Get("ui.attach_tip") %} <a href="/help/en/attachment" class="shy-link">{%s lc.Get("ui.attach_link") %}</a></p>
|
||||
{% endif %}
|
||||
|
||||
<section class="amnt-grid">
|
||||
|
@ -76,11 +76,7 @@ func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hy
|
||||
//line views/readers.qtpl:22
|
||||
qw422016.E().S(lc.Get("ui.attach_empty"))
|
||||
//line views/readers.qtpl:22
|
||||
qw422016.N().S(` <a href="/help/`)
|
||||
//line views/readers.qtpl:22
|
||||
qw422016.E().S(lc.Locale)
|
||||
//line views/readers.qtpl:22
|
||||
qw422016.N().S(`/attachment" class="shy-link">`)
|
||||
qw422016.N().S(` <a href="/help/en/attachment" class="shy-link">`)
|
||||
//line views/readers.qtpl:22
|
||||
qw422016.E().S(lc.Get("ui.attach_link"))
|
||||
//line views/readers.qtpl:22
|
||||
@ -94,11 +90,7 @@ func StreamAttachmentMenuHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hy
|
||||
//line views/readers.qtpl:24
|
||||
qw422016.E().S(lc.Get("ui.attach_tip"))
|
||||
//line views/readers.qtpl:24
|
||||
qw422016.N().S(` <a href="/help/`)
|
||||
//line views/readers.qtpl:24
|
||||
qw422016.E().S(lc.Locale)
|
||||
//line views/readers.qtpl:24
|
||||
qw422016.N().S(`/attachment" class="shy-link">`)
|
||||
qw422016.N().S(` <a href="/help/en/attachment" class="shy-link">`)
|
||||
//line views/readers.qtpl:24
|
||||
qw422016.E().S(lc.Get("ui.attach_link"))
|
||||
//line views/readers.qtpl:24
|
||||
|
@ -198,7 +198,7 @@ It outputs a poorly formatted JSON, but it works and is valid.
|
||||
{% endfunc %}
|
||||
|
||||
{% func helpTopicBadgeHTML(lang, topic string) %}
|
||||
<a class="help-topic-badge" href="/help/{%s lang %}/{%s topic %}">?</a>
|
||||
<a class="help-topic-badge" href="/help/en/{%s topic %}">?</a>
|
||||
{% endfunc %}
|
||||
|
||||
{% func UserListHTML(lc *l18n.Localizer) %}
|
||||
|
@ -794,11 +794,7 @@ func helpTopicsHTML(lang string, lc *l18n.Localizer) string {
|
||||
func streamhelpTopicBadgeHTML(qw422016 *qt422016.Writer, lang, topic string) {
|
||||
//line views/stuff.qtpl:200
|
||||
qw422016.N().S(`
|
||||
<a class="help-topic-badge" href="/help/`)
|
||||
//line views/stuff.qtpl:201
|
||||
qw422016.E().S(lang)
|
||||
//line views/stuff.qtpl:201
|
||||
qw422016.N().S(`/`)
|
||||
<a class="help-topic-badge" href="/help/en/`)
|
||||
//line views/stuff.qtpl:201
|
||||
qw422016.E().S(topic)
|
||||
//line views/stuff.qtpl:201
|
||||
|
19
web/stuff.go
19
web/stuff.go
@ -41,17 +41,18 @@ func initStuff(r *mux.Router) {
|
||||
func handlerHelp(w http.ResponseWriter, rq *http.Request) {
|
||||
lc := l18n.FromRequest(rq)
|
||||
articlePath := strings.TrimPrefix(strings.TrimPrefix(rq.URL.Path, "/help/"), "/help")
|
||||
lang := "en" // replace with lc.Locale once Russian docs are back
|
||||
// See the history of this file to resurrect the old algorithm that supported multiple languages
|
||||
lang := "en"
|
||||
if articlePath == "" {
|
||||
articlePath = "en" // replace with lc.Locale once Russian docs are back
|
||||
} else {
|
||||
var slashIndex = strings.Index(articlePath, "/")
|
||||
if slashIndex == -1 {
|
||||
lang = articlePath
|
||||
} else {
|
||||
lang = articlePath[:slashIndex]
|
||||
}
|
||||
articlePath = "en"
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(articlePath, "en") {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
_, _ = io.WriteString(w, "404 Not found")
|
||||
return
|
||||
}
|
||||
|
||||
content, err := help.Get(articlePath)
|
||||
if err != nil && strings.HasPrefix(err.Error(), "open") {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
|
Loading…
x
Reference in New Issue
Block a user