Continue work on localization
This commit is contained in:
parent
26182ca256
commit
bbc28621b5
|
@ -1 +1,2 @@
|
|||
/dist/*
|
||||
*.bak
|
||||
|
|
|
@ -33,6 +33,12 @@ type aboutTmpl struct {
|
|||
|
||||
AdminName string
|
||||
AdminMail string
|
||||
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
type aboutMinTmp struct {
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
// Pattern: /about
|
||||
|
@ -49,6 +55,7 @@ func (data Data) AboutHand(rw http.ResponseWriter, req *http.Request) {
|
|||
ServerRules: template.HTML(*data.ServerRules),
|
||||
AdminName: *data.AdminName,
|
||||
AdminMail: *data.AdminMail,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
// Show page
|
||||
|
@ -68,7 +75,7 @@ func (data Data) LicenseHand(rw http.ResponseWriter, req *http.Request) {
|
|||
// Show page
|
||||
rw.Header().Set("Content-Type", "text/html")
|
||||
|
||||
err := data.License.Execute(rw, "")
|
||||
err := data.License.Execute(rw, aboutMinTmp{Translate: data.Locales.findLocale(req).translate})
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
}
|
||||
|
@ -82,7 +89,7 @@ func (data Data) SourceCodePageHand(rw http.ResponseWriter, req *http.Request) {
|
|||
// Show page
|
||||
rw.Header().Set("Content-Type", "text/html")
|
||||
|
||||
err := data.SourceCodePage.Execute(rw, "")
|
||||
err := data.SourceCodePage.Execute(rw, aboutMinTmp{Translate: data.Locales.findLocale(req).translate})
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
}
|
||||
|
|
|
@ -19,15 +19,25 @@
|
|||
package web
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type docsTmpl struct {
|
||||
Highlight func(string, string) template.HTML
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
// Pattern: /docs
|
||||
func (data Data) DocsHand(rw http.ResponseWriter, req *http.Request) {
|
||||
data.Log.HttpRequest(req)
|
||||
|
||||
rw.Header().Set("Content-Type", "text/html")
|
||||
data.Docs.Execute(rw, "")
|
||||
err := data.Docs.Execute(rw, docsTmpl{Translate: data.Locales.findLocale(req).translate})
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Pattern: /docs/apiv1
|
||||
|
@ -35,7 +45,14 @@ func (data Data) DocsApiV1Hand(rw http.ResponseWriter, req *http.Request) {
|
|||
data.Log.HttpRequest(req)
|
||||
|
||||
rw.Header().Set("Content-Type", "text/html")
|
||||
data.DocsApiV1.Execute(rw, tryHighlight)
|
||||
err := data.DocsApiV1.Execute(rw, docsTmpl{
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
Highlight: tryHighlight,
|
||||
})
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Pattern: /docs/api_libs
|
||||
|
@ -43,5 +60,9 @@ func (data Data) DocsApiLibsHand(rw http.ResponseWriter, req *http.Request) {
|
|||
data.Log.HttpRequest(req)
|
||||
|
||||
rw.Header().Set("Content-Type", "text/html")
|
||||
data.DocsApiLibs.Execute(rw, "")
|
||||
err := data.DocsApiLibs.Execute(rw, docsTmpl{Translate: data.Locales.findLocale(req).translate})
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ type embTmpl struct {
|
|||
Body template.HTML
|
||||
|
||||
ErrorNotFound bool
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
// Pattern: /emb/
|
||||
|
@ -70,6 +71,7 @@ func (data Data) EmbeddedHand(rw http.ResponseWriter, req *http.Request) {
|
|||
Body: tryHighlight(paste.Body, paste.Syntax),
|
||||
|
||||
ErrorNotFound: errorNotFound,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
// Show paste
|
||||
|
|
|
@ -31,6 +31,8 @@ type embHelpTmpl struct {
|
|||
|
||||
Protocol string
|
||||
Host string
|
||||
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
// Pattern: /emb_help/
|
||||
|
@ -61,6 +63,7 @@ func (data Data) EmbeddedHelpHand(rw http.ResponseWriter, req *http.Request) {
|
|||
OneUse: paste.OneUse,
|
||||
Protocol: netshare.GetProtocol(req.Header),
|
||||
Host: netshare.GetHost(req),
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
err = data.EmbeddedHelpPage.Execute(rw, tmplData)
|
||||
|
|
|
@ -27,6 +27,7 @@ type errorTmpl struct {
|
|||
Error string
|
||||
AdminName string
|
||||
AdminMail string
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
func (data Data) errorBadRequest(rw http.ResponseWriter, req *http.Request) {
|
||||
|
@ -40,6 +41,7 @@ func (data Data) errorBadRequest(rw http.ResponseWriter, req *http.Request) {
|
|||
Code: 400,
|
||||
AdminName: *data.AdminName,
|
||||
AdminMail: *data.AdminMail,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
e := data.ErrorPage.Execute(rw, errData)
|
||||
|
@ -59,6 +61,7 @@ func (data Data) errorNotFound(rw http.ResponseWriter, req *http.Request) {
|
|||
Code: 404,
|
||||
AdminName: *data.AdminName,
|
||||
AdminMail: *data.AdminMail,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
e := data.ErrorPage.Execute(rw, errData)
|
||||
|
@ -81,6 +84,7 @@ func (data Data) errorInternal(rw http.ResponseWriter, req *http.Request, err er
|
|||
Code: 500,
|
||||
AdminName: *data.AdminName,
|
||||
AdminMail: *data.AdminMail,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
e := data.ErrorPage.Execute(rw, errData)
|
||||
|
|
|
@ -38,6 +38,12 @@ type pasteTmpl struct {
|
|||
LineEnd string
|
||||
CreateTimeStr string
|
||||
DeleteTimeStr string
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
type pasteContinueTmpl struct {
|
||||
ID string
|
||||
Translate func(string) string
|
||||
}
|
||||
|
||||
func (data Data) getPaste(rw http.ResponseWriter, req *http.Request) {
|
||||
|
@ -63,7 +69,12 @@ func (data Data) getPaste(rw http.ResponseWriter, req *http.Request) {
|
|||
req.ParseForm()
|
||||
|
||||
if req.PostForm.Get("oneUseContinue") != "true" {
|
||||
err = data.PasteContinue.Execute(rw, paste)
|
||||
tmplData := pasteContinueTmpl{
|
||||
ID: paste.ID,
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
err = data.PasteContinue.Execute(rw, tmplData)
|
||||
if err != nil {
|
||||
data.errorInternal(rw, req, err)
|
||||
return
|
||||
|
@ -95,6 +106,8 @@ func (data Data) getPaste(rw http.ResponseWriter, req *http.Request) {
|
|||
|
||||
CreateTimeStr: createTime.Format("Mon, 02 Jan 2006 15:04:05 -0700"),
|
||||
DeleteTimeStr: deleteTime.Format("Mon, 02 Jan 2006 15:04:05 -0700"),
|
||||
|
||||
Translate: data.Locales.findLocale(req).translate,
|
||||
}
|
||||
|
||||
// Get body line end
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
{{define "titlePrefix"}}About | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `About` }} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
{{if ne .ServerAbout ``}}
|
||||
<h3>About this server</h3>
|
||||
<h3>{{ call .Translate `About this server` }}</h3>
|
||||
{{.ServerAbout}}
|
||||
{{end}}
|
||||
|
||||
{{if ne .ServerRules ``}}
|
||||
<h3>This server rules</h3>
|
||||
<h3>{{ call .Translate `This server rules` }}</h3>
|
||||
{{.ServerRules}}
|
||||
{{end}}
|
||||
|
||||
<h3>Limits</h3>
|
||||
<h3>{{ call .Translate `Limits` }}</h3>
|
||||
{{if ne .TitleMaxLen 0}}
|
||||
{{if gt .TitleMaxLen 0}}
|
||||
<p>Maximum length of the paste title: <code>{{.TitleMaxLen}}</code> symbols.<br/>
|
||||
<p>{{ call .Translate `Maximum length of the paste title:` }} <code>{{.TitleMaxLen}}</code> {{ call .Translate `symbols` }}.<br/>
|
||||
{{else}}
|
||||
<p>There is no limit to the size of the paste body.</br>
|
||||
<p>{{ call .Translate `There is no limit to the size of the paste title.` }}</br>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<p>Paste titles are disabled on this server.<br/>
|
||||
<p>{{ call .Translate `Paste titles are disabled on this server.` }}<br/>
|
||||
{{end}}
|
||||
{{if gt .BodyMaxLen 0}}
|
||||
Maximum length of the paste body: <code>{{.BodyMaxLen}}</code> symbols.</p>
|
||||
{{ call .Translate `Maximum length of the paste body:` }} <code>{{.BodyMaxLen}}</code> {{ call .Translate `symbols`}}.</p>
|
||||
{{else}}
|
||||
There is no limit to the size of the paste body.</p>
|
||||
{{ call .Translate `There is no limit to the size of the paste body.` }}</p>
|
||||
{{end}}
|
||||
|
||||
{{if or (ne .AdminName ``) (ne .AdminMail ``)}}
|
||||
<h3>Contact the administrator</h3>
|
||||
{{if ne .AdminName ``}}<p>Name: <code>{{.AdminName}}</code></p>{{end}}
|
||||
{{if ne .AdminMail ``}}<p>Email: <a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a></p>{{end}}
|
||||
<h3>{{ call .Translate `Contact the administrator` }}</h3>
|
||||
{{if ne .AdminName ``}}<p>{{ call .Translate `Name:` }} <code>{{.AdminName}}</code></p>{{end}}
|
||||
{{if ne .AdminMail ``}}<p>{{ call .Translate `Email:` }} <a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a></p>{{end}}
|
||||
{{end}}
|
||||
|
||||
<h3>What is Lenpaste?</h3>
|
||||
<p>This server uses Lenpaste version <code>{{.Version}}</code>. A little bit about it:</p>
|
||||
<h3>{{ call .Translate `What is Lenpaste?` }}</h3>
|
||||
<p>{{ call .Translate `This server uses Lenpaste version` }} <code>{{.Version}}</code>. {{ call .Translate `A little bit about it:` }}</p>
|
||||
<ul>
|
||||
<li>Lenpaste is open source software. All <a href="/about/source_code">source code</a> is available under the <a href="/about/license">AGPL 3</a> license.</li>
|
||||
<li>You don't need to register here.</li>
|
||||
<li>This site does not use cookies. Your privacy is respected here.</li>
|
||||
<li>Can work without JavaScript.</li>
|
||||
<li>Lenpaste has its own <a href="/docs/apiv1">API</a>.</li>
|
||||
<li>{{ call .Translate `Lenpaste is open source software. All` }} <a href="/about/source_code">{{ call .Translate `source code` }}</a> {{ call .Translate `is available under the` }} <a href="/about/license">AGPL 3</a> {{ call .Translate `license.` }}</li>
|
||||
<li>{{ call .Translate `You don't need to register here.` }}</li>
|
||||
<li>{{ call .Translate `This site does not use cookies to keep track of you.` }}</li>
|
||||
<li>{{ call .Translate `Can work without JavaScript.` }}</li>
|
||||
<li>{{ call .Translate `Lenpaste has its own` }} <a href="/docs/apiv1">API</a>.</li>
|
||||
</ul>
|
||||
{{end}}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{template "titlePrefix" .}}Lenpaste</title>
|
||||
<title>{{template "titlePrefix" .}}{{ call .Translate `Lenpaste` }}</title>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css"/>
|
||||
<link rel="shortcut icon" href="data:," />
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1">
|
||||
|
@ -10,7 +10,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h2><a href="/">Lenpaste</a></h2><h4><a href="/about">About</a></h4><h4><a href="/docs">Docs</a></h4>
|
||||
<h2><a href="/">{{ call .Translate `Lenpaste` }}</a></h2><h4><a href="/about">{{ call .Translate `About` }}</a></h4><h4><a href="/docs">{{ call .Translate `Docs` }}</a></h4>
|
||||
</header>
|
||||
<article>{{template "article" .}}</article>
|
||||
</body>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{{define "titlePrefix"}}Docs | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `Docs` }} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3>Documentation</h3>
|
||||
<h3>{{ call .Translate `Documentation` }}</h3>
|
||||
<ul>
|
||||
<li><a href="/docs/apiv1">API v1</li>
|
||||
<li><a href="/docs/api_libs">Libraries for working with API</li>
|
||||
<li><a href="/docs/api_libs">{{ call .Translate `Libraries for working with API` }}</li>
|
||||
</ul>
|
||||
{{end}}
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
{{define "titlePrefix"}}Libraries for working with API | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `Libraries for working with API` }} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3><a href="/docs">Documentation</a> / Libraries for working with API</h3>
|
||||
<h4 id="recommended">Recommended</h4>
|
||||
<h3><a href="/docs">{{ call .Translate `Documentation` }}</a> / {{ call .Translate `Libraries for working with API` }}</h3>
|
||||
<h4 id="recommended">{{ call .Translate `Recommended` }}</h4>
|
||||
<table>
|
||||
<th>Name</th>
|
||||
<th>Language</th>
|
||||
<th>API version</th>
|
||||
<th>Status</th>
|
||||
<th>License</th>
|
||||
<th>{{ call .Translate `Name` }}</th>
|
||||
<th>{{ call .Translate `Language` }}</th>
|
||||
<th>{{ call .Translate `API version` }}</th>
|
||||
<th>{{ call .Translate `Status` }}</th>
|
||||
<th>{{ call .Translate `License` }}</th>
|
||||
<tr>
|
||||
<td><a href="https://git.lcomrade.su/root/pasteapi.go" target="_blank">PasteAPI.go</a></td>
|
||||
<td>Go</td>
|
||||
<td>v1.0</td>
|
||||
<td>Official</td>
|
||||
<td>{{ call .Translate `Official`}}</td>
|
||||
<td>MIT</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4 id="out_of_date">Out of date</h4>
|
||||
<p>Updates for these libraries are no longer available. This means that they cannot be used with Lenpaste v1.0 and higher.</p>
|
||||
<h4 id="out_of_date">{{ call .Translate `Out of date` }}</h4>
|
||||
<p>{{ call .Translate `Updates for these libraries are no longer available. This means that they cannot be used with Lenpaste v1.0 and higher.` }}</p>
|
||||
<table>
|
||||
<th>Name</th>
|
||||
<th>Language</th>
|
||||
<th>API version</th>
|
||||
<th>Status</th>
|
||||
<th>License</th>
|
||||
<th>{{ call .Translate `Name` }}</th>
|
||||
<th>{{ call .Translate `Language` }}</th>
|
||||
<th>{{ call .Translate `API version` }}</th>
|
||||
<th>{{ call .Translate `Status` }}</th>
|
||||
<th>{{ call .Translate `License` }}</th>
|
||||
<tr>
|
||||
<td><a href="https://git.lcomrade.su/root/lenin" target="_blank">Lenin</a></td>
|
||||
<td>Go</td>
|
||||
<td>v0.2</td>
|
||||
<td>Official</td>
|
||||
<td>GPL 3.0 or later</td>
|
||||
<td>{{ call .Translate `Official` }}</td>
|
||||
<td>{{ call .Translate `GPL 3.0 or later` }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/rjdbcm/pylenin" target="_blank">PyLenin</a></td>
|
||||
<td>Python</td>
|
||||
<td>v0.1</td>
|
||||
<td>Unofficial</td>
|
||||
<td>GPL 3.0 or later</td>
|
||||
<td>{{ call .Translate `Unofficial` }}</td>
|
||||
<td>{{ call .Translate `GPL 3.0 or later` }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{end}}
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
<p>Response example:</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"id": "XcmX9ON1"
|
||||
}` `json`}}
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
<p>Response example:</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"id": "XcmX9ON1",
|
||||
"title": "Paste title.",
|
||||
"body": "Line 1.\nLine 2.\nLine 3.\n\nLine 5.",
|
||||
|
@ -100,7 +100,7 @@
|
|||
"oneUse": false,
|
||||
"syntax": "plaintext"
|
||||
}` `json`}}
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"id": "5mqqHZRg",
|
||||
"title": "",
|
||||
"body": "",
|
||||
|
@ -113,7 +113,7 @@
|
|||
|
||||
<h4 id="getServerInfo">GET <code>/api/v1/getServerInfo</code></h4>
|
||||
<p>Response example:</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"version": "0.2-60-g3fcc9ce",
|
||||
"titleMaxlength": 100,
|
||||
"bodyMaxlength": 10000,
|
||||
|
@ -143,31 +143,31 @@
|
|||
|
||||
<h4 id="errors">Possible API Errors</h4>
|
||||
<p>This API method exists on the server, but you passed the wrong arguments for it.</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"code": 400,
|
||||
"error": "Bad Request"
|
||||
}` `json`}}
|
||||
|
||||
<p>There is no paste with this ID.</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"code": 404,
|
||||
"error": "Could not find ID"
|
||||
}` `json`}}
|
||||
|
||||
<p>There is no such API method.</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"code": 404,
|
||||
"error": "Not Found"
|
||||
}` `json`}}
|
||||
|
||||
<p>You made a mistake with HTTP request (example: you made POST instead of GET).</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"code": 405,
|
||||
"error": "Method Not Allowed"
|
||||
}` `json`}}
|
||||
|
||||
<p>There was a failure on the server. Contact your server administrator to find out what the problem is.</p>
|
||||
{{ call . `{
|
||||
{{ call .Highlight `{
|
||||
"code": 500,
|
||||
"error": "Internal Server Error"
|
||||
}` `json`}}
|
||||
|
|
|
@ -33,9 +33,13 @@
|
|||
<div>{{if .Title}}<a href="/{{.ID}}" target="_blank">{{.Title}}</a>{{end}}</div>
|
||||
<div class="header-right"><a href="/{{.ID}}" target="_blank">{{.CreateTimeStr}}</a></div>
|
||||
</header>
|
||||
{{if or (.OneUse) (ne .DeleteTime 0) (.ErrorNotFound)}}
|
||||
{{if or (.ErrorNotFound) (.OneUse) (ne .DeleteTime 0)}}
|
||||
<article>
|
||||
<pre><code style="margin-left: 0.4em;"><span style="color: #F92672;">Error:</span> Could not embedded this paste.</code></pre>
|
||||
{{if .ErrorNotFound}}
|
||||
<pre><code style="margin-left: 0.4em;"><span style="color: #F92672;">{{ call .Translate `Error` }}:</span> 404 {{ call .Translate `Not Found` }}</code></pre>
|
||||
{{else}}
|
||||
<pre><code style="margin-left: 0.4em;"><span style="color: #F92672;">{{ call .Translate `Error` }}:</span> {{ call .Translate `Could not embedded this paste` }}</code></pre>
|
||||
{{end}}
|
||||
</article>
|
||||
{{else}}
|
||||
<article>{{.Body}}</article>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{{define "titlePrefix"}}Embedded {{.ID}} | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `Embedded` }} {{.ID}} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3><a href="/{{.ID}}">{{.ID}}</a> / Embedded</h3>
|
||||
<h3><a href="/{{.ID}}">{{.ID}}</a> / {{ call .Translate `Embedded` }}</h3>
|
||||
{{if or (.OneUse) (ne .DeleteTime 0)}}
|
||||
<p>You cannot embedded the paste if it is "burned" after reading or has an expiration date.</p>
|
||||
<p>{{ call .Translate `You cannot embedded the paste if it is "burned" after reading or has an expiration date.` }}`</p>
|
||||
{{else}}
|
||||
<p>Add the following code to your page:</p>
|
||||
<p>{{ call .Translate `Add the following code to your page:` }}</p>
|
||||
<pre><code><iframe src="{{.Protocol}}://{{.Host}}/emb/{{.ID}}" width="100%" height="100%" frameborder="0"></iframe></code></pre>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{{define "titlePrefix"}}{{.Error}} | {{end}}
|
||||
{{define "titlePrefix"}}{{.Code}} {{ call .Translate .Error }} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3>Error {{.Code}}</h3>
|
||||
<p>{{.Error}}</p>
|
||||
<h3>{{ call .Translate `Error` }} {{.Code}}</h3>
|
||||
<p>{{ call .Translate .Error }}</p>
|
||||
|
||||
{{if and (ne .AdminName ``) (ne .AdminMail ``)}}
|
||||
<p>Administrator contacts: <code>{{.AdminName}} <<a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a>></code></p>
|
||||
<p>{{ call .Translate `Administrator contacts:` }} <code>{{.AdminName}} <<a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a>></code></p>
|
||||
{{else}}
|
||||
{{if ne .AdminName ``}}<p>Administrator contacts: <code>{{.AdminName}}</code></p>{{end}}
|
||||
{{if ne .AdminMail ``}}<p>Administrator contacts: <code><a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a></code></p>{{end}}
|
||||
{{if ne .AdminName ``}}<p>{{ call .Translate `Administrator contacts:` }} <code>{{.AdminName}}</code></p>{{end}}
|
||||
{{if ne .AdminMail ``}}<p>{{ call .Translate `Administrator contacts:` }} <code><a href="mailto:{{.AdminMail}}">{{.AdminMail}}</a></code></p>{{end}}
|
||||
{{end}}
|
||||
|
||||
<p><a href="/"><< Back to home page</a></p>
|
||||
<p><a href="/"><< {{ call .Translate `Back to home page` }}</a></p>
|
||||
{{end}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{define "titlePrefix"}}License | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `License`}} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3><a href="/about">About</a> / License</h3>
|
||||
<h3><a href="/about">{{ call .Translate `About` }}</a> / {{ call .Translate `License` }}</h3>
|
||||
|
||||
<h3 style="text-align: center;">GNU AFFERO GENERAL PUBLIC LICENSE</h3>
|
||||
<p style="text-align: center;">Version 3, 19 November 2007</p>
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
{
|
||||
"translate": {
|
||||
"Lenpaste": "ЛенОтрывок",
|
||||
"About": "О сайте",
|
||||
"Docs": "Документация",
|
||||
|
||||
"Error": "Ошибка",
|
||||
"Bad Request": "Неверный запрос",
|
||||
"Not Found": "Не найдено",
|
||||
"Internal Server Error": "Внутренняя ошибка сервера",
|
||||
"Administrator contacts:": "Связаться с администратором:",
|
||||
"Back to home page": "Вернуться на главную",
|
||||
|
||||
"Create paste": "Новый отрывок",
|
||||
"Enter title...": "Введите название...",
|
||||
"Enter text...": "Введите текст...",
|
||||
|
@ -7,6 +18,81 @@
|
|||
"Expiration:": "Срок хранения:",
|
||||
"Burn after reading": "Удалить после прочтения",
|
||||
"*Maximum": "*Максимум",
|
||||
"symbols": "символов"
|
||||
"symbols": "символов",
|
||||
"Create": "Создать",
|
||||
"Never": "Неограничен",
|
||||
"10 minutes": "10 минут",
|
||||
"30 minutes": "30 минут",
|
||||
"1 hour": "1 час",
|
||||
"2 hour": "2 часа",
|
||||
"4 hour": "4 часа",
|
||||
"12 hour": "12 часов",
|
||||
"1 day": "1 день",
|
||||
"1 week": "1 неделя",
|
||||
"2 weeks": "2 недели",
|
||||
"1 month": "1 месяц",
|
||||
"2 months": "2 месяца",
|
||||
"6 months": "6 месяцев",
|
||||
"1 year": "1 год",
|
||||
|
||||
"Raw": "Исходник",
|
||||
"Download": "Скачать",
|
||||
"Embedded": "Встроить",
|
||||
"Created:": "Дата создания:",
|
||||
"Expires:": "Конец срока хранения:",
|
||||
"Now": "Сейчас",
|
||||
" Never": " Никогда",
|
||||
|
||||
"Continue?": "Продолжить?",
|
||||
"This paste can only be viewed once. After you do this, it will be deleted. Continue?": "Этот отрывок можно просмотреть только один раз после чего он будет удалён. Продолжить?",
|
||||
"Cancel": "Отмена",
|
||||
"Continue": "Продолжить",
|
||||
|
||||
"You cannot embedded the paste if it is \"burned\" after reading or has an expiration date.": "Вы не можете встроить отрывок в другую страницу, если он предназначен для одноразового прочтения или имеет ограниченный срок хранения.",
|
||||
"Add the following code to your page:": "Добавьте следующий код на вашу страницу:",
|
||||
|
||||
"Could not embedded this paste": "Этот отрывок нельзя встроить в другие страницы",
|
||||
|
||||
"About this server": "Об этом сервер",
|
||||
"This server rules": "Правила этого сервера",
|
||||
"Limits": "Лимиты",
|
||||
"Maximum length of the paste title:": "Максимальная длина заголовка:",
|
||||
"There is no limit to the size of the paste title.": "Длина заголовка не ограничена.",
|
||||
"Paste titles are disabled on this server.": "На этом сервере нельзя задать заголовок для отрывка.",
|
||||
"Maximum length of the paste body:": "Максимальная длина отрывка:",
|
||||
"There is no limit to the size of the paste body.": "Длина отрывка неограниченна.",
|
||||
"Contact the administrator": "Связаться с администратором",
|
||||
"Name:": "Имя:",
|
||||
"Email:": "Почта:",
|
||||
"What is Lenpaste?": "Что такое ЛенОтрывок?",
|
||||
"This server uses Lenpaste version": "На этом сервере использует ЛенОтрывок версии",
|
||||
"A little bit about it:": "Немного о нём:",
|
||||
"Lenpaste is open source software. All": "ЛенОтрывок - это свободное ПО. Весь его",
|
||||
"source code": "исходный код",
|
||||
"is available under the": "доступен под лицензией",
|
||||
"license.": ".",
|
||||
"You don't need to register here.": "Вам не нужно регистрироваться здесь.",
|
||||
"This site does not use cookies to keep track of you.": "Этот сайт не использует Cookie что бы следить за вами.",
|
||||
"Can work without JavaScript.": "Этот сайт может работать без JavaScript.",
|
||||
"Lenpaste has its own": "У ЛенОтрывка есть свой собственный",
|
||||
|
||||
"Source code": "Исходный код",
|
||||
"Sorry, it is not yet possible to download the source code directly from the Lenpaste server. But you can download it at this link:": "К сожалению, пока нет возможности скачать исходный код непосредственно с этого сервера. Но вы можете загрузить его по ссылке:",
|
||||
|
||||
"License": "Лицензия",
|
||||
|
||||
"Documentation": "Документация",
|
||||
|
||||
"Libraries for working with API": "Библиотеки для работа с API",
|
||||
"Recommended": "Рекомендованые",
|
||||
"Name": "Название",
|
||||
"Language": "Язык програмирования",
|
||||
"API version": "Версия API",
|
||||
"Status": "Статус",
|
||||
"Official": "Офицальный",
|
||||
"Unofficial": "Не офицальный",
|
||||
"GPL 3.0 or later": "GPL 3.0 или старше",
|
||||
"Out of date": "Больше не обновляются",
|
||||
"Updates for these libraries are no longer available. This means that they cannot be used with Lenpaste v1.0 and higher.": "Эти библиотеки больше не обновляются. Это означает, что они не могут использовать ЛенОтрывок API v1.0 и выше."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,22 +47,22 @@
|
|||
<div>
|
||||
<label for="expiration">{{ call .Translate `Expiration:` }}</label
|
||||
><select name="expiration" tabindex=6 size=1>
|
||||
{{if lt .MaxLifeTime 0 }}<option value="0">Never</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 600) (lt .MaxLifeTime 0)}}<option value="600">10 minutes</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 1800) (lt .MaxLifeTime 0)}}<option value="1800">30 minutes</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 3600) (lt .MaxLifeTime 0)}}<option value="3600">1 hour</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 7200) (lt .MaxLifeTime 0)}}<option value="7200">2 hour</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 14400) (lt .MaxLifeTime 0)}}<option value="14400">4 hour</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 43200) (lt .MaxLifeTime 0)}}<option value="43200">12 hour</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 86400) (lt .MaxLifeTime 0)}}<option value="86400">1 day</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 604800) (lt .MaxLifeTime 0)}}<option value="604800">1 week</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 1209600) (lt .MaxLifeTime 0)}}<option value="1209600">2 weeks</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 2629800) (lt .MaxLifeTime 0)}}<option value="2629800">1 Month</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 5259600) (lt .MaxLifeTime 0)}}<option value="5259600">2 Months</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 15778800) (lt .MaxLifeTime 0)}}<option value="15778800">6 Months</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 31557600) (lt .MaxLifeTime 0)}}<option value="31557600">1 Year</option>{{end}}
|
||||
{{if lt .MaxLifeTime 0 }}<option value="0">{{ call .Translate `Never` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 600) (lt .MaxLifeTime 0)}}<option value="600">{{ call .Translate `10 minutes` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 1800) (lt .MaxLifeTime 0)}}<option value="1800">{{ call .Translate `30 minutes` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 3600) (lt .MaxLifeTime 0)}}<option value="3600">{{ call .Translate `1 hour` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 7200) (lt .MaxLifeTime 0)}}<option value="7200">{{ call .Translate `2 hour` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 14400) (lt .MaxLifeTime 0)}}<option value="14400">{{ call .Translate `4 hour` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 43200) (lt .MaxLifeTime 0)}}<option value="43200">{{ call .Translate `12 hour` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 86400) (lt .MaxLifeTime 0)}}<option value="86400">{{ call .Translate `1 day` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 604800) (lt .MaxLifeTime 0)}}<option value="604800">{{ call .Translate `1 week` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 1209600) (lt .MaxLifeTime 0)}}<option value="1209600">{{ call .Translate `2 weeks` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 2629800) (lt .MaxLifeTime 0)}}<option value="2629800">{{ call .Translate `1 month` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 5259600) (lt .MaxLifeTime 0)}}<option value="5259600">{{ call .Translate `2 months` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 15778800) (lt .MaxLifeTime 0)}}<option value="15778800">{{ call .Translate `6 months` }}</option>{{end}}
|
||||
{{if or (ge .MaxLifeTime 31557600) (lt .MaxLifeTime 0)}}<option value="31557600">{{ call .Translate `1 year` }}</option>{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div><button class="button-green" type="submit" tabindex=7>{{ call .Translate `Create paste` }}</button></div>
|
||||
<div><button class="button-green" type="submit" tabindex=7>{{ call .Translate `Create` }}</button></div>
|
||||
</form>
|
||||
{{end}}
|
||||
|
|
|
@ -9,21 +9,21 @@
|
|||
|
||||
{{if not .OneUse}}
|
||||
<div class="text-bar-right">
|
||||
<a href="/raw/{{.ID}}" tabindex=2>Raw</a><a href="/dl/{{.ID}}" tabindex=3>Download</a><a{{if ne .DeleteTime 0}} class="text-grey"{{end}} href="/emb_help/{{.ID}}" tabindex=4>Embedded</a>
|
||||
<a href="/raw/{{.ID}}" tabindex=2>{{ call .Translate `Raw` }}</a><a href="/dl/{{.ID}}" tabindex=3>{{ call .Translate `Download` }}</a><a{{if ne .DeleteTime 0}} class="text-grey"{{end}} href="/emb_help/{{.ID}}" tabindex=4>{{ call .Translate `Embedded`}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{.Body}}
|
||||
|
||||
<p>Created: <span id="createTime">{{.CreateTimeStr}}</span></p>
|
||||
<p>{{ call .Translate `Created:` }} <span id="createTime">{{.CreateTimeStr}}</span></p>
|
||||
|
||||
{{if .OneUse}}
|
||||
<p>Expires: <span class="text-red">Now</span></p>
|
||||
<p>{{ call .Translate `Expires:` }} <span class="text-red">{{ call .Translate `Now` }}</span></p>
|
||||
{{else if eq .DeleteTime 0}}
|
||||
<p>Expires: Never</p>
|
||||
<p>{{ call .Translate `Expires:` }}{{ call .Translate ` Never` }}</p>
|
||||
{{else}}
|
||||
<p>Expires: <span id="deleteTime">{{.DeleteTimeStr}}</span></p>
|
||||
<p>{{ call .Translate `Expires:` }} <span id="deleteTime">{{.DeleteTimeStr}}</span></p>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{{define "titlePrefix"}}{{.ID}} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3>Continue?</h3>
|
||||
<p>This paste can only be viewed once. After you do this, it will be deleted. Continue?</p>
|
||||
<h3>{{ call .Translate `Continue?` }}</h3>
|
||||
<p>{{ call .Translate `This paste can only be viewed once. After you do this, it will be deleted. Continue?` }}</p>
|
||||
<div class="button-block-right">
|
||||
<form action="/" method="get">
|
||||
<button type="submit" tabindex=1>Cancel</button>
|
||||
<button type="submit" tabindex=1>{{ call .Translate `Cancel` }}</button>
|
||||
</form>
|
||||
<form action="/{{.ID}}" method="post">
|
||||
<input type="hidden" name="oneUseContinue" value="true"></input>
|
||||
<button class="button-green" type="submit" tabindex=2>Continue</button>
|
||||
<button class="button-green" type="submit" tabindex=2>{{ call .Translate `Continue` }}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{{define "titlePrefix"}}Source code | {{end}}
|
||||
{{define "titlePrefix"}}{{ call .Translate `Source code` }} | {{end}}
|
||||
{{define "headAppend"}}{{end}}
|
||||
{{define "article"}}
|
||||
<h3><a href="/about">About</a> / Source code</h3>
|
||||
<p>Sorry, it is not yet possible to download the source code directly from the Lenpaste server.
|
||||
But you can download it at this link:
|
||||
<h3><a href="/about">{{ call .Translate `About` }}</a> / {{ call .Translate `Source code` }}</h3>
|
||||
<p>{{ call .Translate `Sorry, it is not yet possible to download the source code directly from the Lenpaste server. But you can download it at this link:` }}
|
||||
<br/>
|
||||
<a href="https://git.lcomrade.su/root/lenpaste" target="_blank">https://git.lcomrade.su/root/lenpaste</a></p>
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in New Issue