summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-12-09 02:18:25 -0500
committerUnknwon <joe2010xtmf@163.com>2014-12-09 02:18:25 -0500
commit9a1fe801e526ae1bc0a211d8a218aabcf985376d (patch)
treee40f92f1b34f81c60ffef084761b7d6cd4336aa2 /modules
parent6f71632e3ef6c0c818b3224e501fa66583108806 (diff)
downloadgitea-9a1fe801e526ae1bc0a211d8a218aabcf985376d.tar.gz
gitea-9a1fe801e526ae1bc0a211d8a218aabcf985376d.zip
fix #711
Diffstat (limited to 'modules')
-rw-r--r--modules/base/markdown.go4
-rw-r--r--modules/base/template.go11
2 files changed, 10 insertions, 5 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index c85bd02069..b2f94c480b 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -154,7 +154,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string) []byte {
rawBytes = bytes.Replace(rawBytes, m, []byte(fmt.Sprintf(
` <a href="%s">#%s</a>`, m, ShortSha(string(m[i+7:j])))), -1)
}
- rawBytes = RenderissueIndexPattern(rawBytes, urlPrefix)
+ rawBytes = RenderIssueIndexPattern(rawBytes, urlPrefix)
rawBytes = RenderSha1CurrentPattern(rawBytes, urlPrefix)
return rawBytes
}
@@ -168,7 +168,7 @@ func RenderSha1CurrentPattern(rawBytes []byte, urlPrefix string) []byte {
return rawBytes
}
-func RenderissueIndexPattern(rawBytes []byte, urlPrefix string) []byte {
+func RenderIssueIndexPattern(rawBytes []byte, urlPrefix string) []byte {
ms := issueIndexPattern.FindAll(rawBytes, -1)
for _, m := range ms {
rawBytes = bytes.Replace(rawBytes, m, []byte(fmt.Sprintf(
diff --git a/modules/base/template.go b/modules/base/template.go
index 446d01dd09..462269aa4e 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -47,18 +47,23 @@ func ShortSha(sha1 string) string {
return sha1
}
-func ToUtf8WithErr(content []byte) (error, string) {
+func DetectEncoding(content []byte) (string, error) {
detector := chardet.NewTextDetector()
result, err := detector.DetectBest(content)
+ return result.Charset, err
+}
+
+func ToUtf8WithErr(content []byte) (error, string) {
+ charset, err := DetectEncoding(content)
if err != nil {
return err, ""
}
- if result.Charset == "utf8" {
+ if charset == "utf8" {
return nil, string(content)
}
- decoder := mahonia.NewDecoder(result.Charset)
+ decoder := mahonia.NewDecoder(charset)
if decoder != nil {
return nil, decoder.ConvertString(string(content))
}
ackport/40394/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/files_external/l10n/et_EE.php
blob: 0589d9fd518c2bbbea6b0db79b97b48671e48bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
$TRANSLATIONS = array(
"Access granted" => "Ligipääs on antud",
"Error configuring Dropbox storage" => "Viga Dropboxi salvestusruumi seadistamisel",
"Grant access" => "Anna ligipääs",
"Please provide a valid Dropbox app key and secret." => "Palun sisesta korrektne Dropboxi rakenduse võti ja salasõna.",
"Error configuring Google Drive storage" => "Viga Google Drive'i salvestusruumi seadistamisel",
"Saved" => "Salvestatud",
"External Storage" => "Väline salvestuskoht",
"Folder name" => "Kausta nimi",
"External storage" => "Väline andmehoidla",
"Configuration" => "Seadistamine",
"Options" => "Valikud",
"Available for" => "Saadaval",
"Add storage" => "Lisa andmehoidla",
"No user or group" => "Ühtki kasutajat või gruppi",
"All Users" => "Kõik kasutajad",
"Groups" => "Grupid",
"Users" => "Kasutajad",
"Delete" => "Kustuta",
"Enable User External Storage" => "Luba kasutajatele väline salvestamine",
"Allow users to mount the following external storage" => "Võimalda kasutajatel ühendada järgmist välist andmehoidlat",
"SSL root certificates" => "SSL root sertifikaadid",
"Import Root Certificate" => "Impordi root sertifikaadid"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";