tl-split: tl.js

This commit is contained in:
ed 2025-10-12 22:28:45 +00:00
parent 02ba9ea7ec
commit ff01723c6d

View file

@ -1,98 +1,37 @@
"use strict"; "use strict";
// NOTE: please use tabs for indenting, not spaces :-)
// NOTE: since you are using the tl.js straight from the repo, you'll // the three-letter name of the language you're translating to;
// need to find/replace all "eng" with your own three-letter name // please adjust this (and the "Ls.hmn" further down)
var my_lang = "hmn";
// the three-letter name of the language you're translating to
var my_lang = "eng";
// and because we don't know these yet... ////////////////////////////////////////////////////////////////////////
var SR='', wah=''; // please ignore the next 5 lines:
var Ls={}, SR='', wah='';
// this function is automatically called when the page is loaded:
function langmod() { function langmod() {
if (window.LANGN)
// which page is the javascript currently running on? LANGN.push([my_lang, Ls[my_lang].tt]);
// look for some well-known elements to figure it out:
if (QS("h1#cc") && QS("a#k")) {
// we are running in the control-panel
Ls[my_lang] = tl_cpanel[my_lang];
}
else if (ebi("op_cfg")) {
// we are running in the filebrowser
Ls[my_lang] = tl_browser[my_lang];
// inform the settings tab that a new lang is available
LANGS.push(my_lang);
}
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// alright,
// below this point is where the actual translation happens; // below this point is where the actual translation happens;
// here is the pairs of "text-identifier": "text-to-translate" // here is the pairs of "text-identifier": "text-to-translate"
//
// the three-letter language-code "hmn" and language-name "Hymmnos"
//////////////////////////////////////////////////////////////////////// // is used as an example; please replace these with your language
// translation of splash.js (the control-panel); //
// you do not need to translate the TLNotes, those are just for you :-) // you do not need to translate the TLNotes, those are just for you :-)
//
var tl_cpanel = { // when you are happy with this translation and want to submit it,
"eng": { // copy the text below into a new file in the translations folder;
"a1": "refresh", // https://github.com/9001/copyparty/tree/hovudstraum/copyparty/web/tl
"b1": "howdy stranger &nbsp; <small>(you're not logged in)</small>",
"c1": "logout",
"d1": "dump stack", // TLNote: "d2" is the tooltip for this button
"d2": "shows the state of all active threads",
"e1": "reload cfg",
"e2": "reload config files (accounts/volumes/volflags),$Nand rescan all e2ds volumes$N$Nnote: any changes to global settings$Nrequire a full restart to take effect",
"f1": "you can browse:",
"g1": "you can upload to:",
"cc1": "other stuff:",
"h1": "disable k304", // TLNote: "j1" explains what k304 is
"i1": "enable k304",
"j1": "enabling k304 will disconnect your client on every HTTP 304, which can prevent some buggy proxies from getting stuck (suddenly not loading pages), <em>but</em> it will also make things slower in general",
"k1": "reset client settings",
"l1": "login for more:",
"m1": "welcome back,", // TLNote: "welcome back, USERNAME"
"n1": "404 not found &nbsp;┐( ´ -`)┌",
"o1": 'or maybe you don\'t have access -- try a password or <a href="' + SR + '/?h">go home</a>',
"p1": "403 forbiddena &nbsp;~┻━┻",
"q1": 'use a password or <a href="' + SR + '/?h">go home</a>',
"r1": "go home",
".s1": "rescan",
"t1": "action", // TLNote: this is the header above the "rescan" buttons
"u2": "time since the last server write$N( upload / rename / ... )$N$N17d = 17 days$N1h23 = 1 hour 23 minutes$N4m56 = 4 minutes 56 seconds",
"v1": "connect",
"v2": "use this server as a local HDD",
"w1": "switch to https",
"x1": "change password",
"y1": "edit shares", // TLNote: shows the list of folders that the user has decided to share
"z1": "unlock this share:", // TLNote: the password prompt to see a hidden share
"ta1": "fill in your new password first",
"ta2": "repeat to confirm new password:",
"ta3": "found a typo; please try again",
"aa1": "incoming files:",
"ab1": "disable no304",
"ac1": "enable no304",
"ad1": "enabling no304 will disable all caching; try this if k304 wasn't enough. This will waste a huge amount of network traffic!",
"ae1": "active downloads:",
"af1": "show recent uploads",
"ag1": "view idp cache",
},
};
//////////////////////////////////////////////////////////////////////// Ls.hmn = {
// translation of browser.js (the filebrowser): "tt": "Hymmnos",
var tl_browser = {
"eng": {
"tt": "English",
"cols": { "cols": {
"c": "action buttons", "c": "action buttons",
@ -111,7 +50,7 @@ var tl_browser = {
"resw": "horizontal resolution", "resw": "horizontal resolution",
"resh": "vertical resolution", "resh": "vertical resolution",
"chs": "audio channels", "chs": "audio channels",
"hz": "sample rate" "hz": "sample rate",
}, },
"hks": [ "hks": [
@ -199,6 +138,7 @@ var tl_browser = {
"gou": 'parent folder">up', "gou": 'parent folder">up',
"gon": 'next folder">next', "gon": 'next folder">next',
"logout": "Logout ", "logout": "Logout ",
"login": "Login",
"access": " access", "access": " access",
"ot_close": "close submenu", "ot_close": "close submenu",
"ot_search": "search for files by attributes, path / name, music tags, or any combination of those$N$N&lt;code&gt;foo bar&lt;/code&gt; = must contain both «foo» and «bar»,$N&lt;code&gt;foo -bar&lt;/code&gt; = must contain «foo» but not «bar»,$N&lt;code&gt;^yana .opus$&lt;/code&gt; = start with «yana» and be an «opus» file$N&lt;code&gt;&quot;try unite&quot;&lt;/code&gt; = contain exactly «try unite»$N$Nthe date format is iso-8601, like$N&lt;code&gt;2009-12-31&lt;/code&gt; or &lt;code&gt;2020-09-12 23:30:00&lt;/code&gt;", "ot_search": "search for files by attributes, path / name, music tags, or any combination of those$N$N&lt;code&gt;foo bar&lt;/code&gt; = must contain both «foo» and «bar»,$N&lt;code&gt;foo -bar&lt;/code&gt; = must contain «foo» but not «bar»,$N&lt;code&gt;^yana .opus$&lt;/code&gt; = start with «yana» and be an «opus» file$N&lt;code&gt;&quot;try unite&quot;&lt;/code&gt; = contain exactly «try unite»$N$Nthe date format is iso-8601, like$N&lt;code&gt;2009-12-31&lt;/code&gt; or &lt;code&gt;2020-09-12 23:30:00&lt;/code&gt;",
@ -293,6 +233,7 @@ var tl_browser = {
"u_nav_b": '<a href="#" id="modal-ok">Files</a><a href="#" id="modal-ng">One folder</a>', "u_nav_b": '<a href="#" id="modal-ok">Files</a><a href="#" id="modal-ng">One folder</a>',
"cl_opts": "switches", "cl_opts": "switches",
"cl_hfsz": "filesize",
"cl_themes": "theme", "cl_themes": "theme",
"cl_langs": "language", "cl_langs": "language",
"cl_ziptype": "folder download", "cl_ziptype": "folder download",
@ -385,9 +326,9 @@ var tl_browser = {
"mt_mloop": "loop the open folder\">🔁 loop", "mt_mloop": "loop the open folder\">🔁 loop",
"mt_mnext": "load the next folder and continue\">📂 next", "mt_mnext": "load the next folder and continue\">📂 next",
"mt_mstop": "stop playback\">⏸ stop", "mt_mstop": "stop playback\">⏸ stop",
"mt_cflac": "convert flac / wav to opus\">flac", "mt_cflac": "convert flac / wav to {0}\">flac",
"mt_caac": "convert aac / m4a to opus\">aac", "mt_caac": "convert aac / m4a to {0}\">aac",
"mt_coth": "convert all others (not mp3) to opus\">oth", "mt_coth": "convert all others (not mp3) to {0}\">oth",
"mt_c2opus": "best choice for desktops, laptops, android\">opus", "mt_c2opus": "best choice for desktops, laptops, android\">opus",
"mt_c2owa": "opus-weba, for iOS 17.5 and newer\">owa", "mt_c2owa": "opus-weba, for iOS 17.5 and newer\">owa",
"mt_c2caf": "opus-caf, for iOS 11 through 17\">caf", "mt_c2caf": "opus-caf, for iOS 11 through 17\">caf",
@ -512,6 +453,7 @@ var tl_browser = {
"fcp_ok": "copy OK", "fcp_ok": "copy OK",
"fp_busy": "moving {0} items...\n\n{1}", "fp_busy": "moving {0} items...\n\n{1}",
"fcp_busy": "copying {0} items...\n\n{1}", "fcp_busy": "copying {0} items...\n\n{1}",
"fp_abrt": "aborting...",
"fp_err": "move failed:\n", "fp_err": "move failed:\n",
"fcp_err": "copy failed:\n", "fcp_err": "copy failed:\n",
"fp_confirm": "move these {0} items here?", "fp_confirm": "move these {0} items here?",
@ -719,6 +661,46 @@ var tl_browser = {
"ur_sm": "Finished;\n{0} files found on server,\n{1} files NOT found on server", "ur_sm": "Finished;\n{0} files found on server,\n{1} files NOT found on server",
"lang_set": "refresh to make the change take effect?", "lang_set": "refresh to make the change take effect?",
},
};
"splash": {
"a1": "refresh",
"b1": "howdy stranger &nbsp; <small>(you're not logged in)</small>",
"c1": "logout",
"d1": "dump stack", // TLNote: "d2" is the tooltip for this button
"d2": "shows the state of all active threads",
"e1": "reload cfg",
"e2": "reload config files (accounts/volumes/volflags),$Nand rescan all e2ds volumes$N$Nnote: any changes to global settings$Nrequire a full restart to take effect",
"f1": "you can browse:",
"g1": "you can upload to:",
"cc1": "other stuff:",
"h1": "disable k304", // TLNote: "j1" explains what k304 is
"i1": "enable k304",
"j1": "enabling k304 will disconnect your client on every HTTP 304, which can prevent some buggy proxies from getting stuck (suddenly not loading pages), <em>but</em> it will also make things slower in general",
"k1": "reset client settings",
"l1": "login for more:",
"m1": "welcome back,", // TLNote: "welcome back, USERNAME"
"n1": "404 not found &nbsp;┐( ´ -`)┌",
"o1": 'or maybe you don\'t have access -- try a password or <a href="' + SR + '/?h">go home</a>',
"p1": "403 forbiddena &nbsp;~┻━┻",
"q1": 'use a password or <a href="' + SR + '/?h">go home</a>',
"r1": "go home",
".s1": "rescan",
"t1": "action", // TLNote: this is the header above the "rescan" buttons
"u2": "time since the last server write$N( upload / rename / ... )$N$N17d = 17 days$N1h23 = 1 hour 23 minutes$N4m56 = 4 minutes 56 seconds",
"v1": "connect",
"v2": "use this server as a local HDD",
"w1": "switch to https",
"x1": "change password",
"y1": "edit shares", // TLNote: shows the list of folders that the user has decided to share
"z1": "unlock this share:", // TLNote: the password prompt to see a hidden share
"ta1": "fill in your new password first",
"ta2": "repeat to confirm new password:",
"ta3": "found a typo; please try again",
"aa1": "incoming files:",
"ab1": "disable no304",
"ac1": "enable no304",
"ad1": "enabling no304 will disable all caching; try this if k304 wasn't enough. This will waste a huge amount of network traffic!",
"ae1": "active downloads:",
"af1": "show recent uploads",
}
};