Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix conflicts

Cette révision appartient à :
ElegantMonkey 2017-05-14 21:19:29 -03:00
révision df2c9bc2f7
37 fichiers modifiés avec 1337 ajouts et 226 suppressions

Voir le fichier

@ -33,13 +33,12 @@ type Config struct {
I2P *I2PConfig `json:"i2p"`
// filesize fetcher config
MetainfoFetcher MetainfoFetcherConfig `json:"metainfo_fetcher"`
// internationalization config
// internationalization config
I18n I18nConfig `json:"i18n"`
}
var Defaults = Config{"localhost", 9999, "sqlite3", "./nyaa.db?cache_size=50", "default", DefaultScraperConfig, DefaultCacheConfig, DefaultSearchConfig, nil, DefaultMetainfoFetcherConfig, DefaultI18nConfig}
var allowedDatabaseTypes = map[string]bool{
"sqlite3": true,
"postgres": true,

Voir le fichier

@ -7,5 +7,5 @@ type I18nConfig struct {
var DefaultI18nConfig = I18nConfig{
TranslationsDirectory: "translations",
DefaultLanguage: "en-us", // TODO: Remove refs to "en-us" from the code and templates
DefaultLanguage: "en-us",
}

Voir le fichier

@ -15,6 +15,7 @@ import (
"github.com/ewhal/nyaa/router"
"github.com/ewhal/nyaa/service/scraper"
"github.com/ewhal/nyaa/service/torrent/metainfoFetcher"
"github.com/ewhal/nyaa/service/user"
"github.com/ewhal/nyaa/util/languages"
"github.com/ewhal/nyaa/util/log"
"github.com/ewhal/nyaa/util/search"
@ -124,7 +125,7 @@ func main() {
if err != nil {
log.Fatal(err.Error())
}
err = languages.InitI18n(conf.I18n)
err = languages.InitI18n(conf.I18n, userService.NewCurrentUserRetriever())
if err != nil {
log.Fatal(err.Error())
}

Voir le fichier

@ -136,6 +136,18 @@ tr.torrent-info td.date {
border-top: 1px solid #ddd;
}
th a:hover {
text-decoration: none;
}
.sortarrowleft {
letter-spacing: -0.6rem;
}
.sortarrowdim {
opacity: 0.25;
}
div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;}
div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:first-of-type, div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(5){width:10%;}
div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(3){width:15%;}
@ -448,28 +460,25 @@ select#bottom_language_selector {
}
.commentList .commentBody {
border: 1px solid #eee;
margin-bottom: 20px;
margin-left: 85px;
margin-right: 0px;
padding: 10px 20px;
position: relative;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
background: #fff;
color: #6b6e80;
position: relative;
border: 1px solid #c1c1c1;
margin-left: 85px;
margin-right: 0px;
padding: 8px 16px;
position: relative;
border-radius: 4px;
background: #fff;
color: #6b6e80;
}
.commentList .commentBody > .row > div {
word-break: break-word;
}
.commentList .commentData {
font-size: 13px;
color: #aaaaaa;
padding-bottom: 8px;
margin-bottom: 10px !important;
border-bottom: 1px solid #eee;
height: 2.5em;
height: 2.2em;
}
.commentList ul.comments ul{
@ -487,7 +496,6 @@ select#bottom_language_selector {
}
.comment {
margin: 1em;
padding: 1em;
width: 75%;
margin-left: 12%;

Voir le fichier

@ -15,7 +15,7 @@ type LanguagesJSONResponse struct {
}
func SeeLanguagesHandler(w http.ResponseWriter, r *http.Request) {
_, Tlang := languages.GetTfuncAndLanguageFromRequest(r, "en-us")
_, Tlang := languages.GetTfuncAndLanguageFromRequest(r)
availableLanguages := languages.GetAvailableLanguages()
format := r.URL.Query().Get("format")
@ -28,7 +28,7 @@ func SeeLanguagesHandler(w http.ResponseWriter, r *http.Request) {
}
} else {
clv := ChangeLanguageVariables{NewSearchForm(), Navigation{}, Tlang.Tag, availableLanguages, GetUser(r), r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(changeLanguageTemplate, r, "en-us")
languages.SetTranslationFromRequest(changeLanguageTemplate, r)
err := changeLanguageTemplate.ExecuteTemplate(w, "index.html", clv)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -8,7 +8,7 @@ import (
)
func FaqHandler(w http.ResponseWriter, r *http.Request) {
languages.SetTranslationFromRequest(faqTemplate, r, "en-us")
languages.SetTranslationFromRequest(faqTemplate, r)
err := faqTemplate.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -56,7 +56,7 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
navigationTorrents := Navigation{nbTorrents, maxPerPage, pagenum, "search_page"}
languages.SetTranslationFromRequest(homeTemplate, r, "en-us")
languages.SetTranslationFromRequest(homeTemplate, r)
htv := HomeTemplateVariables{b, NewSearchForm(), navigationTorrents, GetUser(r), r.URL, mux.CurrentRoute(r)}
err = homeTemplate.ExecuteTemplate(w, "index.html", htv)

Voir le fichier

@ -106,7 +106,6 @@ func NewPanelSearchForm() SearchForm {
return form
}
func IndexModPanel(w http.ResponseWriter, r *http.Request) {
currentUser := GetUser(r)
if userPermission.HasAdmin(currentUser) {
@ -117,7 +116,7 @@ func IndexModPanel(w http.ResponseWriter, r *http.Request) {
comments, _ := commentService.GetAllComments(offset, 0, "", "")
torrentReports, _, _ := reportService.GetAllTorrentReports(offset, 0)
languages.SetTranslationFromRequest(panelIndex, r, "en-us")
languages.SetTranslationFromRequest(panelIndex, r)
htv := PanelIndexVbs{torrents, model.TorrentReportsToJSON(torrentReports), users, comments, NewPanelSearchForm(), currentUser, r.URL}
err := panelIndex.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err)
@ -150,7 +149,7 @@ func TorrentsListPanel(w http.ResponseWriter, r *http.Request) {
ShowItemsPerPage: true,
}
languages.SetTranslationFromRequest(panelTorrentList, r, "en-us")
languages.SetTranslationFromRequest(panelTorrentList, r)
htv := PanelTorrentListVbs{torrents, searchForm, Navigation{int(searchParam.Max), offset, pagenum, "mod_tlist_page"}, currentUser, r.URL}
err = panelTorrentList.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err)
@ -180,7 +179,7 @@ func TorrentReportListPanel(w http.ResponseWriter, r *http.Request) {
torrentReports, nbReports, _ := reportService.GetAllTorrentReports(offset, (pagenum-1)*offset)
reportJSON := model.TorrentReportsToJSON(torrentReports)
languages.SetTranslationFromRequest(panelTorrentReportList, r, "en-us")
languages.SetTranslationFromRequest(panelTorrentReportList, r)
htv := PanelTorrentReportListVbs{reportJSON, NewSearchForm(), Navigation{nbReports, offset, pagenum, "mod_trlist_page"}, currentUser, r.URL}
err = panelTorrentReportList.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err)
@ -207,7 +206,7 @@ func UsersListPanel(w http.ResponseWriter, r *http.Request) {
offset := 100
users, nbUsers := userService.RetrieveUsersForAdmin(offset, (pagenum-1)*offset)
languages.SetTranslationFromRequest(panelUserList, r, "en-us")
languages.SetTranslationFromRequest(panelUserList, r)
htv := PanelUserListVbs{users, NewSearchForm(), Navigation{nbUsers, offset, pagenum, "mod_ulist_page"}, currentUser, r.URL}
err = panelUserList.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err)
@ -241,7 +240,7 @@ func CommentsListPanel(w http.ResponseWriter, r *http.Request) {
}
comments, nbComments := commentService.GetAllComments(offset, (pagenum-1)*offset, conditions, values...)
languages.SetTranslationFromRequest(panelCommentList, r, "en-us")
languages.SetTranslationFromRequest(panelCommentList, r)
htv := PanelCommentListVbs{comments, NewSearchForm(), Navigation{nbComments, offset, pagenum, "mod_clist_page"}, currentUser, r.URL}
err = panelCommentList.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err)
@ -256,7 +255,7 @@ func TorrentEditModPanel(w http.ResponseWriter, r *http.Request) {
if userPermission.HasAdmin(currentUser) {
id := r.URL.Query().Get("id")
torrent, _ := torrentService.GetTorrentById(id)
languages.SetTranslationFromRequest(panelTorrentEd, r, "en-us")
languages.SetTranslationFromRequest(panelTorrentEd, r)
torrentJson := torrent.ToJSON()
uploadForm := NewUploadForm()
@ -302,7 +301,7 @@ func TorrentPostEditModPanel(w http.ResponseWriter, r *http.Request) {
infos["infos"] = append(infos["infos"], "Torrent details updated.")
}
}
languages.SetTranslationFromRequest(panelTorrentEd, r, "en-us")
languages.SetTranslationFromRequest(panelTorrentEd, r)
htv := PanelTorrentEdVbs{uploadForm, NewPanelSearchForm(), currentUser, err, infos, r.URL}
err_ := panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv)
log.CheckError(err_)
@ -364,7 +363,7 @@ func TorrentReassignModPanel(w http.ResponseWriter, r *http.Request) {
http.Error(w, "admins only", http.StatusForbidden)
return
}
languages.SetTranslationFromRequest(panelTorrentReassign, r, "en-us")
languages.SetTranslationFromRequest(panelTorrentReassign, r)
htv := PanelTorrentReassignVbs{ReassignForm{}, NewPanelSearchForm(), currentUser, form.NewErrors(), form.NewInfos(), r.URL}
err := panelTorrentReassign.ExecuteTemplate(w, "admin_index.html", htv)

Voir le fichier

@ -10,7 +10,7 @@ import (
func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
languages.SetTranslationFromRequest(notFoundTemplate, r)
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -44,7 +44,7 @@ func SearchHandler(w http.ResponseWriter, r *http.Request) {
}
htv := HomeTemplateVariables{b, searchForm, navigationTorrents, GetUser(r), r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(searchTemplate, r, "en-us")
languages.SetTranslationFromRequest(searchTemplate, r)
err = searchTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -1,13 +1,15 @@
package router
import (
"github.com/ewhal/nyaa/service/user/permission"
"github.com/nicksnyder/go-i18n/i18n"
"html/template"
"log"
"math"
"net/url"
"strconv"
"github.com/ewhal/nyaa/service/user/permission"
"github.com/ewhal/nyaa/util/languages"
"github.com/nicksnyder/go-i18n/i18n"
)
var FuncMap = template.FuncMap{
@ -55,6 +57,25 @@ var FuncMap = template.FuncMap{
return template.URL(url.String())
},
"genSortArrows": func(currentUrl url.URL, sortBy string) template.HTML {
values := currentUrl.Query()
leftclass := "sortarrowdim"
rightclass := "sortarrowdim"
if _, ok := values["order"]; ok {
if values["sort"][0] == sortBy {
if values["order"][0] == "true" {
rightclass = ""
} else {
leftclass = ""
}
}
}
arrows := "<span class=\"sortarrowleft "+leftclass+"\">▼</span><span class=\""+rightclass+"\">▲</span>"
return template.HTML(arrows)
},
"genNav": func(nav Navigation, currentUrl *url.URL, pagesSelectable int) template.HTML {
var ret = ""
if nav.TotalItem > 0 {
@ -92,6 +113,7 @@ var FuncMap = template.FuncMap{
},
"T": i18n.IdentityTfunc,
"Ts": i18n.IdentityTfunc,
"getDefaultLanguage": languages.GetDefaultLanguage,
"getAvatar": func(hash string, size int) string {
return "https://www.gravatar.com/avatar/" + hash + "?s=" + strconv.Itoa(size)
},

Voir le fichier

@ -92,7 +92,7 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
htv := UploadTemplateVariables{uploadForm, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(uploadTemplate, r, "en-us")
languages.SetTranslationFromRequest(uploadTemplate, r)
err := uploadTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -22,7 +22,7 @@ func UserRegisterFormHandler(w http.ResponseWriter, r *http.Request) {
b := form.RegistrationForm{}
modelHelper.BindValueForm(&b, r)
b.CaptchaID = captcha.GetID()
languages.SetTranslationFromRequest(viewRegisterTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewRegisterTemplate, r)
htv := UserRegisterTemplateVariables{b, form.NewErrors(), NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
err := viewRegisterTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
@ -38,7 +38,7 @@ func UserLoginFormHandler(w http.ResponseWriter, r *http.Request) {
b := form.LoginForm{}
modelHelper.BindValueForm(&b, r)
languages.SetTranslationFromRequest(viewLoginTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewLoginTemplate, r)
htv := UserLoginFormVariables{b, form.NewErrors(), NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
err := viewLoginTemplate.ExecuteTemplate(w, "index.html", htv)
@ -65,14 +65,14 @@ func UserProfileHandler(w http.ResponseWriter, r *http.Request) {
if errUser != nil {
err["errors"] = append(err["errors"], errUser.Error())
}
languages.SetTranslationFromRequest(viewUserDeleteTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewUserDeleteTemplate, r)
htv := UserVerifyTemplateVariables{err, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
errorTmpl := viewUserDeleteTemplate.ExecuteTemplate(w, "index.html", htv)
if errorTmpl != nil {
http.Error(w, errorTmpl.Error(), http.StatusInternalServerError)
}
} else {
T := languages.SetTranslationFromRequest(viewProfileTemplate, r, "en-us")
T := languages.SetTranslationFromRequest(viewProfileTemplate, r)
if follow != nil {
infosForm["infos"] = append(infosForm["infos"], fmt.Sprintf(T("user_followed_msg"), userProfile.Username))
}
@ -87,7 +87,7 @@ func UserProfileHandler(w http.ResponseWriter, r *http.Request) {
}
}
} else {
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
languages.SetTranslationFromRequest(notFoundTemplate, r)
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
@ -105,7 +105,7 @@ func UserDetailsHandler(w http.ResponseWriter, r *http.Request) {
if userPermission.CurrentOrAdmin(currentUser, userProfile.ID) {
b := form.UserForm{}
modelHelper.BindValueForm(&b, r)
languages.SetTranslationFromRequest(viewProfileEditTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewProfileEditTemplate, r)
availableLanguages := languages.GetAvailableLanguages()
htv := UserProfileEditVariables{&userProfile, b, form.NewErrors(), form.NewInfos(), availableLanguages, NewSearchForm(), Navigation{}, currentUser, r.URL, mux.CurrentRoute(r)}
err := viewProfileEditTemplate.ExecuteTemplate(w, "index.html", htv)
@ -114,12 +114,12 @@ func UserDetailsHandler(w http.ResponseWriter, r *http.Request) {
}
}
} else {
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
languages.SetTranslationFromRequest(notFoundTemplate, r)
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
}
}
// Getting View User Profile Update
@ -133,7 +133,7 @@ func UserProfileFormHandler(w http.ResponseWriter, r *http.Request) {
b := form.UserForm{}
err := form.NewErrors()
infos := form.NewInfos()
T := languages.SetTranslationFromRequest(viewProfileEditTemplate, r, "en-us")
T := languages.SetTranslationFromRequest(viewProfileEditTemplate, r)
if len(r.PostFormValue("email")) > 0 {
_, err = form.EmailValidation(r.PostFormValue("email"), err)
}
@ -173,14 +173,14 @@ func UserProfileFormHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, errorTmpl.Error(), http.StatusInternalServerError)
}
} else {
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
languages.SetTranslationFromRequest(notFoundTemplate, r)
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
} else {
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
languages.SetTranslationFromRequest(notFoundTemplate, r)
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, NewSearchForm(), GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
@ -209,7 +209,7 @@ func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
err["errors"] = append(err["errors"], errorUser.Error())
}
if len(err) == 0 {
languages.SetTranslationFromRequest(viewRegisterSuccessTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewRegisterSuccessTemplate, r)
u := model.User{
Email: r.PostFormValue("email"), // indicate whether user had email set
}
@ -224,7 +224,7 @@ func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
}
if len(err) > 0 {
b.CaptchaID = captcha.GetID()
languages.SetTranslationFromRequest(viewRegisterTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewRegisterTemplate, r)
htv := UserRegisterTemplateVariables{b, err, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
errorTmpl := viewRegisterTemplate.ExecuteTemplate(w, "index.html", htv)
if errorTmpl != nil {
@ -241,7 +241,7 @@ func UserVerifyEmailHandler(w http.ResponseWriter, r *http.Request) {
if errEmail != nil {
err["errors"] = append(err["errors"], errEmail.Error())
}
languages.SetTranslationFromRequest(viewVerifySuccessTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewVerifySuccessTemplate, r)
htv := UserVerifyTemplateVariables{err, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
errorTmpl := viewVerifySuccessTemplate.ExecuteTemplate(w, "index.html", htv)
if errorTmpl != nil {
@ -259,7 +259,7 @@ func UserLoginPostHandler(w http.ResponseWriter, r *http.Request) {
_, errorUser := userService.CreateUserAuthentication(w, r)
if errorUser != nil {
err["errors"] = append(err["errors"], errorUser.Error())
languages.SetTranslationFromRequest(viewLoginTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewLoginTemplate, r)
htv := UserLoginFormVariables{b, err, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
errorTmpl := viewLoginTemplate.ExecuteTemplate(w, "index.html", htv)
if errorTmpl != nil {

Voir le fichier

@ -34,7 +34,7 @@ func ViewHandler(w http.ResponseWriter, r *http.Request) {
}
htv := ViewTemplateVariables{b, captchaID, NewSearchForm(), Navigation{}, user, r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(viewTemplate, r, "en-us")
languages.SetTranslationFromRequest(viewTemplate, r)
err = viewTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
log.Errorf("ViewHandler(): %s", err)

Voir le fichier

@ -112,10 +112,6 @@ func getTorrentsOrderBy(parameters *serviceBase.WhereParams, orderBy string, lim
) {
var conditionArray []string
conditionArray = append(conditionArray, "deleted_at IS NULL")
if strings.HasPrefix(orderBy, "filesize") {
// torrents w/ NULL filesize fuck up the sorting on Postgres
conditionArray = append(conditionArray, "filesize IS NOT NULL")
}
var params []interface{}
if parameters != nil { // if there is where parameters
if len(parameters.Conditions) > 0 {

Voir le fichier

@ -17,6 +17,17 @@ import (
"golang.org/x/crypto/bcrypt"
)
func NewCurrentUserRetriever() *CurrentUserRetriever {
return &CurrentUserRetriever{}
}
type CurrentUserRetriever struct{}
func (*CurrentUserRetriever) RetrieveCurrentUser(r *http.Request) (model.User, error) {
user, _, err := RetrieveCurrentUser(r)
return user, err
}
// SuggestUsername suggest user's name if user's name already occupied.
func SuggestUsername(username string) string {
var count int
@ -104,7 +115,7 @@ func CreateUser(w http.ResponseWriter, r *http.Request) (int, error) {
if err != nil {
return http.StatusInternalServerError, err
}
if (registrationForm.Email != "") {
if registrationForm.Email != "" {
SendVerificationToUser(user, registrationForm.Email)
}
status, err = RegisterHandler(w, r)
@ -185,7 +196,7 @@ func UpdateUser(w http.ResponseWriter, form *formStruct.UserForm, currentUser *m
form.Status = user.Status
form.Username = user.Username
}
if (form.Email != user.Email) {
if form.Email != user.Email {
// send verification to new email and keep old
SendVerificationToUser(user, form.Email)
form.Email = user.Email
@ -202,7 +213,7 @@ func DeleteUser(w http.ResponseWriter, currentUser *model.User, id string) (int,
if db.ORM.First(&user, id).RecordNotFound() {
return http.StatusNotFound, errors.New("user not found")
}
if (user.ID == 0) {
if user.ID == 0 {
return http.StatusInternalServerError, errors.New("You can't delete that!")
}
if db.ORM.Delete(&user).Error != nil {

Voir le fichier

@ -11,16 +11,16 @@ import (
"github.com/ewhal/nyaa/db"
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/util/email"
"github.com/ewhal/nyaa/util/languages"
"github.com/ewhal/nyaa/util/timeHelper"
"github.com/gorilla/securecookie"
"github.com/nicksnyder/go-i18n/i18n"
)
var verificationHandler = securecookie.New(config.EmailTokenHashKey, nil)
// SendEmailVerfication sends an email verification token via email.
func SendEmailVerification(to string, token string, locale string) error {
T, err := i18n.Tfunc(locale)
func SendEmailVerification(to string, token string) error {
T, err := languages.GetDefaultTfunc()
if err != nil {
return err
}
@ -41,7 +41,7 @@ func SendVerificationToUser(user model.User, newEmail string) (int, error) {
if err != nil {
return http.StatusInternalServerError, err
}
err = SendEmailVerification(newEmail, encoded, "en-us")
err = SendEmailVerification(newEmail, encoded)
if err != nil {
return http.StatusInternalServerError, err
}

Voir le fichier

@ -42,15 +42,16 @@
<h2 id="trackers">{{T "which_trackers_do_you_recommend"}}</h2>
<p>{{T "answer_which_trackers_do_you_recommend"}}</p>
<pre>udp://tracker.doko.moe:6969</pre>
<pre>udp://tracker.doko.moe:6969</pre>
<p>{{T "other_trackers"}}</p>
<pre>udp://zer0day.to:1337/announce
udp://tracker.leechers-paradise.org:6969
udp://explodie.org:6969
udp://tracker.opentrackr.org:1337
udp://tracker.internetwarriors.net:1337/announce
http://mgtracker.org:6969/announce
http://tracker.baka-sub.cf/announce</pre>
<pre>
udp://zer0day.to:1337/announce
udp://tracker.leechers-paradise.org:6969
udp://explodie.org:6969
udp://tracker.opentrackr.org:1337
udp://tracker.internetwarriors.net:1337/announce
http://mgtracker.org:6969/announce
http://tracker.baka-sub.cf/announce</pre>
<h2>{{T "how_can_i_help"}}</h2>
<p>{{T "answer_how_can_i_help"}}</p>

Voir le fichier

@ -2,7 +2,7 @@
{{/* unset if user doesn't need captcha */}}
{{if ne .CaptchaID ""}}
<div class="form-group captcha-container">
<label for="solution">Captcha</label>
<label for="solution">{{T "captcha"}}</label>
<input type="text" name="captchaID" value="{{.CaptchaID}}" hidden>
<img src="/captcha/{{.CaptchaID}}.png">
<input type="text" name="solution" id="solution" class="form-control" placeholder="Captcha" autocomplete="off" required>

Voir le fichier

@ -29,7 +29,7 @@
<select id="language" name="language" class="form-control">
{{ $userLanguage := .Language }}
{{ range $tag, $translatedName := $.Languages }}
<option value="{{ $tag }}" {{ if or (eq $userLanguage $tag) (and (eq $userLanguage "") (eq $tag "en-us")) }}selected{{end}}>{{ $translatedName }} {{if eq $tag "en-us"}}({{ T "default" }}){{end}}</option>
<option value="{{ $tag }}" {{ if or (eq $userLanguage $tag) (and (eq $userLanguage "") (eq $tag getDefaultLanguage)) }}selected{{end}}>{{ $translatedName }} {{if eq $tag getDefaultLanguage}}({{ T "default" }}){{end}}</option>
{{ end }}
</select>
</div>
@ -102,7 +102,7 @@
<div class="col-md-8">
<input type="submit" class="btn btn-primary" name="save" value="{{ T "save_changes"}}">
<span></span>
<input type="reset" class="btn btn-default" value="Cancel">
<input type="reset" class="btn btn-default" value="{{ T "cancel"}}">
</div>
</div>
</form>

Voir le fichier

@ -3,6 +3,7 @@
<table class="table">
<tr>
<th class="col-xs-10">Content</th>
<th class="col-xs-1">Torrent</th>
<th class="col-xs-1">User</th>
<th class="col-xs-1">Action</th>
</tr>
@ -10,8 +11,10 @@
{{ range .Comments}}
<tr>
<td><a href="{{ genRoute "mod_cedit" }}?id={{.ID}}">{{ .Content }}</a></td>
<td><a>{{ .UserID }}</a></td>
<!-- TODO: add href="{{ genRoute "mod_cedit" }}?id={{.ID}}" for comment editing -->
<td><a>{{ .Content }}</a></td>
<td><a href="{{ genViewTorrentRoute .TorrentID }}">{{ .TorrentID }}</a></td>
<td>{{ .UserID }}</td>
<td><a href="{{ genRoute "mod_cdelete" }}?id={{.ID}}" class="btn btn-danger btn-lg" onclick="if (!confirm('Are you sure?')) return false;"><i class="glyphicon glyphicon-trash"></i> {{ T "delete" }}</a></td></tr>
{{end}}
</table>

Voir le fichier

@ -10,7 +10,7 @@
{{end}}
<div class="form-group">
<label for="name">{{T "name"}}</label>
<input type="text" name="name" class="form-control" placeholder="File Name" value="{{.Name}}" required>
<input type="text" name="name" class="form-control" placeholder="{{T "file_name"}}" value="{{.Name}}" required>
</div>
<div class="form-group">
<label for="c">{{T "category"}}</label>

Voir le fichier

@ -11,13 +11,13 @@
{{with .Reassign}}
<div class="form-group">
<label for="name">Reassign to:</label>
<label for="to">Reassign to:</label>
<input type="text" name="to" class="form-control" placeholder="User ID" {{if ne .AssignTo 0}}value="{{.AssignTo}}"{{end}} required>
</div>
<div class="form-group">
<label for="by">Reassign based on:</label><br />
<input type="radio" name="by" value="olduser" {{if eq .By "olduser"}}selected{{end}} required> Old Username<br />
<input type="radio" name="by" value="torrentid" {{if eq .By "torrentid"}}selected{{end}} required> Torrent ID
<input type="radio" name="by" value="olduser" {{if eq .By "olduser"}}checked{{end}} required> Old Username<br />
<input type="radio" name="by" value="torrentid" {{if eq .By "torrentid"}}checked{{end}} required> Torrent ID
</div>
<div class="form-group">

Voir le fichier

@ -13,16 +13,14 @@
<table class="table custom-table-hover">
<tr>
<th class="col-xs-1 hidden-xs">{{T "category"}}</th>
<th class="col-xs-8">
<a href="{{ genSearchWithOrdering .URL "1" }}">{{T "name"}}</a>
<th class="col-xs-12">
<a href="{{ genSearchWithOrdering .URL "1" }}">{{T "name"}}{{ genSortArrows .URL "1" }}</a>
</th>
<th class="col-xs-1 hidden-xs">
<a href="{{ genSearchWithOrdering .URL "5" }}">{{T "S"}}</a> /
<a href="{{ genSearchWithOrdering .URL "6" }}">{{T "L"}}</a> /
<a href="{{ genSearchWithOrdering .URL "7" }}">{{T "D"}}</a>
</th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "2" }}">{{T "date"}}</th></a>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "4" }}">{{T "size"}}</a></th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "5" }}">{{T "S"}}{{ genSortArrows .URL "5" }}</a></th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "6" }}">{{T "L"}}{{ genSortArrows .URL "6" }}</a></th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "7" }}">{{T "D"}}{{ genSortArrows .URL "7" }}</a></th>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "2" }}">{{T "date"}}{{ genSortArrows .URL "2" }}</th></a>
<th class="col-xs-1 hidden-xs"><a href="{{ genSearchWithOrdering .URL "4" }}">{{T "size"}}{{ genSortArrows .URL "4" }}</a></th>
<th class="col-xs-1 hidden-xs">{{T "links"}}</th>
</tr>
{{ range .ListTorrents}}
@ -41,7 +39,9 @@
{{.Name}}
</a>
</td>
<td class="hidden-xs"><b class="text-success">{{.Seeders}}</b> / <b class="text-danger">{{.Leechers}}</b> / {{.Completed}}</td>
<td class="hidden-xs"><b class="text-success">{{.Seeders}}</b></td>
<td class="hidden-xs"><b class="text-danger">{{.Leechers}}</b></td>
<td class="hidden-xs">{{.Completed}}</td>
<td class="hidden-xs date date-short">{{.Date}}</td>
<td class="hidden-xs filesize">{{.Filesize}}</td>
<td class="hidden-xs">

Voir le fichier

@ -7,7 +7,7 @@
<div class="form-group">
<label for="name">{{T "name"}}</label>
<input type="text" name="name" id="name" class="form-control" placeholder="File Name" value="{{.Name}}" autofocus required>
<input type="text" name="name" id="name" class="form-control" placeholder="{{T "file_name"}}" value="{{.Name}}" autofocus required>
</div>
<div class="form-group">
<label for="torrent">{{T "torrent_file"}}</label>

Voir le fichier

@ -7,7 +7,7 @@
<div class="content" style="margin-bottom: 2em;">
<div class="row">
<div class="col-md-12">
<h3 class="break" {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"{{end}}>{{.Name}}</h3>
<h3 class="break {{if eq .Status 2}}remake{{end}} {{if eq .Status 3}}trusted{{end}} {{if eq .Status 4}}aplus{{end}}">{{.Name}}</h3>
</div>
</div>
<div class="row">
@ -20,6 +20,7 @@
<h4>{{ T "uploaded_by" }} <a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a></h4>
</div>
</div>
<div style="float:right;">
<a style="margin: 5px;" aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-lg btn-success">
@ -31,7 +32,7 @@
</a>
{{end}}
<a style="margin: 5px;" aria-label="Report button" data-toggle="modal" data-target="#reportModal" class="btn btn-danger btn-sm">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {{ T "report" }}
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {{ T "report_btn" }}
</a>
{{ if HasAdmin $.User}}
@ -163,7 +164,7 @@
<textarea name="comment" class="form-control" rows="5"></textarea>
</div>
{{block "captcha" .}}{{end}}
<button type="submit" class="btn btn-success">{{T " submit "}}</button>
<button type="submit" class="btn btn-success">{{T "submit" }}</button>
</form>
</div>
</div>

Voir le fichier

@ -5,11 +5,11 @@
},
{
"id": "verify_email_title",
"translation": "NyaaPantsu E-Mail Bestätigung."
"translation": "Bestätigung der E-Mail-Adresse für NyaaPantsu."
},
{
"id": "verify_email_content",
"translation": "Klicke auf den Link um deine E-Mail zu verifizieren."
"translation": "Klicke auf den Link, um deine E-Mail-Adresse zu verifizieren."
},
{
"id": "reset_password_title",
@ -17,7 +17,7 @@
},
{
"id": "reset_password_content",
"translation": "Klicke auf den Link um dein Passwort zurückzusetzen."
"translation": "Klicke auf den Link, um dein Passwort zurückzusetzen."
},
{
"id":"register_title",
@ -53,7 +53,7 @@
},
{
"id":"terms_conditions_confirm",
"translation": "Mit klick auf <strong class=\"label label-primary\">Registrieren</strong> stimmst du den <a href=\"#\" data-toggle=\"modal\" data-target=\"#t_and_c_m\">Nutzungsbedingungen</a> sowie der Nutzung von Cookies zu."
"translation": "Durch Klicken auf <strong class=\"label label-primary\">Registrieren</strong> stimmst du den <a href=\"#\" data-toggle=\"modal\" data-target=\"#t_and_c_m\">Nutzungsbedingungen</a> sowie der Nutzung von Cookies zu."
},
{
"id":"signin",
@ -101,11 +101,11 @@
},
{
"id":"signup_verification_email",
"translation": "Geschafft! Überprüfe deinen Posteingang, auch den Spam Ordner(!) auf eine Bestätigungsmail."
"translation": "Derzeit ist die Verfizierung der E-Mail-Adresse deaktiviert, also kannst du deinen Account direkt nutzen. In Zukunft, überprüfe bitte deinen Posteingang (auch deinen Spam-Ordner!) auf eine Bestätigungsmail."
},
{
"id":"signup_verification_noemail",
"translation": "Die Registrierung war erfolgreich, du kannst deinen Account jetzt benutzen."
"translation": "Die Registrierung war erfolgreich. Du kannst deinen Account jetzt benutzen."
},
{
"id":"settings",
@ -193,11 +193,11 @@
},
{
"id": "404_not_found",
"translation": "404 nichts gefunden"
"translation": "404 Nicht Gefunden"
},
{
"id": "no_torrents_uploaded",
"translation": "Es sind noch keine Torrents hochgeladen worden!"
"translation": "Es wurden noch keine Torrents hochgeladen!"
},
{
"id": "profile",
@ -253,7 +253,7 @@
},
{
"id": "recovery_effort",
"translation": "Zur Zeit wird versucht die Seite zu ersetzen."
"translation": "Zur Zeit wird versucht, die Seite zu ersetzen."
},
{
"id": "is_everything_lost",
@ -289,7 +289,7 @@
},
{
"id": "answer_are_the_trackers_working",
"translation": "Auch went die Tracker offline sind, sind die Seeder immernoch mit dem dezentralisierten DHT Netzwerk verbunden. Solange das DHT Netzwerk die Torrentdaten hat, sollte es wie gewohnt weitergehen."
"translation": "Auch wenn die Tracker offline sind, sind die Seeder weiterhin mit dem dezentralisierten DHT-Netzwerk verbunden. Solange die Metadaten des Torrents im DHT-Netzwerk verfügbar sind, sollte der Download weiterhin funktionieren."
},
{
"id": "how_do_i_download_the_torrents",
@ -297,11 +297,11 @@
},
{
"id": "answer_how_do_i_download_the_torrents",
"translation": "Benutze einfach <b>Magnet Links</b>. Deine BitTorrent Software liest den Magnet Link und durchsucht das DHT Netzwerk nach den Metadaten und der Download sollte ohne weiteres funktionieren."
"translation": "Benutze einfach <b>Magnet-Links</b>. Dein BitTorrent-Client liest den Magnet-Link ein und durchsucht das DHT-Netzwerk nach den zugehörigen Metadaten. Der Download sollte ohne weiteres funktionieren."
},
{
"id": "magnet_link_should_look_like",
"translation": "Ein Magnet Link sollte so aussehen:"
"translation": "Ein Magnet-Link sollte so aussehen:"
},
{
"id": "which_trackers_do_you_recommend",
@ -309,11 +309,11 @@
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "Wir haben jetzt unseren eigenen Tracker! Füge ihn vorm Hochladen deinen Torrents hinzu:"
"translation": "Wir haben jetzt unseren eigenen Tracker! Füge ihn vor dem Hochladen deines Torrents hinzu:"
},
{
"id": "other_trackers",
"translation": "Allerdings solltest du diese auch hinzufügen, nur für den Fall, dass etwas schief läuft"
"translation": "Allerdings solltest du diese auch hinzufügen. Nur für den Fall, dass etwas schief läuft:"
},
{
"id": "how_can_i_help",
@ -321,7 +321,7 @@
},
{
"id": "answer_how_can_i_help",
"translation": "Wenn du Erfahrungen mit Webseitenprogrammierung hast, kannst du dem IRC-Kanal #nyaapantsu auf irc.rizon.net (Englisch) beitreten. Wenn du irgendwelche Datenbanken hast, insbesondere für Sukebei, lad sie hoch."
"translation": "Wenn du Erfahrungen mit Webseitenprogrammierung hast, kannst du dem IRC-Kanal #nyaapantsu auf irc.rizon.net (Englisch) beitreten. Falls du irgendwelche Datenbanken hast, insbesondere für Sukebei, dann stelle uns diese bitte zur Verfügung."
},
{
"id": "your_design_sucks_found_a_bug",
@ -341,15 +341,15 @@
},
{
"id": "torrent_file",
"translation": "Torrent Datei"
"translation": "Torrent-Datei"
},
{
"id": "uploading_file_prefills_fields",
"translation": "Beim hochladen einer Torrentdatei werden einige Felder automatisch ausgefüllt (wird bevorzugt)."
"translation": "Beim Hochladen einer Torrentdatei werden einige Felder automatisch ausgefüllt (empfohlen)."
},
{
"id": "magnet_link",
"translation": "Magnet Link"
"translation": "Magnet-Link"
},
{
"id": "all_categories",
@ -509,7 +509,7 @@
},
{
"id": "submit_a_comment_as_anonymous",
"translation": "anonymen Kommentar verfassen"
"translation": "Anonymen Kommentar verfassen"
},
{
"id": "submit",
@ -561,7 +561,7 @@
},
{
"id": "delete_account_confirm",
"translation": "Bist du sicher das du dein Profil löschen möchtest?"
"translation": "Bist du sicher, dass du dein Profil löschen möchtest?"
},
{
"id": "delete_success",
@ -570,6 +570,14 @@
{
"id": "moderation",
"translation": "Moderation"
},
{
"id": "who_is_renchon",
"translation": "Wer zum Teufel ist れんちょん?"
},
{
"id": "renchon_anon_explanation",
"translation": "Der Benutzername れんちょん (Ren-chon) wird Uploads und Kommentaren zugewiesen, die anonym hochgeladen beziehungsweise verfasst wurden. Außerdem ist er bei Torrents zu finden, die von nyaa importiert wurden, wobei gegebenenfalls auch der Benutzername des originalen Uploaders daneben angezeigt wird."
},
{
"id": "mark_as_remake",
@ -577,7 +585,7 @@
},
{
"id": "email_changed",
"translation": "E-Mail erfolgreich geändert! Bitte bestätige die Änderung mit dem Bestätigungs-Link (an %s gesendet)"
"translation": "E-Mail-Adresse erfolgreich geändert! Bitte bestätige die Änderung mit dem Bestätigungs-Link, der an %s gesendet wurde."
},
{
"id": "torrent_status",
@ -609,7 +617,7 @@
},
{
"id": "completed",
"translation": "Komplett"
"translation": "Abgeschlossen"
},
{
"id": "change_language",
@ -622,5 +630,57 @@
{
"id": "delete",
"translation": "Löschen"
},
{
"id": "uploaded_by",
"translation": "Hochgeladen von"
},
{
"id": "download_btn",
"translation": "Download!"
},
{
"id": "report_btn",
"translation": "Melden"
},
{
"id": "are_you_sure",
"translation": "Bist du sicher?"
},
{
"id": "report_torrent_number",
"translation": "Torrent #%s melden"
},
{
"id": "report_type",
"translation": "Grund"
},
{
"id": "illegal_content",
"translation": "Illegaler Inhalt"
},
{
"id": "spam_garbage",
"translation": "Spam / Müll"
},
{
"id": "wrong_category",
"translation": "Falsche Kategorie"
},
{
"id": "duplicate_deprecated",
"translation": "Duplikat / Veraltet"
},
{
"id": "captcha",
"translation": "Captcha"
},
{
"id": "file_name",
"translation": "Dateiname"
},
{
"id": "cancel",
"translation": "Abbrechen"
}
]

Voir le fichier

@ -556,7 +556,7 @@
"translation": "Moderator"
},
{
"id":" api_token",
"id": "api_token",
"translation": "API Token"
},
{
@ -664,8 +664,8 @@
"translation": "Download!"
},
{
"id": "report",
"translation": "Report!"
"id": "report_btn",
"translation": "Report"
},
{
"id": "are_you_sure",
@ -673,7 +673,7 @@
},
{
"id": "report_torrent_number",
"translation": "Report Torrent #"
"translation": "Report Torrent #%s"
},
{
"id": "report_type",
@ -694,5 +694,17 @@
{
"id": "duplicate_deprecated",
"translation": "Duplicate / Deprecated"
},
{
"id": "captcha",
"translation": "Captcha"
},
{
"id": "file_name",
"translation": "File Name"
},
{
"id": "cancel",
"translation": "Cancel"
}
]

Voir le fichier

@ -20,127 +20,127 @@
"translation": "Veuillez cliquer sur le lien ci-dessous pour réinitialiser votre mot de passe."
},
{
"id":"register_title",
"id": "register_title",
"translation": "Créer un nouveau compte"
},
{
"id":"signup_box_title",
"id": "signup_box_title",
"translation": "Inscrivez-vous <small>C'est gratuit et ça le restera.</small>"
},
{
"id":"username",
"id": "username",
"translation": "Nom d'utilisateur"
},
{
"id":"email_address_or_username",
"id": "email_address_or_username",
"translation": "Adresse email ou nom d'utilisateur"
},
{
"id":"email_address",
"id": "email_address",
"translation": "Adresse email"
},
{
"id":"password",
"id": "password",
"translation": "Mot de passe"
},
{
"id":"confirm_password",
"id": "confirm_password",
"translation": "Confirmer le mot de passe"
},
{
"id":"i_agree",
"id": "i_agree",
"translation": "J'accepte"
},
{
"id":"terms_conditions_confirm",
"id": "terms_conditions_confirm",
"translation": "En cliquant sur <strong class=\"label label-primary\">S'enregistrer</strong>, vous acceptez les <a href=\"#\" data-toggle=\"modal\" data-target=\"#t_and_c_m\">Termes et Conditions</a> et l'usage des cookies établis par le site."
},
{
"id":"signin",
"id": "signin",
"translation": "Se connecter"
},
{
"id":"register",
"id": "register",
"translation": "S'enregistrer"
},
{
"id":"terms_conditions",
"id": "terms_conditions",
"translation": "Termes et Conditions"
},
{
"id":"terms_conditions_full",
"id": "terms_conditions_full",
"translation": "À définir"
},
{
"id":"remember_me",
"id": "remember_me",
"translation": "Se souvenir de moi"
},
{
"id":"forgot_password",
"id": "forgot_password",
"translation": "Mot de passe oublié ?"
},
{
"id":"sign_in_box_title",
"id": "sign_in_box_title",
"translation": "Veuillez vous connecter"
},
{
"id":"sign_in_title",
"id": "sign_in_title",
"translation": "Se connecter"
},
{
"id":"register_success_title",
"id": "register_success_title",
"translation": "Inscription réussie"
},
{
"id":"sign_up_success",
"id": "sign_up_success",
"translation": "Merci pour votre inscription !"
},
{
"id":"verify_success",
"id": "verify_success",
"translation": "<i style=\"color:limegreen\" class=\"glyphicon glyphicon-ok-circle\"></i>Votre compte est à présent activé !"
},
{
"id":"signup_verification_email",
"id": "signup_verification_email",
"translation": "Veuillez vérifier votre boîte mail (et spam !) pour le mail de vérification."
},
{
"id":"signup_verification_noemail",
"id": "signup_verification_noemail",
"translation": "L'inscription est réussie, vous pouvez dès à présent utiliser votre compte."
},
{
"id":"settings",
"id": "settings",
"translation": "Paramètres du compte"
},
{
"id":"torrents",
"id": "torrents",
"translation": "Torrents"
},
{
"id":"follow",
"id": "follow",
"translation": "S'abonner"
},
{
"id":"unfollow",
"id": "unfollow",
"translation": "Se désabonner"
},
{
"id":"user_followed_msg",
"id": "user_followed_msg",
"translation": "Vous vous êtes abonné à %s!"
},
{
"id":"user_unfollowed_msg",
"id": "user_unfollowed_msg",
"translation": "Vous vous êtes désabonné de %s!"
},
{
"id":"profile_page",
"id": "profile_page",
"translation": "%s Profil"
},
{
"id":"see_more_torrents_from",
"id": "see_more_torrents_from",
"translation": "Voir plus de torrents de %s "
},
{
"id":"category",
"id": "category",
"translation": "Catégorie"
},
{
@ -283,6 +283,14 @@
"id": "answer_how_are_we_recovering",
"translation": "Les bases de données mentionnées sont hébergées sur nyaa.pantsu.cat et sukebei.pantsu.cat. Une fonction de recherche est disponible et (presque) toutes les fonctionnalités de Nyaa devraient arriver. Les statistiques seeders/leechers peuvent être obtenues par 'scraping' et pourraient être restaurées à l'avenir, toutefois d'autres fonctionnalités prennent la priorité en ce moment."
},
{
"id": "how_do_i_link_my_old_account",
"translation": "Comment puis-je lier mes anciens uploads à mon nouveau compte ?"
},
{
"id": "answer_how_do_i_link_my_old_account",
"translation": "Rejoignez le canal IRC <a href=\"ircs://irc.rizon.net/nyaapantsu-help\">#nyaapantsu-help@Rizon</a> et demandez à un modérateur de migrer vos anciens torrents and indiquant votre ancien et nouveau noms d'utilisateur."
},
{
"id": "are_the_trackers_working",
"translation": "Les torrents fonctionnent-ils toujours ?"
@ -309,7 +317,11 @@
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "Si le chargement d'un torrent est refusé à cause des trackers, vous aurez besoin d'ajouter certains d'entre eux :"
"translation": "Nous avons maintenant notre propre tracker, ajoutez-le en haut de la liste avant d'uploader :"
},
{
"id": "other_trackers",
"translation": "Mais vous devriez également ajouter ceux-ci, dans le cas où cela ne fonctionnerait pas :"
},
{
"id": "how_can_i_help",
@ -543,6 +555,10 @@
"id": "moderator",
"translation": "Modérateur"
},
{
"id": "api_token",
"translation": "Authentifieur d'API"
},
{
"id": "save_changes",
"translation": "Sauvegarder les changements"
@ -573,7 +589,7 @@
},
{
"id": "renchon_anon_explanation",
"translation": "れんちょん (Renchon) est le nom d'utilisateur par défaut assigné aux téléversements et commentaires anonymes ainsi que la mascotte du site. Il est utilisé pour les torrents importés du Nyaa original, bien que l'auteur d'origine puisse également être affiché."
"translation": "れんちょん (Renchon) est le nom d'utilisateur par défaut assigné aux uploads et commentaires anonymes ainsi que la mascotte du site. Il est utilisé pour les torrents importés du Nyaa original, bien que l'auteur d'origine puisse parfois être affiché."
},
{
"id": "mark_as_remake",
@ -604,7 +620,7 @@
"translation": "Éditer le profil de %s"
},
{
"id":"date_format",
"id": "date_format",
"translation": "2006-01-02 15:04"
},
{
@ -626,5 +642,61 @@
{
"id": "language_name",
"translation": "Français"
},
{
"id": "delete",
"translation": "Supprimer"
},
{
"id": "uploaded_by",
"translation": "Uploadé par"
},
{
"id": "download_btn",
"translation": "Télécharger"
},
{
"id": "report",
"translation": "Signaler"
},
{
"id": "are_you_sure",
"translation": "Êtes-vous sûr ?"
},
{
"id": "report_torrent_number",
"translation": "Signaler le torrent #"
},
{
"id": "report_type",
"translation": "Motif de signalement"
},
{
"id": "illegal_content",
"translation": "Contenu illégal"
},
{
"id": "spam_garbage",
"translation": "Spam / Indésirable"
},
{
"id": "wrong_category",
"translation": "Mauvaise catégorie"
},
{
"id": "duplicate_deprecated",
"translation": "Doublon / Obsolète"
},
{
"id": "captcha",
"translation": "Captcha"
},
{
"id": "file_name",
"translation": "Nom du fichier"
},
{
"id": "cancel",
"translation": "Annuler"
}
]

Voir le fichier

@ -101,7 +101,7 @@
},
{
"id":"signup_verification_email",
"translation": "Per concludere controlla la tua casella email (e la cartella spam!) per l'email di verifica."
"translation": "La verifica via email non è abilitata al momento, quindi puoi già usare il tuo account. In futuro, per concludere dovrai controllare la tua casella email (e la cartella spam!) per l'email di verifica."
},
{
"id":"signup_verification_noemail",
@ -269,11 +269,11 @@
},
{
"id": "answer_is_nyaa_db_lost",
"translation": "Abbiamo un database dei torrent di nyaa fino al <s>5 Aprile</s> 1° Maggio. Questo vuol dire che quasi niente è andato perduto."
"translation": "Abbiamo un database dei torrent di nyaa fino al <s>5 Aprile</s> 1° Maggio. Questo vuol dire che quasi niente è andato perso."
},
{
"id": "answer_is_sukebei_db_lost",
"translation": "Anche sukebei è al sicuro, e quasi nulla è andato perso."
"translation": "Anche sukebei è al sicuro, e anche qui quasi nulla è andato perso."
},
{
"id": "how_are_we_recovering",
@ -283,6 +283,14 @@
"id": "answer_how_are_we_recovering",
"translation": "I database citati sono attualmente hostati su nyaa.pantsu.cat e sukebei.pantsu.cat. C'è una funzione di ricerca, e (quasi) tutte le altre dovrebbero arrivare presto. Le statistiche dei Seeder/leecher sono possibili attraverso scraping e potrebbero essere ripristinate in futuro, visto che altre funzionalità hanno la precedenza adesso."
},
{
"id": "how_do_i_link_my_old_account",
"translation": "Come trasferisco i miei vecchi upload sul mio nuovo account?"
},
{
"id": "answer_how_do_i_link_my_old_account",
"translation": "Collegati a <a href=\"ircs://irc.rizon.net/nyaapantsu-help\">#nyaapantsu-help@Rizon</a> e chiedi ad un moderatore di migrare i tuoi vecchi torrent, menzionando il tuo vecchio e nuovo nome utente."
},
{
"id": "are_the_trackers_working",
"translation": "I torrent funzionano ancora?"
@ -309,7 +317,11 @@
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "Se il caricamento del tuo torrent è negato a causa dei trackers, dovrai aggiungere alcuni di questi:"
"translation": "Ora abbiamo un tracker tutto nostro!, mettilo come primo nella lista prima di caricare un file:"
},
{
"id": "other_trackers",
"translation": "Ma dovresti aggiungere anche questi, nel caso qualcosa vada storto:"
},
{
"id": "how_can_i_help",
@ -317,7 +329,7 @@
},
{
"id": "answer_how_can_i_help",
"translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei,per favore caricali."
"translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei, per favore caricali."
},
{
"id": "your_design_sucks_found_a_bug",
@ -353,7 +365,7 @@
},
{
"id": "select_a_torrent_category",
"translation": "Seleziona una Categoria Torrent"
"translation": "Seleziona una Categoria"
},
{
"id": "anime",
@ -573,7 +585,7 @@
},
{
"id": "renchon_anon_explanation",
"translation": "れんちょん è il nome utente assegnato per uploads e commenti anonimi. È anche utilizzato per i torrent importati dal nyaa originale, anche se l'uploader originale può essere mostrato di fianco."
"translation": "れんちょん (Ren-chon) è il nome utente assegnato per uploads e commenti anonimi. È anche utilizzato anche per i torrent importati dal nyaa originale, anche se a volte l'uploader originale è mostrato di fianco."
},
{
"id": "mark_as_remake",
@ -581,7 +593,7 @@
},
{
"id": "email_changed",
"translation": "Email cambiata con successo! Dovrai, tuttavia, per confermare cliccare il link mandato a: %s"
"translation": "Email cambiata con successo! Tuttavia per confermare dovrai cliccare il link inviato a: %s"
},
{
"id": "torrent_status",
@ -626,5 +638,61 @@
{
"id": "language_name",
"translation": "Italiano"
},
{
"id": "delete",
"translation": "Rimuovi"
},
{
"id": "uploaded_by",
"translation": "Caricato da"
},
{
"id": "download_btn",
"translation": "Download!"
},
{
"id": "report_btn",
"translation": "Segnala"
},
{
"id": "are_you_sure",
"translation": "Sei sicuro?"
},
{
"id": "report_torrent_number",
"translation": "Segnala Torrent #%s"
},
{
"id": "report_type",
"translation": "Tipo di segnalazione"
},
{
"id": "illegal_content",
"translation": "Materiale Illegale"
},
{
"id": "spam_garbage",
"translation": "Spam / Spazzatura"
},
{
"id": "wrong_category",
"translation": "Categoria Errata"
},
{
"id": "duplicate_deprecated",
"translation": "Duplicato / Deprecato"
},
{
"id": "captcha",
"translation": "Captcha"
},
{
"id": "file_name",
"translation": "Filename"
},
{
"id": "cancel",
"translation": "Annulla"
}
]

Voir le fichier

@ -273,7 +273,7 @@
},
{
"id": "answer_is_sukebei_db_lost",
"translation": "Sukebei, no entanto, está em uma situação pior. Atualmente nós só temos os dados do sukebei até 2016, mas um novo banco de dados pode estar disponível para uso."
"translation": "Sukebei está em perfeito estado e quase nada foi perdido."
},
{
"id": "how_are_we_recovering",
@ -291,7 +291,7 @@
"id": "answer_how_do_i_link_my_old_account",
"translation": "Entre em <a href=\"ircs://irc.rizon.net/nyaapantsu-help\">#nyaapantsu-help@Rizon</a> e informe a moderação seu antigo e novo nome de usuário."
},
{
{
"id": "are_the_trackers_working",
"translation": "Os torrents ainda funcionam?"
},
@ -317,11 +317,7 @@
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "Agora nós possuímos nosso próprio Tracker, adicione-o ao topo da lista antes de enviar um torrent:"
},
{
"id": "other_trackers",
"translation": "Mas você também deve adicionar estes, para caso algo dê errado."
"translation": "Agora nós temos um tracker chamado doko.moe, adicione-o ao topo da lista antes de enviar um torrent. Você também deve adicionar todos estes outros trackers para garantir redundância."
},
{
"id": "how_can_i_help",
@ -551,6 +547,10 @@
"id": "moderator",
"translation": "Moderador"
},
{
"id": "api_token",
"translation": "API Token"
},
{
"id": "save_changes",
"translation": "Salvar alterações"
@ -587,10 +587,46 @@
"id": "mark_as_remake",
"translation": "Marcar como remake"
},
{
"id": "email_changed",
"translation": "E-mail alterado com sucesso! Porém, você deve confirmá-lo clicando no link enviado para: %s"
},
{
"id": "torrent_status",
"translation": "Status do torrent"
},
{
"id": "torrent_status_hidden",
"translation": "Oculto"
},
{
"id": "torrent_status_normal",
"translation": "Normal"
},
{
"id": "torrent_status_remake",
"translation": "Remake"
},
{
"id": "profile_edit_page",
"translation": "Editar o perfil de %s"
},
{
"id":"date_format",
"translation": "2006-01-02 15:04"
},
{
"id": "seeders",
"translation": "Seeders"
},
{
"id": "leechers",
"translation": "Leechers"
},
{
"id": "completed",
"translation": "Completos"
},
{
"id": "change_language",
"translation": "Mudar Idioma"
@ -598,5 +634,61 @@
{
"id": "language_name",
"translation": "Português (Brasil)"
},
{
"id": "delete",
"translation": "Excluir"
},
{
"id": "uploaded_by",
"translation": "Enviado por"
},
{
"id": "download_btn",
"translation": "Download!"
},
{
"id": "report_btn",
"translation": "Denunciar"
},
{
"id": "are_you_sure",
"translation": "Você tem certeza?"
},
{
"id": "report_torrent_number",
"translation": "Denunciar torrent #%s"
},
{
"id": "report_type",
"translation": "Motivo da denúncia"
},
{
"id": "illegal_content",
"translation": "Conteúdo não permitido"
},
{
"id": "spam_garbage",
"translation": "Spam / Lixo"
},
{
"id": "wrong_category",
"translation": "Categoria incorreta"
},
{
"id": "duplicate_deprecated",
"translation": "Duplicado / Obsoleto"
},
{
"id": "captcha",
"translation": "Captcha"
},
{
"id": "file_name",
"translation": "Nome do arquivo"
},
{
"id": "cancel",
"translation": "Cancelar"
}
]

602
translations/pt-pt.all.json Fichier normal
Voir le fichier

@ -0,0 +1,602 @@
[
{
"id": "link",
"translation": "link"
},
{
"id": "verify_email_title",
"translation": "Verifique o seu endereço de e-mail do Nyaapantsu."
},
{
"id": "verify_email_content",
"translation": "Clique no link abaixo para verificar o seu endereço de e-mail."
},
{
"id": "reset_password_title",
"translation": "Redefina a sua senha."
},
{
"id": "reset_password_content",
"translation": "Clique no link abaixo para redefinir a sua senha."
},
{
"id":"register_title",
"translation": "Criar conta"
},
{
"id":"signup_box_title",
"translation": "Por favor, registe-se <small>(é de graça e sempre será)</small>"
},
{
"id":"username",
"translation": "Nome de usuário"
},
{
"id":"email_address_or_username",
"translation": "Endereço de e-mail ou nome de usuário"
},
{
"id":"email_address",
"translation": "Endereço de e-mail"
},
{
"id":"password",
"translation": "Senha"
},
{
"id":"confirm_password",
"translation": "Confirmar senha"
},
{
"id":"i_agree",
"translation": "Eu aceito"
},
{
"id":"terms_conditions_confirm",
"translation": "Ao clicar em <strong class=\"label label-primary\">Registar</strong>, estará a concordar com os <a href=\"#\" data-toggle=\"modal\" data-target=\"#t_and_c_m\">Termos e Condições</a> estabelecidos pelo site, incluindo o nosso uso de cookies."
},
{
"id":"signin",
"translation": "Iniciar sessão"
},
{
"id":"register",
"translation": "Registar"
},
{
"id":"terms_conditions",
"translation": "Termos e Condições"
},
{
"id":"terms_conditions_full",
"translation": "Algumas coisas."
},
{
"id":"remember_me",
"translation": "Lembre-se de mim"
},
{
"id":"forgot_password",
"translation": "Esqueceu-se da sua senha?"
},
{
"id":"sign_in_box_title",
"translation": "Por favor, inicie a sessão"
},
{
"id":"sign_in_title",
"translation": "Iniciar sessão"
},
{
"id":"register_success_title",
"translation": "Registo bem-sucedido"
},
{
"id":"sign_up_success",
"translation": "Obrigado por se registar!"
},
{
"id":"verify_success",
"translation": "<i style=\"color:limegreen\" class=\"glyphicon glyphicon-ok-circle\"></i>A sua conta foi ativada!"
},
{
"id":"signup_verification_email",
"translation": "Por fim, procure o e-mail de verificação na sua caixa de entrada (e pasta de spam!)."
},
{
"id":"signup_verification_noemail",
"translation": "Registo bem-sucedido. Já pode usar a sua conta."
},
{
"id":"settings",
"translation": "Configurações de conta"
},
{
"id":"torrents",
"translation": "Torrents"
},
{
"id":"follow",
"translation": "Seguir"
},
{
"id":"unfollow",
"translation": "Deixar de seguir"
},
{
"id":"user_followed_msg",
"translation": "Seguiu %s!"
},
{
"id":"user_unfollowed_msg",
"translation": "Deixou de seguir %s!"
},
{
"id":"profile_page",
"translation": "Perfil de %s"
},
{
"id":"see_more_torrents_from",
"translation": "Ver mais torrents de %s "
},
{
"id":"category",
"translation": "Categoria"
},
{
"id": "name",
"translation": "Nome"
},
{
"id": "date",
"translation": "Data"
},
{
"id": "size",
"translation": "Tamanho"
},
{
"id": "links",
"translation": "Links"
},
{
"id": "home",
"translation": "Página inicial"
},
{
"id": "error_404",
"translation": "Erro 404"
},
{
"id": "toggle_navigation",
"translation": "Alternar navegação"
},
{
"id": "upload",
"translation": "Enviar"
},
{
"id": "faq",
"translation": "Perguntas Frequentes"
},
{
"id": "fap",
"translation": "Fap"
},
{
"id": "advanced_search",
"translation": "Pesquisa avançada"
},
{
"id": "nothing_here",
"translation": "Nada aqui."
},
{
"id": "404_not_found",
"translation": "404 Não encontrado"
},
{
"id": "no_torrents_uploaded",
"translation": "Nenhum torrent enviado ainda!"
},
{
"id": "profile",
"translation": "Perfil"
},
{
"id": "sign_out",
"translation": "Sair"
},
{
"id": "member",
"translation": "Membro"
},
{
"id": "sign_in",
"translation": "Iniciar sessão"
},
{
"id": "sign_up",
"translation": "Registar-se"
},
{
"id": "no_results_found",
"translation": "Nenhum resultado encontrado"
},
{
"id": "notice_keep_seeding",
"translation": "AVISO: CONTINUE SEMEANDO E ACTIVE O DHT"
},
{
"id": "official_nyaapocalipse_faq",
"translation": "Perguntas frequentes sobre o Nyaapocalipse"
},
{
"id": "links_replacement_mirror",
"translation": "Links para a reposição/mirror"
},
{
"id": "what_happened",
"translation": "O que aconteceu?"
},
{
"id": "nyaa_se_went_offline",
"translation": "nyaa.se e domínios associados (como nyaatorrents.info) saíram do ar a 1 de maio de 2017."
},
{
"id": "its_not_a_ddos",
"translation": "Foram desativados, portanto não foi um ataque DDoS (ataque de negação de serviço) como normalmente."
},
{
"id": "future_not_looking_good",
"translation": "Prospectos futuros para o nyaa não parecem boas. (Está morto)"
},
{
"id": "recovery_effort",
"translation": "Está a decorrer uma tentativa de recuperação."
},
{
"id": "is_everything_lost",
"translation": "Foi tudo perdido?"
},
{
"id": "in_short_no",
"translation": "Resumindo, não."
},
{
"id": "are_some_things_lost",
"translation": "Foram perdidas algumas coisas?"
},
{
"id": "answer_is_nyaa_db_lost",
"translation": "Temos uma base de dados que contém os torrents do nyaa até <s>5 de abril</s> 1 de maio. Isso significa que quase nada foi perdido."
},
{
"id": "answer_is_sukebei_db_lost",
"translation": "Sukebei, no entanto, está numa situação pior. Actualmente só temos os dados do sukebei até 2016, mas uma nova base de dados pode estar disponível para uso."
},
{
"id": "how_are_we_recovering",
"translation": "Como estamos a recuperar?"
},
{
"id": "answer_how_are_we_recovering",
"translation": "As bases de dados estão hospedadas em nyaa.pantsu.cat e sukebei.pantsu.cat. Há uma função de pesquisa, e (quase) todas as funcionalidades do nyaa deverão estar de volta em breve. Estatísticas de seeders/leechers estão disponíveis via raspagem de dados e podem ser restauradas no futuro, já que outras funções têm prioridade de momento."
},
{
"id": "how_do_i_link_my_old_account",
"translation": "O que devo fazer para transferir os meus antigos torrents de volta para minha nova conta?"
},
{
"id": "answer_how_do_i_link_my_old_account",
"translation": "Entre em <a href=\"ircs://irc.rizon.net/nyaapantsu-help\">#nyaapantsu-help@Rizon</a> e informe a moderação acerca do seu antigo e novo nome de usuário."
},
{
"id": "are_the_trackers_working",
"translation": "Os torrents ainda funcionam?"
},
{
"id": "answer_are_the_trackers_working",
"translation": "Mesmo com os trackers offline, seeders ainda estão conectados à rede descentralizada DHT. Enquanto o arquivo estiver listado na rede DHT, as coisas deverão funcionar normalmente."
},
{
"id": "how_do_i_download_the_torrents",
"translation": "Como posso transferir os torrents?"
},
{
"id": "answer_how_do_i_download_the_torrents",
"translation": "Use os <b>links magnéticos</b>. Os links magnéticos serão usados pelo seu cliente BitTorrent para procurar o arquivo na rede DHT, e deverá transferi-lo sem problemas."
},
{
"id": "magnet_link_should_look_like",
"translation": "O link magnético parece-se com isso:"
},
{
"id": "which_trackers_do_you_recommend",
"translation": "Que trackers recomendam usar?"
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "Agora possuímos o nosso próprio Tracker. Adicione-o ao topo da lista antes de enviar um torrent:"
},
{
"id": "other_trackers",
"translation": "Mas também deve adicionar estes, caso algo dê errado."
},
{
"id": "how_can_i_help",
"translation": "Como posso ajudar?"
},
{
"id": "answer_how_can_i_help",
"translation": "Se tiver experiência em desenvolvimento para a web, pode entrar no canal de IRC #nyaapantsu em irc.rizon.net. Se tiver alguma base de dados actual, especialmente para o sukebei, <b>ENVIE-A</b>."
},
{
"id": "your_design_sucks_found_a_bug",
"translation": "O vosso design é horrível / Encontrei um bug"
},
{
"id": "why_written_in_go",
"translation": "Porquê que programou em Go?"
},
{
"id": "authors_favorite_language",
"translation": "É a linguagem de programação favorita do autor."
},
{
"id": "upload_magnet",
"translation": "Enviar link magnético"
},
{
"id": "torrent_file",
"translation": "Arquivo de torrent"
},
{
"id": "uploading_file_prefills_fields",
"translation": "Enviar um arquivo de torrent permite o pré-preenchimento de alguns campos, isso é recomendado."
},
{
"id": "magnet_link",
"translation": "Link magnético"
},
{
"id": "all_categories",
"translation": "Todas as categorias"
},
{
"id": "anime",
"translation": "Anime"
},
{
"id": "anime_amv",
"translation": "Anime - AMV (Anime Music Video)"
},
{
"id": "anime_english_translated",
"translation": "Anime - Traduções em inglês"
},
{
"id": "anime_non_english_translated",
"translation": "Anime - Traduções noutras línguas"
},
{
"id": "anime_raw",
"translation": "Anime - Sem tradução"
},
{
"id": "audio",
"translation": "Áudio"
},
{
"id": "audio_lossless",
"translation": "Áudio - Sem perdas"
},
{
"id": "audio_lossy",
"translation": "Audio - Com perdas"
},
{
"id": "literature",
"translation": "Literatura"
},
{
"id": "literature_english_translated",
"translation": "Literatura - Traduções em inglês"
},
{
"id": "literature_raw",
"translation": "Literatura - Sem tradução"
},
{
"id": "literature_non_english_translated",
"translation": "Literatura - Traduções noutras línguas"
},
{
"id": "live_action",
"translation": "Live Action"
},
{
"id": "live_action_english_translated",
"translation": "Live Action - Traduções em inglês"
},
{
"id": "live_action_idol_pv",
"translation": "Live Action - Idol/Vídeo promocional"
},
{
"id": "live_action_non_english_translated",
"translation": "Live Action - Traduções noutras línguas"
},
{
"id": "live_action_raw",
"translation": "Live Action - Sem tradução"
},
{
"id": "pictures",
"translation": "Imagens"
},
{
"id": "pictures_graphics",
"translation": "Imagens - Artes gráficas"
},
{
"id": "pictures_photos",
"translation": "Imagens - Fotos"
},
{
"id": "software",
"translation": "Software"
},
{
"id": "software_applications",
"translation": "Software - Aplicações"
},
{
"id": "software_games",
"translation": "Software - Jogos"
},
{
"id": "torrent_description",
"translation": "Descrição do torrent"
},
{
"id": "description_markdown_notice",
"translation": "Markdown pode ser usado em descrições."
},
{
"id": "show_all",
"translation": "Mostrar todos"
},
{
"id": "filter_remakes",
"translation": "Filtrar refeitos"
},
{
"id": "trusted",
"translation": "Confiável"
},
{
"id": "id",
"translation": "ID"
},
{
"id": "downloads",
"translation": "Downloads"
},
{
"id": "descending",
"translation": "Decrescente"
},
{
"id": "ascending",
"translation": "Crescente"
},
{
"id": "search",
"translation": "Pesquisar"
},
{
"id": "hash",
"translation": "Hash"
},
{
"id": "description",
"translation": "Descrição"
},
{
"id": "comments",
"translation": "Comentários"
},
{
"id": "submit_a_comment_as_username",
"translation": "Comentar como %s"
},
{
"id": "submit_a_comment_as_anonymous",
"translation": "Comentar como Anónimo"
},
{
"id": "submit",
"translation": "Enviar"
},
{
"id": "personal_info",
"translation": "Informações pessoais"
},
{
"id": "language",
"translation": "Língua"
},
{
"id": "current_password",
"translation": "Senha atual"
},
{
"id": "role",
"translation": "Cargo"
},
{
"id": "banned",
"translation": "Banido"
},
{
"id": "default",
"translation": "Padrão"
},
{
"id": "trusted_member",
"translation": "Membro confiável"
},
{
"id": "moderator",
"translation": "Moderador"
},
{
"id": "save_changes",
"translation": "Guardar alterações"
},
{
"id": "profile_updated",
"translation": "O seu perfil foi actualizado correctamente!"
},
{
"id": "delete_account",
"translation": "Apagar conta"
},
{
"id": "delete_account_confirm",
"translation": "Tem a certeza que deseja apagar a sua conta?"
},
{
"id": "delete_success",
"translation": "A sua conta foi apagada com sucesso!"
},
{
"id": "moderation",
"translation": "Moderação"
},
{
"id": "who_is_renchon",
"translation": "Quem é れんちょん?"
},
{
"id": "renchon_anon_explanation",
"translation": "れんちょん (Ren-chon) é o nome atribuído a uploads e comentários feitos anonimamente. Também é usado para torrents importados do nyaa original, embora o uploader original seja mostrado ao lado."
},
{
"id": "mark_as_remake",
"translation": "Marcar como remake"
},
{
"id": "profile_edit_page",
"translation": "Editar o perfil de %s"
},
{
"id": "change_language",
"translation": "Mudar língua"
},
{
"id": "language_name",
"translation": "Português (Portugal)"
}
]

Voir le fichier

@ -17,130 +17,130 @@
},
{
"id": "reset_password_content",
"translation": "Нажмите ссылку ниже, чтобы восстановить пароль."
"translation": "Нажмите на ссылку ниже, чтобы восстановить пароль."
},
{
"id":"register_title",
"id": "register_title",
"translation": "Создание нового аккаунта"
},
{
"id":"signup_box_title",
"id": "signup_box_title",
"translation": "Пожалуйста, зарегистрируйтесь <small>Это бесплатно и всегда будет.</small>"
},
{
"id":"username",
"id": "username",
"translation": "Имя пользователя"
},
{
"id":"email_address_or_username",
"id": "email_address_or_username",
"translation": "Email адрес или Имя пользователя"
},
{
"id":"email_address",
"id": "email_address",
"translation": "Email адрес"
},
{
"id":"password",
"id": "password",
"translation": "Пароль"
},
{
"id":"confirm_password",
"id": "confirm_password",
"translation": "Подтвердите пароль"
},
{
"id":"i_agree",
"id": "i_agree",
"translation": "Я согласен"
},
{
"id":"terms_conditions_confirm",
"id": "terms_conditions_confirm",
"translation": "Нажимая <strong class=\"label label-primary\">Регистрация</strong>, вы соглашаетесь с <a href=\"#\" data-toggle=\"modal\" data-target=\"#t_and_c_m\">Правилами и условиями</a>, указанными на этом сайте, включая использование файлов Cookie."
},
{
"id":"signin",
"id": "signin",
"translation": "Войти"
},
{
"id":"register",
"id": "register",
"translation": "Регистрация"
},
{
"id":"terms_conditions",
"id": "terms_conditions",
"translation": "Правила и условия"
},
{
"id":"terms_conditions_full",
"id": "terms_conditions_full",
"translation": "Некоторое дерьмо."
},
{
"id":"remember_me",
"id": "remember_me",
"translation": "Запомнить меня"
},
{
"id":"forgot_password",
"id": "forgot_password",
"translation": "Забыли пароль?"
},
{
"id":"sign_in_box_title",
"id": "sign_in_box_title",
"translation": "Пожалуйста войдите"
},
{
"id":"sign_in_title",
"id": "sign_in_title",
"translation": "Вход"
},
{
"id":"register_success_title",
"id": "register_success_title",
"translation": "Успешная регистрация"
},
{
"id":"sign_up_success",
"id": "sign_up_success",
"translation": "Благодарим за регистрацию!"
},
{
"id":"verify_success",
"id": "verify_success",
"translation": "<i style=\"color:limegreen\" class=\"glyphicon glyphicon-ok-circle\"></i>Теперь ваш аккаунт активирован!"
},
{
"id":"signup_verification_email",
"translation": "Теперь, в качестве последнего шага регистрации, проверьте свой почтовый ящик (или папку спам) и нажмите ссылку для активации вашего аккаунта!"
"id": "signup_verification_email",
"translation": "Подтверждение Email адреса в данный момент не работает, так что вы можете использовать свой аккаунт уже сейчас. В будущем, пожалуйста, проверьте свои входящие (или папку спам) на письмо с подтверждение Email адреса."
},
{
"id":"signup_verification_noemail",
"id": "signup_verification_noemail",
"translation": "Регистрация прошла успешно, теперь вы можете использовать свой аккаунт."
},
{
"id":"settings",
"id": "settings",
"translation": "Настройки аккаунта"
},
{
"id":"torrents",
"id": "torrents",
"translation": "Торренты"
},
{
"id":"follow",
"id": "follow",
"translation": "Следить"
},
{
"id":"unfollow",
"id": "unfollow",
"translation": "Отписаться"
},
{
"id":"user_followed_msg",
"id": "user_followed_msg",
"translation": "Вы отслеживаете %s!"
},
{
"id":"user_unfollowed_msg",
"id": "user_unfollowed_msg",
"translation": "Вы отписаны от %s!"
},
{
"id":"profile_page",
"id": "profile_page",
"translation": "Страница профиля %s"
},
{
"id":"see_more_torrents_from",
"id": "see_more_torrents_from",
"translation": "Смотреть другие торренты %s "
},
{
"id":"category",
"id": "category",
"translation": "Категория"
},
{
@ -273,7 +273,7 @@
},
{
"id": "answer_is_sukebei_db_lost",
"translation": "Однако, Sukebei не в лучшей форме. В настоящее время у нас есть только сукебские базы данных до 2016 года, но более новая база данных может быть доступна для использования."
"translation": "Sukebei тоже в безопасности и почти ничего не потеряно."
},
{
"id": "how_are_we_recovering",
@ -281,7 +281,15 @@
},
{
"id": "answer_how_are_we_recovering",
"translation": "Вышеупомянутые базы данных размещаются на сайтах nyaa.pantsu.cat и sukebei.pantsu.cat. Существует функция поиска, и (почти) полная функциональность nyaa должна появиться в ближайшее время. Статистика Раздающих/Скачавших возможна с помощью скраппинга и может быть восстановлена в будущем, так как сейчас у нас в большем приоритете другие функции."
"translation": "Вышеупомянутые базы данных размещаются на сайтах nyaa.pantsu.cat и sukebei.pantsu.cat. Существует функция поиска, и (почти) полная функциональность nyaa должна появиться в ближайшее время."
},
{
"id": "how_do_i_link_my_old_account",
"translation": "Как мне привязать свои старые загрузки к моему новому аккаунту?"
},
{
"id": "answer_how_do_i_link_my_old_account",
"translation": "Зайдите на <a href=\"ircs://irc.rizon.net/nyaapantsu-help\">#nyaapantsu-help@Rizon</a> и попросите модератора мигрировать ваши старые торренты, упомянув свои старое и новое имена пользователя."
},
{
"id": "are_the_trackers_working",
@ -311,9 +319,13 @@
"id": "answer_which_trackers_do_you_recommend",
"translation": "Если ваша торрент-загрузка запрещена из-за трекеров, вам нужно добавить некоторые из них:"
},
{
"id": "other_trackers",
"translation": "Но тебе стоит еще добавить эти, просто на случай, если что-то пойдет не так"
},
{
"id": "how_can_i_help",
"translation": "Чем могу помочь?"
"translation": "Как я могу помочь?"
},
{
"id": "answer_how_can_i_help",
@ -351,6 +363,10 @@
"id": "all_categories",
"translation": "Все категории"
},
{
"id": "select_a_torrent_category",
"translation": "Выберите категорию"
},
{
"id": "anime",
"translation": "Аниме"
@ -539,6 +555,10 @@
"id": "moderator",
"translation": "Модератор"
},
{
"id": "api_token",
"translation": "API Токен"
},
{
"id": "save_changes",
"translation": "Сохранить изменения"
@ -600,7 +620,7 @@
"translation": "Изменение профиля %s's"
},
{
"id":"date_format",
"id": "date_format",
"translation": "2006-01-02 15:04"
},
{
@ -615,8 +635,68 @@
"id": "completed",
"translation": "Скачавшие"
},
{
"id": "change_language",
"translation": "Выбор языка"
},
{
"id": "language_name",
"translation": "Русский"
},
{
"id": "delete",
"translation": "Удалить"
},
{
"id": "uploaded_by",
"translation": "Загрузил"
},
{
"id": "download_btn",
"translation": "Загрузить!"
},
{
"id": "report_btn",
"translation": "Пожаловаться"
},
{
"id": "are_you_sure",
"translation": "Вы уверены?"
},
{
"id": "report_torrent_number",
"translation": "Пожаловаться на торрент #%s"
},
{
"id": "report_type",
"translation": "Тип жалобы"
},
{
"id": "illegal_content",
"translation": "Запрещенный контент"
},
{
"id": "spam_garbage",
"translation": "Спам / Мусор"
},
{
"id": "wrong_category",
"translation": "Неправильная категория"
},
{
"id": "duplicate_deprecated",
"translation": "Повтор / Устаревшее"
},
{
"id": "captcha",
"translation": "Капча"
},
{
"id": "file_name",
"translation": "Имя файла"
},
{
"id": "cancel",
"translation": "Отменить"
}
]

Voir le fichier

@ -634,5 +634,57 @@
{
"id": "delete",
"translation": "删除"
},
{
"id": "uploaded_by",
"translation": "上传者"
},
{
"id": "download_btn",
"translation": "下载!"
},
{
"id": "report",
"translation": "举报!"
},
{
"id": "are_you_sure",
"translation": "真的要删除吗?"
},
{
"id": "report_torrent_number",
"translation": "举报种子 #"
},
{
"id": "report_type",
"translation": "举报理由"
},
{
"id": "illegal_content",
"translation": "内容错误"
},
{
"id": "spam_garbage",
"translation": "病毒 / 垃圾数据"
},
{
"id": "wrong_category",
"translation": "分类错误"
},
{
"id": "duplicate_deprecated",
"translation": "资源重复 / 低质量"
},
{
"id": "captcha",
"translation": "验证码"
},
{
"id": "file_name",
"translation": "文件名"
},
{
"id": "cancel",
"translation": "取消"
}
]

Voir le fichier

@ -1,6 +1,7 @@
package languages
import (
"errors"
"fmt"
"html/template"
"net/http"
@ -8,13 +9,26 @@ import (
"path/filepath"
"github.com/ewhal/nyaa/config"
"github.com/ewhal/nyaa/service/user"
"github.com/ewhal/nyaa/model"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/nicksnyder/go-i18n/i18n/language"
)
// this interface is required to prevent a cyclic import between the languages and userService package.
type UserRetriever interface {
RetrieveCurrentUser(r *http.Request) (model.User, error)
}
var (
defaultLanguage string = config.DefaultI18nConfig.DefaultLanguage
userRetriever UserRetriever = nil
)
// Initialize the languages translation
func InitI18n(conf config.I18nConfig) error {
func InitI18n(conf config.I18nConfig, retriever UserRetriever) error {
defaultLanguage = conf.DefaultLanguage
userRetriever = retriever
defaultFilepath := path.Join(conf.TranslationsDirectory, conf.DefaultLanguage+".all.json")
err := i18n.LoadTranslationFile(defaultFilepath)
if err != nil {
@ -26,16 +40,20 @@ func InitI18n(conf config.I18nConfig) error {
return fmt.Errorf("failed to get translation files: %v", err)
}
for _, path := range paths {
err := i18n.LoadTranslationFile(path)
for _, file := range paths {
err := i18n.LoadTranslationFile(file)
if err != nil {
return fmt.Errorf("failed to load translation file '%s': %v", path, err)
return fmt.Errorf("failed to load translation file '%s': %v", file, err)
}
}
return nil
}
func GetDefaultLanguage() string {
return defaultLanguage
}
// When go-i18n finds a language with >0 translations, it uses it as the Tfunc
// However, if said language has a missing translation, it won't fallback to the "main" language
func TfuncAndLanguageWithFallback(language string, languages ...string) (i18n.TranslateFunc, *language.Language, error) {
@ -89,9 +107,15 @@ func setTranslation(tmpl *template.Template, T i18n.TranslateFunc) {
})
}
func GetTfuncAndLanguageFromRequest(r *http.Request, defaultLanguage string) (T i18n.TranslateFunc, Tlang *language.Language) {
func GetDefaultTfunc() (i18n.TranslateFunc, error) {
return i18n.Tfunc(defaultLanguage)
}
func GetTfuncAndLanguageFromRequest(r *http.Request) (T i18n.TranslateFunc, Tlang *language.Language) {
defaultLanguage := GetDefaultLanguage()
userLanguage := ""
user, _, err := userService.RetrieveCurrentUser(r)
user, err := getCurrentUser(r)
if err == nil {
userLanguage = user.Language
}
@ -108,9 +132,17 @@ func GetTfuncAndLanguageFromRequest(r *http.Request, defaultLanguage string) (T
return
}
func SetTranslationFromRequest(tmpl *template.Template, r *http.Request, defaultLanguage string) i18n.TranslateFunc {
func SetTranslationFromRequest(tmpl *template.Template, r *http.Request) i18n.TranslateFunc {
r.Header.Add("Vary", "Accept-Encoding")
T, _ := GetTfuncAndLanguageFromRequest(r, defaultLanguage)
T, _ := GetTfuncAndLanguageFromRequest(r)
setTranslation(tmpl, T)
return T
}
func getCurrentUser(r *http.Request) (model.User, error) {
if userRetriever == nil {
return model.User{}, errors.New("failed to get current user: no user retriever set")
}
return userRetriever.RetrieveCurrentUser(r)
}

Voir le fichier

@ -10,8 +10,9 @@ import (
func TestInitI18n(t *testing.T) {
conf := config.DefaultI18nConfig
conf.TranslationsDirectory = path.Join("..", "..", conf.TranslationsDirectory)
var retriever UserRetriever = nil // not required during initialization
err := InitI18n(conf)
err := InitI18n(conf, retriever)
if err != nil {
t.Errorf("failed to initialize language translations: %v", err)
}

Voir le fichier

@ -106,6 +106,7 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
case "2":
search.Sort = common.Date
orderBy += "date"
search.NotNull = "date IS NOT NULL"
break
case "3":
search.Sort = common.Downloads
@ -114,21 +115,23 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
case "4":
search.Sort = common.Size
orderBy += "filesize"
// avoid sorting completely breaking on postgres
search.NotNull = "filesize IS NOT NULL"
break
case "5":
search.Sort = common.Seeders
orderBy += "seeders"
search.NotNull += "seeders IS NOT NULL "
search.NotNull = "seeders IS NOT NULL"
break
case "6":
search.Sort = common.Leechers
orderBy += "leechers"
search.NotNull += "leechers IS NOT NULL "
search.NotNull = "leechers IS NOT NULL"
break
case "7":
search.Sort = common.Completed
orderBy += "completed"
search.NotNull += "completed IS NOT NULL "
search.NotNull = "completed IS NOT NULL"
break
default:
search.Sort = common.ID
@ -173,10 +176,6 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
conditions = append(conditions, search.NotNull)
}
if len(search.NotNull) > 0 {
conditions = append(conditions, search.NotNull)
}
searchQuerySplit := strings.Fields(search.Query)
for _, word := range searchQuerySplit {
firstRune, _ := utf8.DecodeRuneInString(word)