Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #181 from ElegantMonkey/extract-strings-for-translation

Extract strings for translation
Cette révision appartient à :
akuma06 2017-05-08 23:21:51 +02:00 révisé par GitHub
révision 1f6389db25
15 fichiers modifiés avec 523 ajouts et 126 suppressions

Voir le fichier

@ -3,12 +3,15 @@ package router
import (
"net/http"
"github.com/ewhal/nyaa/util/languages"
"github.com/gorilla/mux"
)
func FaqHandler(w http.ResponseWriter, r *http.Request) {
searchForm := NewSearchForm()
searchForm.HideAdvancedSearch = true
languages.SetTranslationFromRequest(faqTemplate, r, "en-us")
err := faqTemplate.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, searchForm, GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -3,6 +3,7 @@ package router
import (
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/service/torrent"
"github.com/ewhal/nyaa/util/languages"
"github.com/ewhal/nyaa/util/log"
"github.com/gorilla/mux"
"html"
@ -35,6 +36,8 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
}
navigationTorrents := Navigation{nbTorrents, maxPerPage, pagenum, "search_page"}
languages.SetTranslationFromRequest(homeTemplate, r, "en-us")
htv := HomeTemplateVariables{b, NewSearchForm(), navigationTorrents, GetUser(r), r.URL, mux.CurrentRoute(r)}
err := homeTemplate.ExecuteTemplate(w, "index.html", htv)

Voir le fichier

@ -4,6 +4,7 @@ import (
"html/template"
"net/http"
"github.com/ewhal/nyaa/util/languages"
"github.com/gorilla/mux"
)
@ -19,6 +20,8 @@ func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
searchForm := NewSearchForm()
searchForm.HideAdvancedSearch = true
languages.SetTranslationFromRequest(notFoundTemplate, r, "en-us")
err := notFoundTemplate.ExecuteTemplate(w, "index.html", NotFoundTemplateVariables{Navigation{}, searchForm, GetUser(r), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -3,6 +3,7 @@ package router
import (
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/util/search"
"github.com/ewhal/nyaa/util/languages"
"github.com/gorilla/mux"
"html"
"net/http"
@ -39,6 +40,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")
err := searchTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Voir le fichier

@ -10,6 +10,7 @@ import (
"github.com/ewhal/nyaa/db"
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/service/captcha"
"github.com/ewhal/nyaa/util/languages"
"github.com/gorilla/mux"
)
@ -46,6 +47,7 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
} else if r.Method == "GET" {
uploadForm.CaptchaID = captcha.GetID()
htv := UploadTemplateVariables{uploadForm, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(uploadTemplate, r, "en-us")
err = uploadTemplate.ExecuteTemplate(w, "index.html", htv)
} else {
w.WriteHeader(http.StatusMethodNotAllowed)

Voir le fichier

@ -9,6 +9,7 @@ import (
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/service/captcha"
"github.com/ewhal/nyaa/service/torrent"
"github.com/ewhal/nyaa/util/languages"
"github.com/ewhal/nyaa/util/log"
"github.com/gorilla/mux"
)
@ -25,6 +26,7 @@ func ViewHandler(w http.ResponseWriter, r *http.Request) {
b := torrent.ToJson()
htv := ViewTemplateVariables{b, captcha.Captcha{CaptchaID: captcha.GetID()}, NewSearchForm(), Navigation{}, GetUser(r), r.URL, mux.CurrentRoute(r)}
languages.SetTranslationFromRequest(viewTemplate, r, "en-us")
err = viewTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
log.Errorf("ViewHandler(): %s", err)

Voir le fichier

@ -102,5 +102,393 @@
{
"id":"signup_verification_email",
"translation": "Now, you are one step left before being part of our community! Check your emails (inbox or spam folder) and click the link provided for activating your account!"
},
{
"id":"settings",
"translation": "Account Settings"
},
{
"id":"torrents",
"translation": "Torrents"
},
{
"id":"follow",
"translation": "Follow"
},
{
"id":"profile_page",
"translation": "%s Profile Page"
},
{
"id":"see_more_torrents_from",
"translation": "See more torrents from %s "
},
{
"id":"category",
"translation": "Category"
},
{
"id": "name",
"translation": "Name"
},
{
"id": "date",
"translation": "Date"
},
{
"id": "size",
"translation": "Size"
},
{
"id": "links",
"translation": "Links"
},
{
"id": "home",
"translation": "Home"
},
{
"id": "error_404",
"translation": "Error 404"
},
{
"id": "toggle_navigation",
"translation": "Toggle navigation"
},
{
"id": "upload",
"translation": "Upload"
},
{
"id": "faq",
"translation": "FAQ"
},
{
"id": "fap",
"translation": "Fap"
},
{
"id": "advanced_search",
"translation": "Advanced Search"
},
{
"id": "nothing_here",
"translation": "Nothing Here."
},
{
"id": "404_not_found",
"translation": "404 Not Found"
},
{
"id": "profile",
"translation": "Profile"
},
{
"id": "sign_out",
"translation": "Sign-out"
},
{
"id": "member",
"translation": "Member"
},
{
"id": "sign_in",
"translation": "Sign in"
},
{
"id": "sign_up",
"translation": "Sign Up"
},
{
"id": "no_results_found",
"translation": "No Results found"
},
{
"id": "notice_keep_seeding",
"translation": "NOTICE: KEEP SEEDING AND ENABLE DHT YOU RETARD"
},
{
"id": "official_nyaapocalipse_faq",
"translation": "Official Nyaapocalypse FAQ"
},
{
"id": "links_replacement_mirror",
"translation": "Links for the replacement/mirror"
},
{
"id": "what_happened",
"translation": "What happened?"
},
{
"id": "nyaa_se_went_offline",
"translation": "nyaa.se and associated domains (such as nyaatorrents.info) went offline on May 01, 2017."
},
{
"id": "its_not_a_ddos",
"translation": "They were deactivated, so it's not a DDoS attack like usual."
},
{
"id": "future_not_looking_good",
"translation": "Future prospects for nyaa are not looking good. (It's dead)"
},
{
"id": "recovery_effort",
"translation": "There is a recovery effort taking place."
},
{
"id": "is_everything_lost",
"translation": "Is everything lost?"
},
{
"id": "in_short_no",
"translation": "In short, No."
},
{
"id": "are_some_things_lost",
"translation": "Are some things lost?"
},
{
"id": "answer_is_nyaa_db_lost",
"translation": "We have a database of the torrents on nyaa up to <s>April 5</s> May 1. That means almost nothing is lost."
},
{
"id": "answer_is_sukebei_db_lost",
"translation": "Sukebei, however might be in worse shape. Currently we only have sukebei databases up to 2016, but a newer database might be available for use."
},
{
"id": "how_are_we_recovering",
"translation": "How are we recovering?"
},
{
"id": "answer_how_are_we_recovering",
"translation": "The aforementioned databases are being hosted at nyaa.pantsu.cat and sukebei.pantsu.cat. There is a search function, and (almost) full nyaa functionality should be coming soon. Seeder/leecher statistics are possible via scraping and might be restored sometime in the future, since other feature take priority right now."
},
{
"id": "are_the_trackers_working",
"translation": "Are the torrents still working?"
},
{
"id": "answer_are_the_trackers_working",
"translation": "Even if the trackers are down, seeders are still connected to the decentralized DHT network. As long as the file is listed on the DHT network, business should carry on as usual."
},
{
"id": "how_do_i_download_the_torrents",
"translation": "How do I download the torrents?"
},
{
"id": "answer_how_do_i_download_the_torrents",
"translation": "Just use the <b>magnet link</b>. The magnet link will be used by your BitTorrent client to look up the file on the DHT network and it should download just fine."
},
{
"id": "magnet_link_should_look_like",
"translation": "The magnet link should look like this:"
},
{
"id": "which_trackers_do_you_recommend",
"translation": "Which trackers do you recommend using?"
},
{
"id": "answer_which_trackers_do_you_recommend",
"translation": "If your torrent upload is denied because of trackers you'll need to add some of these:"
},
{
"id": "how_can_i_help",
"translation": "How can I help?"
},
{
"id": "answer_how_can_i_help",
"translation": "If you have website development expertise, you can join the #nyaapantsu IRC channel on irc.rizon.net. If you have any current databases, especially for sukebei, <b>UPLOAD THEM</b>."
},
{
"id": "your_design_sucks_found_a_bug",
"translation": "Your design sucks / I found a bug"
},
{
"id": "why_written_in_go",
"translation": "Why is your shit written in Go?"
},
{
"id": "authors_favorite_language",
"translation": "It's the author's favorite programming language."
},
{
"id": "nyaa_pantsu_dont_host_files",
"translation": "nyaa.pantsu.cat and sukebei.pantsu.cat do not host any files."
},
{
"id": "upload_magnet",
"translation": "Upload magnet"
},
{
"id": "torrent_file",
"translation": "Torrent file"
},
{
"id": "uploading_torrent_prefills_fields",
"translation": "Uploading a torrent file allows pre-filling some fields, this is recommended."
},
{
"id": "magnet_link",
"translation": "Magnet Link"
},
{
"id": "all_categories",
"translation": "All categories"
},
{
"id": "anime",
"translation": "Anime"
},
{
"id": "anime_amv",
"translation": "Anime - Anime Music Video"
},
{
"id": "anime_english_translated",
"translation": "Anime - English-translated"
},
{
"id": "anime_non_english_translated",
"translation": "Anime - Non-English-translated"
},
{
"id": "anime_raw",
"translation": "Anime - Raw"
},
{
"id": "audio",
"translation": "Audio"
},
{
"id": "audio_lossless",
"translation": "Audio - Lossless"
},
{
"id": "audio_lossy",
"translation": "Audio - Lossy"
},
{
"id": "literature",
"translation": "Literature"
},
{
"id": "literature_english_translated",
"translation": "Literature - English-translated"
},
{
"id": "literature_raw",
"translation": "Literature - Raw"
},
{
"id": "literature_non_english_translated",
"translation": "Literature - Non-English-translated"
},
{
"id": "live_action",
"translation": "Live Action"
},
{
"id": "live_action_english_translated",
"translation": "Live Action - English-translated"
},
{
"id": "live_action_idol_pv",
"translation": "Live Action - Idol/Promotional Video"
},
{
"id": "live_action_non_english_translated",
"translation": "Live Action - Non-English-translated"
},
{
"id": "live_action_raw",
"translation": "Live Action - Raw"
},
{
"id": "pictures",
"translation": "Pictures"
},
{
"id": "pictures_graphics",
"translation": "Pictures - Graphics"
},
{
"id": "pictures_photos",
"translation": "Pictures - Photos"
},
{
"id": "software",
"translation": "Software"
},
{
"id": "software_applications",
"translation": "Software - Applications"
},
{
"id": "software_games",
"translation": "Software - Games"
},
{
"id": "torrent_description",
"translation": "Torrent Description"
},
{
"id": "limited_html_set_is_allowed_use",
"translation": "A limited set of HTML is allowed in the description, make sure to use"
},
{
"id": "show_all",
"translation": "Show all"
},
{
"id": "filter_remakes",
"translation": "Filter Remakes"
},
{
"id": "trusted",
"translation": "Trusted"
},
{
"id": "id",
"translation": "ID"
},
{
"id": "downloads",
"translation": "Downloads"
},
{
"id": "descending",
"translation": "Descending"
},
{
"id": "ascending",
"translation": "Ascending"
},
{
"id": "search",
"translation": "Search"
},
{
"id": "hash",
"translation": "Hash"
},
{
"id": "description",
"translation": "Description"
},
{
"id": "comments",
"translation": "Comments"
},
{
"id": "submit_a_comment_as_username",
"translation": "Submit a comment as %s"
},
{
"id": "submit_a_comment_as_anonymous",
"translation": "Submit a comment as Anonymous"
},
{
"id": "submit",
"translation": "Submit"
}
]

Voir le fichier

@ -1,7 +1,7 @@
{{define "title"}}404 Not Found{{end}}
{{define "title"}}{{T "404_not_found"}}{{end}}
{{define "content"}}
<div>
<h1>404 Not Found</h1>
<h1>{{T "404_not_found"}}</h1>
<br />
<img class="center-block center-image" src="/img/404.svg"></img>
</div>

Voir le fichier

@ -1,50 +1,44 @@
{{define "title"}}FAQ{{end}}
{{define "title"}}{{T "faq"}}{{end}}
{{define "content"}}
<div class="blockBody">
<!-- marquees are the true purpose of HTML -->
<marquee><h2>NOTICE: KEEP SEEDING AND ENABLE DHT YOU RETARD</h2></marquee>
<marquee><h2>{{T "notice_keep_seeding"}}</h2></marquee>
<h1>Official Nyaapocalypse FAQ</h1>
<h1>{{T "official_nyaapocalipse_faq"}}</h1>
<br />
<h2>Links for the replacement/mirror</h2>
<h2>{{T "links_replacement_mirror"}}</h2>
<a href="https://nyaa.pantsu.cat">Nyaa - nyaa.pantsu.cat</a><br />
<a href="https://sukebei.pantsu.cat">Sukebei - sukebei.pantsu.cat</a>
<h2>What happened?</h2>
<h2>{{T "what_happened"}}</h2>
<ul>
<li>nyaa.se and associated domains (such as nyaatorrents.info) went offline on May 01, 2017.</li>
<li>They were deactivated, so it's not a DDoS attack like usual.</li>
<li>Future prospects for nyaa are not looking good. (It's dead)</li>
<li>There is a recovery effort taking place.</li>
<li>{{T "nyaa_se_went_offline"}}</li>
<li>{{T "its_not_a_ddos"}}</li>
<li>{{T "future_not_looking_good"}}</li>
<li>{{T "recovery_effort"}}</li>
</ul>
<h2>Is everything lost?</h2>
<p>In short, No.</p>
<h2>{{T "is_everything_lost"}}</h2>
<p>{{T "in_short_no"}}</p>
<h2>Are some things lost?</h2>
<p>We have a database of the torrents on nyaa up to <s>April 5</s> May 1. That means almost nothing is lost.</p>
<p>Sukebei, however might be in worse shape. Currently we only have sukebei databases up to 2016,
but a newer database might be available for use.</p>
<h2>{{T "are_some_things_lost"}}</h2>
<p>{{T "answer_is_nyaa_db_lost"}}</p>
<p>{{T "answer_is_sukebei_db_lost"}}</p>
<h2>How are we recovering?</h2>
<p>The aforementioned databases are being hosted at nyaa.pantsu.cat and sukebei.pantsu.cat.
There is a search function, and (almost) full nyaa functionality should be coming soon.
Seeder/leecher statistics are possible via scraping and might be restored sometime in the future,
since other feature take priority right now.</p>
<h2>{{T "how_are_we_recovering"}}</h2>
<p>{{T "answer_how_are_we_recovering"}}</p>
<h2>Are the torrents still working?</h2>
<p>Even if the trackers are down, seeders are still connected to the decentralized DHT network.
As long as the file is listed on the DHT network, business should carry on as usual.</p>
<h2>{{T "are_the_trackers_working"}}</h2>
<p>{{T "answer_are_the_trackers_working"}}</p>
<h2>How do I download the torrents?</h2>
<p>Just use the <b>magnet link</b>. The magnet link will be used by your BitTorrent client to look up the file on the
DHT network and it should download just fine.</p>
<p>The magnet link should look like this: <span style="font-family:monospace">
<h2>{{T "how_do_i_download_the_torrents"}}</h2>
<p>{{T "answer_how_do_i_download_the_torrents"}}</p>
<p>{{T "magnet_link_should_look_like"}} <span style="font-family:monospace">
magnet:?xt=urn:btih:[hash]&amp;dn=[name]&amp;tr=[tracker]&amp;tr=[...]</span></p>
<h2 id="trackers">Which trackers do you recommend using?</h2>
<p>If your torrent upload is denied because of trackers you'll need to add some of these:</p>
<h2 id="trackers">{{T "which_trackers_do_you_recommend"}}</h2>
<p>{{T "answer_which_trackers_do_you_recommend"}}</p>
<pre>udp://tracker.coppersurfer.tk:6969
udp://zer0day.to:1337/announce
udp://tracker.leechers-paradise.org:6969
@ -55,21 +49,20 @@ udp://eddie4.nl:6969/announce
http://mgtracker.org:6969/announce
http://tracker.baka-sub.cf/announce</pre>
<h2>How can I help?</h2>
<p>If you have website development expertise, you can join the #nyaapantsu IRC channel on irc.rizon.net.
If you have any current databases, especially for sukebei, <b>UPLOAD THEM</b>.</p>
<h2>{{T "how_can_i_help"}}</h2>
<p>{{T "answer_how_can_i_help"}}</p>
<h2>Your design sucks / I found a bug</h2>
<h2>{{T "your_design_sucks_found_a_bug"}}</h2>
<p><a href="https://github.com/ewhal/nyaa/issues">https://github.com/ewhal/nyaa/issues</a>.</p>
<h2>Why is your shit written in Go?</h2>
<p>It's the author's favorite programming language.</p>
<h2>{{T "why_written_in_go"}}</h2>
<p>{{T "authors_favorite_language"}}</p>
<br />
<img style="max-width: 100%" src="https://my.mixtape.moe/omrskw.png" alt="funny meme">
<br />
<h2>nyaa.pantsu.cat and sukebei.pantsu.cat do not host any files.</h2>
<h2>{{T "nyaa_pantsu_dont_host_files"}}</h2>
</div>
{{end}}

Voir le fichier

@ -5,15 +5,15 @@
{{if gt .Id 0}}
<a href="{{ genRoute "user_profile" "id" (print .Id) "username" .Username }}" class="dropdown-toggle" data-toggle="dropdown">{{ .Username }} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{ genRoute "user_profile" "id" (print .Id) "username" .Username }}"><i class="fa fa-cog"></i> Profile</a></li>
<li><a href="{{ genRoute "user_profile" "id" (print .Id) "username" .Username }}"><i class="fa fa-cog"></i> {{T "profile"}}</a></li>
<li class="divider"></li>
<li><a href="#soon"><i class="fa fa-sign-out"></i> Sign-out</a></li>
<li><a href="#soon"><i class="fa fa-sign-out"></i> {{T "sign_out"}}</a></li>
</ul>
{{ else }}
<a href="#" class="dropdown-toggle profile-image" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Member<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{{ genRoute "user_login" }}"><i class="fa fa-sign-out"></i> Sign in</a></li>
<li><a href="{{ genRoute "user_register" }}"><i class="fa fa-cog"></i> Sign Up</a></li>
<li><a href="{{ genRoute "user_login" }}"><i class="fa fa-sign-out"></i> {{T "sign_in"}}</a></li>
<li><a href="{{ genRoute "user_register" }}"><i class="fa fa-cog"></i> {{T "sign_up"}}</a></li>
</ul>
{{end}}
</li>

Voir le fichier

@ -1,48 +1,48 @@
{{define "search_common"}}
<select name="c" class="form-control input-sm" value>
<option value="_">All categories</option>
<option value="3_" {{if eq .Search.Category "3_"}}selected{{end}}>Anime</option>
<option value="3_12" {{if eq .Search.Category "3_12"}}selected{{end}}>Anime - Anime Music Video</option>
<option value="3_5" {{if eq .Search.Category "3_5"}}selected{{end}}>Anime - English-translated</option>
<option value="3_13" {{if eq .Search.Category "3_13"}}selected{{end}}>Anime - Non-English-translated</option>
<option value="3_6" {{if eq .Search.Category "3_6"}}selected{{end}}>Anime - Raw</option>
<option value="2_" {{if eq .Search.Category "2_"}}selected{{end}}>Audio</option>
<option value="2_3" {{if eq .Search.Category "2_3"}}selected{{end}}>Audio - Lossless</option>
<option value="2_4" {{if eq .Search.Category "2_4"}}selected{{end}}>Audio - Lossy</option>
<option value="4_" {{if eq .Search.Category "4_"}}selected{{end}}>Literature</option>
<option value="4_7" {{if eq .Search.Category "4_7"}}selected{{end}}>Literature - English-translated</option>
<option value="4_8" {{if eq .Search.Category "4_8"}}selected{{end}}>Literature - Raw</option>
<option value="4_14" {{if eq .Search.Category "4_14"}}selected{{end}}>Literature - Non-English-translated</option>
<option value="5_" {{if eq .Search.Category "5_"}}selected{{end}}>Live Action</option>
<option value="5_9" {{if eq .Search.Category "5_9"}}selected{{end}}>Live Action - English-translated</option>
<option value="5_10" {{if eq .Search.Category "5_10"}}selected{{end}}>Live Action - Idol/Promotional Video</option>
<option value="5_18" {{if eq .Search.Category "5_18"}}selected{{end}}>Live Action - Non-English-translated</option>
<option value="5_11" {{if eq .Search.Category "5_11"}}selected{{end}}>Live Action - Raw</option>
<option value="6_" {{if eq .Search.Category "6_"}}selected{{end}}>Pictures</option>
<option value="6_15" {{if eq .Search.Category "6_15"}}selected{{end}}>Pictures - Graphics</option>
<option value="6_16" {{if eq .Search.Category "6_16"}}selected{{end}}>Pictures - Photos</option>
<option value="1_" {{if eq .Search.Category "1_"}}selected{{end}}>Software</option>
<option value="1_1" {{if eq .Search.Category "1_1"}}selected{{end}}>Software - Applications</option>
<option value="1_2" {{if eq .Search.Category "1_2"}}selected{{end}}>Software - Games</option>
<option value="_">{{T "all_categories"}}</option>
<option value="3_" {{if eq .Search.Category "3_"}}selected{{end}}>{{T "anime"}}</option>
<option value="3_12" {{if eq .Search.Category "3_12"}}selected{{end}}>{{T "anime_amv"}}</option>
<option value="3_5" {{if eq .Search.Category "3_5"}}selected{{end}}>{{T "anime_english_translated"}}</option>
<option value="3_13" {{if eq .Search.Category "3_13"}}selected{{end}}>{{T "anime_non_english_translated"}}</option>
<option value="3_6" {{if eq .Search.Category "3_6"}}selected{{end}}>{{T "anime_raw"}}</option>
<option value="2_" {{if eq .Search.Category "2_"}}selected{{end}}>{{T "audio"}}</option>
<option value="2_3" {{if eq .Search.Category "2_3"}}selected{{end}}>{{T "audio_lossless"}}</option>
<option value="2_4" {{if eq .Search.Category "2_4"}}selected{{end}}>{{T "audio_lossy"}}</option>
<option value="4_" {{if eq .Search.Category "4_"}}selected{{end}}>{{T "literature"}}</option>
<option value="4_7" {{if eq .Search.Category "4_7"}}selected{{end}}>{{T "literature_english_translated"}}</option>
<option value="4_8" {{if eq .Search.Category "4_8"}}selected{{end}}>{{T "literature_raw"}}</option>
<option value="4_14" {{if eq .Search.Category "4_14"}}selected{{end}}>{{T "literature_non_english_translated"}}</option>
<option value="5_" {{if eq .Search.Category "5_"}}selected{{end}}>{{T "live_action"}}</option>
<option value="5_9" {{if eq .Search.Category "5_9"}}selected{{end}}>{{T "live_action_english_translated"}}</option>
<option value="5_10" {{if eq .Search.Category "5_10"}}selected{{end}}>{{T "live_action_idol_pv"}}</option>
<option value="5_18" {{if eq .Search.Category "5_18"}}selected{{end}}>{{T "live_action_non_english_translated"}}</option>
<option value="5_11" {{if eq .Search.Category "5_11"}}selected{{end}}>{{T "live_action_raw"}}</option>
<option value="6_" {{if eq .Search.Category "6_"}}selected{{end}}>{{T "pictures"}}</option>
<option value="6_15" {{if eq .Search.Category "6_15"}}selected{{end}}>{{T "pictures_graphics"}}</option>
<option value="6_16" {{if eq .Search.Category "6_16"}}selected{{end}}>{{T "pictures_photos"}}</option>
<option value="1_" {{if eq .Search.Category "1_"}}selected{{end}}>{{T "software"}}</option>
<option value="1_1" {{if eq .Search.Category "1_1"}}selected{{end}}>{{T "software_applications"}}</option>
<option value="1_2" {{if eq .Search.Category "1_2"}}selected{{end}}>{{T "software_games"}}</option>
</select>
<select name="s" class="form-control input-sm">
<option value="">Show all</option>
<option value="2" {{if eq .Search.Status "2"}}selected{{end}}>Filter Remakes</option>
<option value="3" {{if eq .Search.Status "3"}}selected{{end}}>Trusted</option>
<option value="">{{T "show_all"}}</option>
<option value="2" {{if eq .Search.Status "2"}}selected{{end}}>{{T "filter_remakes"}}</option>
<option value="3" {{if eq .Search.Status "3"}}selected{{end}}>{{T "trusted"}}</option>
<option value="4" {{if eq .Search.Status "4"}}selected{{end}}>A+</option>
</select>
{{end}}
{{define "search_advanced"}}
<select name="sort" class="form-control input-sm">
<option value="torrent_id" {{if eq .Search.Sort "torrent_id"}}selected{{end}}>ID</option>
<option value="torrent_name" {{if eq .Search.Sort "torrent_name"}}selected{{end}}>Name</option>
<option value="date" {{if eq .Search.Sort "date"}}selected{{end}}>Date</option>
<option value="downloads" {{if eq .Search.Sort "downloads"}}selected{{end}}>Downloads</option>
<option value="filesize" {{if eq .Search.Sort "filesize"}}selected{{end}}>Size</option>
<option value="torrent_id" {{if eq .Search.Sort "torrent_id"}}selected{{end}}>{{T "id"}}</option>
<option value="torrent_name" {{if eq .Search.Sort "torrent_name"}}selected{{end}}>{{T "name"}}</option>
<option value="date" {{if eq .Search.Sort "date"}}selected{{end}}>{{T "date"}}</option>
<option value="downloads" {{if eq .Search.Sort "downloads"}}selected{{end}}>{{T "downloads"}}</option>
<option value="filesize" {{if eq .Search.Sort "filesize"}}selected{{end}}>{{T "size"}}</option>
</select>
<select name="order" class="form-control input-sm">
<option value="desc" {{if eq .Search.Order "desc"}}selected{{end}}>Descending</option>
<option value="asc" {{if eq .Search.Order "asc"}}selected{{end}}>Ascending</option>
<option value="desc" {{if eq .Search.Order "desc"}}selected{{end}}>{{T "descending"}}</option>
<option value="asc" {{if eq .Search.Order "asc"}}selected{{end}}>{{T "ascending"}}</option>
</select>
<select name="max" class="form-control input-sm">
<option value="5" {{if eq .Navigation.MaxItemPerPage 5}}selected{{end}}>5</option>
@ -65,9 +65,9 @@
{{define "search_button"}}
<div class="input-group">
<input name="q" class="form-control input-sm" placeholder="Search" type="text" value="{{.Search.Query}}">
<input name="q" class="form-control input-sm" placeholder="{{T "search"}}" type="text" value="{{.Search.Query}}">
<span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-search" aria-hidden="true"></span><span class="search_text"> Search</span></button>
<button type="submit" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-search" aria-hidden="true"></span><span class="search_text"> {{T "search"}}</span></button>
</span>
</div>
{{end}}

Voir le fichier

@ -1,4 +1,4 @@
{{define "title"}}Home{{end}}
{{define "title"}}{{T "home"}}{{end}}
{{define "contclass"}}cont-home{{end}}
{{define "content"}}
<div class="blockBody">
@ -11,11 +11,11 @@
<div class="table-responsive">
<table class="table custom-table-hover">
<tr>
<th>Category</th>
<th>Name</th>
<th>Date</th>
<th>Size</th>
<th>Links</th>
<th>{{T "category"}}</th>
<th>{{T "name"}}</th>
<th>{{T "date"}}</th>
<th>{{T "size"}}</th>
<th>{{T "links"}}</th>
</tr>
{{ range .ListTorrents}}
<tr class="torrent-info

Voir le fichier

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Nyaa Pantsu - {{block "title" .}}Error 404{{end}}</title>
<title>Nyaa Pantsu - {{block "title" .}}{{ T "error_404" }}{{end}}</title>
<link rel="icon" type="image/png" href="/img/favicon.png?v=3" />
<!-- RSS Feed with Context -->
@ -33,7 +33,7 @@
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="sr-only">{{ T "toggle_navigation" }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@ -42,10 +42,10 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{{.URL.Parse "/upload"}}">Upload</a/></li>
<li><a href="{{.URL.Parse "/faq"}}">FAQ</a></li>
<li><a href="{{.URL.Parse "/upload"}}">{{T "upload"}}</a/></li>
<li><a href="{{.URL.Parse "/faq"}}">{{T "faq"}}</a></li>
<li><a href="{{ genRouteWithQuery "feed" .URL }}">RSS</a></li>
<li><a href="https://sukebei.pantsu.cat">Fap</a></li>
<li><a href="https://sukebei.pantsu.cat">{{T "fap"}}</a></li>
<li><a href="irc://irc.rizon.net/nyaapantsu">IRC</a></li>
</ul>
@ -71,7 +71,7 @@
<div class="container {{block "contclass" .}}generic{{end}}" id="container">
{{if not .Search.HideAdvancedSearch}}
<div class="blockBody" style="text-align:center">
<font size="4.5">Advanced Search</font><br />
<font size="4.5">{{T "advanced_search"}}</font><br />
<form class="navbar-form" role="search" action="/search" method="get">
<div class="form-group">
{{block "search_common" .}}{{end}}
@ -84,7 +84,7 @@
<div style="margin:0.5em"></div>
{{end}}
{{block "content" .}}Nothing Here.{{end}}
{{block "content" .}}{{T "nothing_here"}}{{end}}
</div>
<!-- bottom padding -->

Voir le fichier

@ -6,52 +6,52 @@
<form enctype="multipart/form-data" role="upload" method="POST">
<div class="form-group">
<label for="name">Name</label>
<label for="name">{{T "name"}}</label>
<input type="text" name="name" class="form-control" placeholder="File Name" value="{{.Name}}" required>
</div>
<div class="form-group">
<label for="torrent">Torrent file</label>
<label for="torrent">{{T "torrent_file"}}</label>
<input type="file" name="torrent" id="torrent" accept=".torrent">
<p class="help-block">Uploading a torrent file allows pre-filling some fields, this is recommended.</p>
<p class="help-block">{{T "uploading_file_prefills_fields"}}</p>
</div>
<div class="form-group">
<label for="magnet">Magnet Link</label>
<label for="magnet">{{T "magnet_link"}}</label>
<input type="text" name="magnet" class="form-control"
style="width:60rem" placeholder="Magnet Link" value="{{.Magnet}}">
style="width:60rem" placeholder="{{T "magnet_link"}}" value="{{.Magnet}}">
</div>
<div class="form-group">
<label for="c">Category</label>
<label for="c">{{T "category"}}</label>
<select name="c" class="form-control input-sm">
<option value="3_12" {{if eq .Category "3_12"}}selected{{end}}>Anime - Anime Music Video</option>
<option value="3_5" {{if eq .Category "3_5"}}selected{{end}}>Anime - English-translated</option>
<option value="3_13" {{if eq .Category "3_13"}}selected{{end}}>Anime - Non-English-translated</option>
<option value="3_6" {{if eq .Category "3_6"}}selected{{end}}>Anime - Raw</option>
<option value="2_3" {{if eq .Category "2_3"}}selected{{end}}>Audio - Lossless</option>
<option value="2_4" {{if eq .Category "2_4"}}selected{{end}}>Audio - Lossy</option>
<option value="4_7" {{if eq .Category "4_7"}}selected{{end}}>Literature - English-translated</option>
<option value="4_8" {{if eq .Category "4_8"}}selected{{end}}>Literature - Raw</option>
<option value="4_14" {{if eq .Category "4_14"}}selected{{end}}>Literature - Non-English-translated</option>
<option value="5_9" {{if eq .Category "5_9"}}selected{{end}}>Live Action - English-translated</option>
<option value="5_10" {{if eq .Category "5_10"}}selected{{end}}>Live Action - Idol/Promotional Video</option>
<option value="5_18" {{if eq .Category "5_18"}}selected{{end}}>Live Action - Non-English-translated</option>
<option value="5_11" {{if eq .Category "5_11"}}selected{{end}}>Live Action - Raw</option>
<option value="6_15" {{if eq .Category "6_15"}}selected{{end}}>Pictures - Graphics</option>
<option value="6_16" {{if eq .Category "6_16"}}selected{{end}}>Pictures - Photos</option>
<option value="1_1" {{if eq .Category "1_1"}}selected{{end}}>Software - Applications</option>
<option value="1_2" {{if eq .Category "1_2"}}selected{{end}}>Software - Games</option>
<option value="3_12" {{if eq .Category "3_12"}}selected{{end}}>{{T "anime_amv"}}</option>
<option value="3_5" {{if eq .Category "3_5"}}selected{{end}}>{{T "anime_english_translated"}}</option>
<option value="3_13" {{if eq .Category "3_13"}}selected{{end}}>{{T "anime_non_english_translated"}}</option>
<option value="3_6" {{if eq .Category "3_6"}}selected{{end}}>{{T "anime_raw"}}</option>
<option value="2_3" {{if eq .Category "2_3"}}selected{{end}}>{{T "audio_lossless"}}</option>
<option value="2_4" {{if eq .Category "2_4"}}selected{{end}}>{{T "audio_lossy"}}</option>
<option value="4_7" {{if eq .Category "4_7"}}selected{{end}}>{{T "literature_english_translated"}}</option>
<option value="4_8" {{if eq .Category "4_8"}}selected{{end}}>{{T "literature_raw"}}</option>
<option value="4_14" {{if eq .Category "4_14"}}selected{{end}}>{{T "literature_non_english_translated"}}</option>
<option value="5_9" {{if eq .Category "5_9"}}selected{{end}}>{{T "live_action_english_translated"}}</option>
<option value="5_10" {{if eq .Category "5_10"}}selected{{end}}>{{T "live_action_idol_pv"}}</option>
<option value="5_18" {{if eq .Category "5_18"}}selected{{end}}>{{T "live_action_non_english_translated"}}</option>
<option value="5_11" {{if eq .Category "5_11"}}selected{{end}}>{{T "live_action_raw"}}</option>
<option value="6_15" {{if eq .Category "6_15"}}selected{{end}}>{{T "pictures_graphics"}}</option>
<option value="6_16" {{if eq .Category "6_16"}}selected{{end}}>{{T "pictures_photos"}}</option>
<option value="1_1" {{if eq .Category "1_1"}}selected{{end}}>{{T "software_applications"}}</option>
<option value="1_2" {{if eq .Category "1_2"}}selected{{end}}>{{T "software_games"}}</option>
</select>
</div>
<div class="form-group">
<label for="desc">Torrent Description</label>
<p class="help-block">A limited set of HTML is allowed in the description, make sure to use <span style="font-family:monospace">&lt;br/&gt;</span>.</p>
<label for="desc">{{T "torrent_description"}}</label>
<p class="help-block">{{T "limited_html_set_is_allowed_use"}} <span style="font-family:monospace">&lt;br/&gt;</span>.</p>
<textarea name="desc" class="form-control" rows="10">{{.Description}}</textarea>
</div>
{{block "captcha" .}}{{end}}
<button type="submit" class="btn btn-success">Upload</button>
<button type="submit" class="btn btn-success">{{T "upload"}}</button>
<br />
<br />
</form>

Voir le fichier

@ -8,26 +8,26 @@
<tr {{if eq .Status 2}}class="remake"{{end}}
{{if eq .Status 3}}class="trusted"{{end}}
{{if eq .Status 4}}class="aplus"{{end}}>
<td>Name</td>
<td>{{T "name"}}</td>
<td>
{{.Name}}
<img style="float:right" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .Sub_Category) }}">
</td>
</tr>
<tr>
<td>Hash</td>
<td>{{T "hash"}}</td>
<td class="torrent-hash">{{.Hash}}</td>
</tr>
<tr>
<td>Date</td>
<td>{{T "date"}}</td>
<td class="date-full">{{.Date}}</td>
</tr>
<tr>
<td>Size</td>
<td>{{T "size"}}</td>
<td>{{.Filesize}}</td>
</tr>
<tr>
<td>Links</td>
<td>{{T "links"}}</td>
<td>
<a aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-success download-btn">
<span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> Download!
@ -39,12 +39,12 @@
</td>
</tr>
<tr>
<td>Description</td>
<td>{{T "description"}}</td>
<td>{{.Description}}</td>
</tr>
<tr style="height:2em"> <td></td><td></td> </tr>
<tr>
<td>Comments</td>
<td>{{T "comments"}}</td>
<td></td>
</tr>
{{ range $index, $element := .Comments }}
@ -60,13 +60,14 @@
{{end}}
<form method="post">
<div class="form-group">
<label for="comment">Submit a Comment as {{ if gt .User.Id 0}} {{.User.Username}} {{else}} Anonymous {{end}}</label>
{{/* There should be a better way to use translation on this... */}}
<label for="comment">{{ if gt .User.Id 0}} {{T "submit_a_comment_as_username" .User.Username}} {{else}} {{T "submit_a_comment_as_anonymous"}} {{end}}</label>
<textarea name="comment" class="form-control" rows="5"></textarea>
</div>
{{with .Captcha}}
{{block "captcha" .}}{{end}}
{{end}}
<input type="submit" value="Submit">
<input type="submit" value="{{T "submit"}}">
</form>
</div>
{{end}}