diff --git a/src/webpage/contextmenu.ts b/src/webpage/contextmenu.ts index 5cfa017..8d6eac3 100644 --- a/src/webpage/contextmenu.ts +++ b/src/webpage/contextmenu.ts @@ -38,7 +38,7 @@ class Contextmenu{ return{}; } addsubmenu( - text: string, + text: string|(()=>string), onclick: (this: x, arg: y, e: MouseEvent) => void, img = null, shown: (this: x, arg: y) => boolean = _=>true, diff --git a/src/webpage/guild.ts b/src/webpage/guild.ts index dd6091d..73cf47a 100644 --- a/src/webpage/guild.ts +++ b/src/webpage/guild.ts @@ -302,7 +302,7 @@ class Guild extends SnowFlake{ [ "button", "", - I18n.getTranslation("yesLeave"), + I18n.getTranslation("guild.yesLeave"), (_: any)=>{ this.leave().then(_=>{ full.hide(); @@ -312,7 +312,7 @@ class Guild extends SnowFlake{ [ "button", "", - I18n.getTranslation("noLeave"), + I18n.getTranslation("guild.noLeave"), (_: any)=>{ full.hide(); }, @@ -473,7 +473,7 @@ class Guild extends SnowFlake{ ], [ "textbox", - I18n.getTranslation("serverName"), + I18n.getTranslation("guild.serverName"), "", function(this: HTMLInputElement){ confirmname = this.value; @@ -484,7 +484,7 @@ class Guild extends SnowFlake{ [ "button", "", - I18n.getTranslation("yesDelete"), + I18n.getTranslation("guild.yesDelete"), (_: any)=>{ console.log(confirmname); if(confirmname !== this.properties.name){ @@ -498,7 +498,7 @@ class Guild extends SnowFlake{ [ "button", "", - I18n.getTranslation("noDelete"), + I18n.getTranslation("guild.noDelete"), (_: any)=>{ full.hide(); }, diff --git a/src/webpage/i18n.ts b/src/webpage/i18n.ts index 162086c..e960b16 100644 --- a/src/webpage/i18n.ts +++ b/src/webpage/i18n.ts @@ -106,7 +106,7 @@ class I18n{ } } static options(){ - return ["en","ru"] + return ["en","ru","tr"] } static setLanguage(lang:string){ if(this.options().indexOf(userLocale)!==-1){ diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index 20b9fd3..acbf011 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -1474,7 +1474,7 @@ class Localuser{ genSecurity(); } { - const connections = settings.addButton("Connections"); + const connections = settings.addButton(I18n.getTranslation("localuser.connections")); const connectionContainer = document.createElement("div"); connectionContainer.id = "connection-container"; diff --git a/src/webpage/message.ts b/src/webpage/message.ts index c961d36..555c705 100644 --- a/src/webpage/message.ts +++ b/src/webpage/message.ts @@ -66,7 +66,7 @@ class Message extends SnowFlake{ navigator.clipboard.writeText(this.id); }); Message.contextmenu.addsubmenu( - "Add reaction", + ()=>I18n.getTranslation("message.reactionAdd"), function(this: Message, _, e: MouseEvent){ Emoji.emojiPicker(e.x, e.y, this.localuser).then(_=>{ this.reactionToggle(_); @@ -74,7 +74,7 @@ class Message extends SnowFlake{ } ); Message.contextmenu.addbutton( - "Edit", + ()=>I18n.getTranslation("message.delete"), function(this: Message){ this.setEdit(); }, diff --git a/translations/en.json b/translations/en.json index a216491..fa35eb1 100644 --- a/translations/en.json +++ b/translations/en.json @@ -304,7 +304,12 @@ "noToken":"Don't know token so can't save it to localStorage, sorry", "advancedBot":"Advanced Bot Settings", "botInviteCreate":"Bot Invite Creator", - "language":"Language:" + "language":"Language:", + "connections":"Connections" + }, + "message":{ + "reactionAdd":"Add reaction", + "delete":"Delete message" }, "instanceStats":{ "name":"Instance stats: $1", @@ -371,6 +376,6 @@ "retrying":"Retrying...", "unableToConnect":"Unable to connect to the Spacebar server. Please try logging out and back in." }, - "ru": "/translations/ru.json" + "ru": "/translations/ru.json", "tr": "/translations/tr.json" } diff --git a/translations/tr.json b/translations/tr.json index fc59494..6422ad9 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -370,5 +370,5 @@ "errorReconnect": "Sunucuya bağlanılamadı, **$1** saniye içinde yeniden denenecek...", "retrying": "Yeniden deneniyor...", "unableToConnect": "Spacebar sunucusuna bağlanılamıyor. Lütfen çıkış yapıp tekrar deneyin." - }, + } }