finished translations
This commit is contained in:
parent
00c105db28
commit
3fb4920ab0
10 changed files with 126 additions and 29 deletions
|
@ -25,16 +25,16 @@
|
||||||
<a href="https://github.com/MathMan05/JankClient" class="TitleButtons">
|
<a href="https://github.com/MathMan05/JankClient" class="TitleButtons">
|
||||||
Github
|
Github
|
||||||
</a>
|
</a>
|
||||||
<a href="/channels/@me" class="TitleButtons">
|
<a href="/channels/@me" class="TitleButtons" id="openClient">
|
||||||
Open Client
|
Open Client
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="homePage">
|
<div id="homePage">
|
||||||
|
|
||||||
<h1 class="pagehead">Welcome to Jank Client</h1>
|
<h1 class="pagehead" id="welcomeJank">Welcome to Jank Client</h1>
|
||||||
<div class="pagebox">
|
<div class="pagebox">
|
||||||
<p>Jank Client is a Spacebar-compatible client seeking to be as good as it can be with many features including:</p>
|
<p id="box1title">Jank Client is a Spacebar-compatible client seeking to be as good as it can be with many features including:</p>
|
||||||
<ul>
|
<ul id="box1Items">
|
||||||
<li>Direct Messaging</li>
|
<li>Direct Messaging</li>
|
||||||
<li>Reactions support</li>
|
<li>Reactions support</li>
|
||||||
<li>Invites</li>
|
<li>Invites</li>
|
||||||
|
@ -42,17 +42,17 @@
|
||||||
<li>User settings</li>
|
<li>User settings</li>
|
||||||
<li>Developer portal</li>
|
<li>Developer portal</li>
|
||||||
<li>Bot invites</li>
|
<li>Bot invites</li>
|
||||||
|
<li>Translation support</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagebox">
|
<div class="pagebox">
|
||||||
<h2>Spacebar-Compatible Instances:</h2>
|
<h2 id="compatableInstances">Spacebar-Compatible Instances:</h2>
|
||||||
<div id="instancebox">
|
<div id="instancebox">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagebox">
|
<div class="pagebox">
|
||||||
<h2>Contribute to Jank Client</h2>
|
<h2 id="box3title">Contribute to Jank Client</h2>
|
||||||
<p>We always appreciate some help, whether that be in the form of bug reports, or code, or even just pointing out
|
<p id="box3description">We always appreciate some help, whether that be in the form of bug reports, code, help translate, or even just pointing out some typos.</p><br>
|
||||||
some typos.</p><br>
|
|
||||||
<a href="https://github.com/MathMan05/JankClient" class="TitleButtons">
|
<a href="https://github.com/MathMan05/JankClient" class="TitleButtons">
|
||||||
Github
|
Github
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -3,6 +3,36 @@ import{ mobile }from"./login.js";
|
||||||
console.log(mobile);
|
console.log(mobile);
|
||||||
const serverbox = document.getElementById("instancebox") as HTMLDivElement;
|
const serverbox = document.getElementById("instancebox") as HTMLDivElement;
|
||||||
|
|
||||||
|
(async ()=>{
|
||||||
|
await I18n.done;
|
||||||
|
const openClient=document.getElementById("openClient")
|
||||||
|
const welcomeJank=document.getElementById("welcomeJank")
|
||||||
|
const box1title=document.getElementById("box1title")
|
||||||
|
const box1Items=document.getElementById("box1Items")
|
||||||
|
const compatableInstances=document.getElementById("compatableInstances")
|
||||||
|
const box3title=document.getElementById("box3title")
|
||||||
|
const box3description=document.getElementById("box3description")
|
||||||
|
if(openClient&&welcomeJank&&compatableInstances&&box3title&&box3description&&box1title&&box1Items){
|
||||||
|
openClient.textContent=I18n.getTranslation("htmlPages.openClient");
|
||||||
|
welcomeJank.textContent=I18n.getTranslation("htmlPages.welcomeJank");
|
||||||
|
box1title.textContent=I18n.getTranslation("htmlPages.box1title");
|
||||||
|
|
||||||
|
compatableInstances.textContent=I18n.getTranslation("htmlPages.compatableInstances");
|
||||||
|
box3title.textContent=I18n.getTranslation("htmlPages.box3title");
|
||||||
|
box3description.textContent=I18n.getTranslation("htmlPages.box3description");
|
||||||
|
|
||||||
|
const items=I18n.getTranslation("htmlPages.box1Items").split("|");
|
||||||
|
let i=0;
|
||||||
|
//@ts-ignore ts is being dumb here
|
||||||
|
for(const item of box1Items.children){
|
||||||
|
(item as HTMLElement).textContent=items[i];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.error(openClient,welcomeJank,compatableInstances,box3title,box3description,box1title,box1Items)
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
fetch("/instances.json")
|
fetch("/instances.json")
|
||||||
.then(_=>_.json())
|
.then(_=>_.json())
|
||||||
.then(
|
.then(
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<div id="loading" class="loading">
|
<div id="loading" class="loading">
|
||||||
<div class="centeritem">
|
<div class="centeritem">
|
||||||
<img src="/logo.svg" style="width:3in;height:3in;">
|
<img src="/logo.svg" style="width:3in;height:3in;">
|
||||||
<h1>Jank Client is loading</h1>
|
<h1 id="loadingText">Jank Client is loading</h1>
|
||||||
<h2 id="load-desc">This shouldn't take long</h2>
|
<h2 id="load-desc">This shouldn't take long</h2>
|
||||||
<h1 id="switchaccounts">Switch Accounts</h1>
|
<h1 id="switchaccounts">Switch Accounts</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,7 +20,17 @@ import { I18n } from "./i18n.js";
|
||||||
window.location.href = "/login.html";
|
window.location.href = "/login.html";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
const loadingText=document.getElementById("loadingText");
|
||||||
|
const loaddesc=document.getElementById("load-desc");
|
||||||
|
const switchaccounts=document.getElementById("switchaccounts");
|
||||||
|
if(loadingText&&loaddesc&&switchaccounts){
|
||||||
|
loadingText.textContent=I18n.getTranslation("htmlPages.loadingText");
|
||||||
|
loaddesc.textContent=I18n.getTranslation("htmlPages.loaddesc");
|
||||||
|
switchaccounts.textContent=I18n.getTranslation("htmlPages.switchaccounts");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
I18n
|
||||||
function showAccountSwitcher(): void{
|
function showAccountSwitcher(): void{
|
||||||
const table = document.createElement("div");
|
const table = document.createElement("div");
|
||||||
table.classList.add("flexttb","accountSwitcher");
|
table.classList.add("flexttb","accountSwitcher");
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div id="logindiv">
|
<div id="logindiv">
|
||||||
<h1>Login</h1>
|
<h1>Login</h1>
|
||||||
<form id="form" submit="check(e)">
|
<form id="form" submit="check(e)">
|
||||||
<label for="instance"><b>Instance:</b></label>
|
<label for="instance" id="instanceField"><b>Instance:</b></label>
|
||||||
<p id="verify"></p>
|
<p id="verify"></p>
|
||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
|
|
||||||
<label for="uname"><b>Email:</b></label>
|
<label for="uname" id="emailField"><b>Email:</b></label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Enter email address"
|
placeholder="Enter email address"
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
|
|
||||||
<label for="psw"><b>Password:</b></label>
|
<label for="psw" id="pwField"><b>Password:</b></label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="Enter Password"
|
placeholder="Enter Password"
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
<p class="wrongred" id="wrong"></p>
|
<p class="wrongred" id="wrong"></p>
|
||||||
|
|
||||||
<div id="h-captcha"></div>
|
<div id="h-captcha"></div>
|
||||||
<button type="submit">Login</button>
|
<button type="submit" id="loginButton">Login</button>
|
||||||
</form>
|
</form>
|
||||||
<a href="/register.html" id="switch">Don't have an account?</a>
|
<a href="/register.html" id="switch">Don't have an account?</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,6 +32,21 @@ login?: string;
|
||||||
}[]
|
}[]
|
||||||
| null;
|
| null;
|
||||||
|
|
||||||
|
(async ()=>{
|
||||||
|
await I18n.done
|
||||||
|
const instanceField=document.getElementById("instanceField");
|
||||||
|
const emailField= document.getElementById("emailField");
|
||||||
|
const pwField= document.getElementById("pwField");
|
||||||
|
const loginButton=document.getElementById("loginButton");
|
||||||
|
const noAccount=document.getElementById("switch")
|
||||||
|
if(instanceField&&emailField&&pwField&&loginButton&&noAccount){
|
||||||
|
instanceField.textContent=I18n.getTranslation("htmlPages.instanceField");
|
||||||
|
emailField.textContent=I18n.getTranslation("htmlPages.emailField");
|
||||||
|
pwField.textContent=I18n.getTranslation("htmlPages.pwField");
|
||||||
|
loginButton.textContent=I18n.getTranslation("htmlPages.loginButton");
|
||||||
|
noAccount.textContent=I18n.getTranslation("htmlPages.noAccount");
|
||||||
|
}
|
||||||
|
})()
|
||||||
setTheme();
|
setTheme();
|
||||||
function getBulkUsers(){
|
function getBulkUsers(){
|
||||||
const json = getBulkInfo();
|
const json = getBulkInfo();
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { I18n } from "../i18n.js";
|
||||||
import{ getBulkUsers, Specialuser, getapiurls }from"../login.js";
|
import{ getBulkUsers, Specialuser, getapiurls }from"../login.js";
|
||||||
import { Permissions } from "../permissions.js";
|
import { Permissions } from "../permissions.js";
|
||||||
type botjsonfetch={
|
type botjsonfetch={
|
||||||
|
@ -86,7 +87,7 @@ type botjsonfetch={
|
||||||
if(!joinable.length){
|
if(!joinable.length){
|
||||||
document.getElementById("AcceptInvite")!.textContent = "Create an account to invite the bot";
|
document.getElementById("AcceptInvite")!.textContent = "Create an account to invite the bot";
|
||||||
}
|
}
|
||||||
|
await I18n.done;
|
||||||
function showGuilds(user:Specialuser){
|
function showGuilds(user:Specialuser){
|
||||||
if(!urls) return;
|
if(!urls) return;
|
||||||
fetch(urls.api+"/oauth2/authorize/"+window.location.search,{
|
fetch(urls.api+"/oauth2/authorize/"+window.location.search,{
|
||||||
|
@ -230,6 +231,7 @@ type botjsonfetch={
|
||||||
const perms=document.getElementById("permissions") as HTMLDivElement;
|
const perms=document.getElementById("permissions") as HTMLDivElement;
|
||||||
|
|
||||||
if(perms&&permstr){
|
if(perms&&permstr){
|
||||||
|
perms.children[0].textContent=I18n.getTranslation("htmlPages.idpermissions")
|
||||||
const permisions=new Permissions(permstr)
|
const permisions=new Permissions(permstr)
|
||||||
for(const perm of Permissions.info()){
|
for(const perm of Permissions.info()){
|
||||||
if(permisions.hasPermission(perm.name,false)){
|
if(permisions.hasPermission(perm.name,false)){
|
||||||
|
@ -243,7 +245,9 @@ type botjsonfetch={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
document
|
const AcceptInvite=document.getElementById("AcceptInvite");
|
||||||
.getElementById("AcceptInvite")!
|
if(AcceptInvite){
|
||||||
.addEventListener("click", showAccounts);
|
AcceptInvite.addEventListener("click", showAccounts);
|
||||||
|
AcceptInvite.textContent=I18n.getTranslation("htmlPages.addBot")
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -17,31 +17,31 @@
|
||||||
<h1>Create an account</h1>
|
<h1>Create an account</h1>
|
||||||
<form id="register" submit="registertry(e)">
|
<form id="register" submit="registertry(e)">
|
||||||
<div>
|
<div>
|
||||||
<label for="instance"><b>Instance:</b></label>
|
<label for="instance" id="instanceField"><b>Instance:</b></label>
|
||||||
<p id="verify"></p>
|
<p id="verify"></p>
|
||||||
<input type="search" list="instances" placeholder="Instance URL" id="instancein" name="instance" value="" required>
|
<input type="search" list="instances" placeholder="Instance URL" id="instancein" name="instance" value="" required>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="uname"><b>Email:</b></label>
|
<label for="uname" id="emailField"><b>Email:</b></label>
|
||||||
<input type="text" placeholder="Enter Email" name="uname" id="uname" required>
|
<input type="text" placeholder="Enter Email" name="uname" id="uname" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="uname"><b>Username:</b></label>
|
<label for="uname" id="userField"><b>Username:</b></label>
|
||||||
<input type="text" placeholder="Enter Username" name="username" id="username" required>
|
<input type="text" placeholder="Enter Username" name="username" id="username" required>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="psw"><b>Password:</b></label>
|
<label for="psw" id="pwField"><b>Password:</b></label>
|
||||||
<input type="password" placeholder="Enter Password" name="psw" id="psw" required>
|
<input type="password" placeholder="Enter Password" name="psw" id="psw" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="psw2"><b>Enter password again:</b></label>
|
<label for="psw2" id="pw2Field"><b>Enter password again:</b></label>
|
||||||
<input type="password" placeholder="Enter Password Again" name="psw2" id="psw2" required>
|
<input type="password" placeholder="Enter Password Again" name="psw2" id="psw2" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="date"><b>Date of birth:</b></label>
|
<label for="date" id="dobField"><b>Date of birth:</b></label>
|
||||||
<input type="date" id="date" name="date">
|
<input type="date" id="date" name="date">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@
|
||||||
<div id="h-captcha">
|
<div id="h-captcha">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="dontgrow">Create account</button>
|
<button type="submit" class="dontgrow" id="createAccount">Create account</button>
|
||||||
</form>
|
</form>
|
||||||
<a href="/login.html" id="switch">Already have an account?</a>
|
<a href="/login.html" id="switch" id="alreadyHave">Already have an account?</a>
|
||||||
</div>
|
</div>
|
||||||
<datalist id="instances"></datalist>
|
<datalist id="instances"></datalist>
|
||||||
<script src="/register.js" type="module"></script>
|
<script src="/register.js" type="module"></script>
|
||||||
|
|
|
@ -6,7 +6,21 @@ const registerElement = document.getElementById("register");
|
||||||
if(registerElement){
|
if(registerElement){
|
||||||
registerElement.addEventListener("submit", registertry);
|
registerElement.addEventListener("submit", registertry);
|
||||||
}
|
}
|
||||||
|
(async ()=>{
|
||||||
|
await I18n.done;
|
||||||
|
const userField=document.getElementById("userField");
|
||||||
|
const pw2Field=document.getElementById("pw2Field");
|
||||||
|
const dobField=document.getElementById("dobField");
|
||||||
|
const createAccount=document.getElementById("createAccount");
|
||||||
|
const alreadyHave=document.getElementById("alreadyHave");
|
||||||
|
if(userField&&pw2Field&&alreadyHave&&createAccount&&dobField){
|
||||||
|
userField.textContent=I18n.getTranslation("htmlPages.userField")
|
||||||
|
pw2Field.textContent=I18n.getTranslation("htmlPages.pw2Field")
|
||||||
|
dobField.textContent=I18n.getTranslation("htmlPages.dobField")
|
||||||
|
createAccount.textContent=I18n.getTranslation("htmlPages.createAccount")
|
||||||
|
alreadyHave.textContent=I18n.getTranslation("htmlPages.alreadyHave")
|
||||||
|
}
|
||||||
|
})()
|
||||||
async function registertry(e: Event){
|
async function registertry(e: Event){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const elements = (e.target as HTMLFormElement)
|
const elements = (e.target as HTMLFormElement)
|
||||||
|
|
|
@ -161,6 +161,30 @@
|
||||||
"uptimeStats":"Uptime: \n All time: $1\nThis week: $2\nToday: $3",
|
"uptimeStats":"Uptime: \n All time: $1\nThis week: $2\nToday: $3",
|
||||||
"warnOffiline":"Instance is offline, can't connect"
|
"warnOffiline":"Instance is offline, can't connect"
|
||||||
},
|
},
|
||||||
|
"htmlPages":{
|
||||||
|
"idpermissions":"This will allow the bot to:",
|
||||||
|
"addBot":"Add to server",
|
||||||
|
"loadingText":"Jank Client is loading",
|
||||||
|
"loaddesc":"This shouldn't take long",
|
||||||
|
"switchaccounts":"Switch Accounts",
|
||||||
|
"instanceField":"Instance:",
|
||||||
|
"emailField":"Email:",
|
||||||
|
"pwField":"Password:",
|
||||||
|
"loginButton":"Login",
|
||||||
|
"noAccount":"Don't have an account?",
|
||||||
|
"userField":"Username:",
|
||||||
|
"pw2Field":"Enter password again:",
|
||||||
|
"dobField":"Date of birth:",
|
||||||
|
"createAccount":"Create account",
|
||||||
|
"alreadyHave":"Already have an account?",
|
||||||
|
"openClient":"Open Client",
|
||||||
|
"welcomeJank":"Welcome to Jank Client",
|
||||||
|
"box1title":"Jank Client is a Spacebar-compatible client seeking to be as good as it can be with many features including:",
|
||||||
|
"box1Items":"Direct Messaging|Reactions support|Invites|Account switching|User settings|Developer portal|Bot invites|Translation support",
|
||||||
|
"compatableInstances":"Spacebar-Compatible Instances:",
|
||||||
|
"box3title":"Contribute to Jank Client",
|
||||||
|
"box3description":"We always appreciate some help, whether that be in the form of bug reports, or code, or even just pointing out some typos."
|
||||||
|
},
|
||||||
"register":{
|
"register":{
|
||||||
"passwordError:":"Password: $1",
|
"passwordError:":"Password: $1",
|
||||||
"usernameError":"Username: $1",
|
"usernameError":"Username: $1",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue