Commit 83c45642 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

chatview: set button titles using jed(i18n)

Change-Id: I8c4dc7458dc8a2fb1fe9d30edac4437c3f2fbc69
parent 97da6447
...@@ -116,47 +116,24 @@ function init_i18n(data) { ...@@ -116,47 +116,24 @@ function init_i18n(data) {
} }
function set_titles() { function set_titles() {
if (use_qt) { backButton.title = i18n.gettext("Hide chat view")
backButton.title = "Hide chat view" placeCallButton.title = i18n.gettext("Place video call")
placeCallButton.title = "Place video call" placeAudioCallButton.title = i18n.gettext("Place audio call")
placeAudioCallButton.title = "Place audio call" addToConversationsButton.title = i18n.gettext("Add to conversations")
addToConversationsButton.title = "Add to conversations" unbanButton.title = i18n.gettext("Unban contact")
unbanButton.title = "Unban contact" sendButton.title = i18n.gettext("Send")
sendButton.title = "Send" optionsButton.title = i18n.gettext("Options")
optionsButton.title = "Options" backToBottomBtn.innerHTML = `${i18n.gettext("Jump to latest")} ▼`
backToBottomBtn.innerHTML = "'Jump to latest' ▼" sendFileButton.title = i18n.gettext("Send file")
sendFileButton.title = "Send file" videoRecordButton.title = i18n.gettext("Leave video message")
videoRecordButton.title = "Leave video message" audioRecordButton.title = i18n.gettext("Leave audio message")
audioRecordButton.title = "Leave audio message" acceptButton.title = i18n.gettext("Accept")
acceptButton.title = "Accept" refuseButton.title = i18n.gettext("Refuse")
refuseButton.title = "Refuse" blockButton.title = i18n.gettext("Block")
blockButton.title = "Block"
} else {
backButton.title = i18n.gettext("Hide chat view")
placeCallButton.title = i18n.gettext("Place video call")
placeAudioCallButton.title = i18n.gettext("Place audio call")
addToConversationsButton.title = i18n.gettext("Add to conversations")
unbanButton.title = i18n.gettext("Unban contact")
sendButton.title = i18n.gettext("Send")
optionsButton.title = i18n.gettext("Options")
backToBottomBtn.innerHTML = `${i18n.gettext("Jump to latest")} ▼`
sendFileButton.title = i18n.gettext("Send file")
videoRecordButton.title = i18n.gettext("Leave video message")
audioRecordButton.title = i18n.gettext("Leave audio message")
acceptButton.title = i18n.gettext("Accept")
refuseButton.title = i18n.gettext("Refuse")
blockButton.title = i18n.gettext("Block")
}
} }
function reset_message_bar_input() { function reset_message_bar_input() {
if (use_qt) { messageBarInput.placeholder = i18n.gettext("Type a message")
messageBarInput.placeholder = "Type a message"
}
else {
messageBarInput.placeholder = i18n.gettext("Type a message")
}
} }
function onScrolled_() { function onScrolled_() {
...@@ -281,12 +258,7 @@ function update_chatview_frame(accountEnabled, banned, temporary, alias, bestid) ...@@ -281,12 +258,7 @@ function update_chatview_frame(accountEnabled, banned, temporary, alias, bestid)
isTemporary = temporary isTemporary = temporary
if (temporary) { if (temporary) {
addToConvButton.style.display = "flex" addToConvButton.style.display = "flex"
if (use_qt) { messageBarInput.placeholder = i18n.gettext("Note: an interaction will create a new contact.")
messageBarInput.placeholder = "Note: an interaction will create a new contact."
}
else {
messageBarInput.placeholder = i18n.gettext("Note: an interaction will create a new contact.")
}
} else { } else {
addToConvButton.style.display = "" addToConvButton.style.display = ""
reset_message_bar_input() reset_message_bar_input()
...@@ -320,19 +292,16 @@ function showInvitation(contactAlias, contactId) { ...@@ -320,19 +292,16 @@ function showInvitation(contactAlias, contactId) {
if (!inviteImage.classList.contains(`sender_image_${contactId}`)) { if (!inviteImage.classList.contains(`sender_image_${contactId}`)) {
inviteImage.classList.add(`sender_image_${contactId}`) inviteImage.classList.add(`sender_image_${contactId}`)
} }
invitationText.innerHTML = "<span id='invite_contact_name'>" + contactAlias + "</span> is not in your contacts<br/>"
+ "Note: you can automatically accept this invitation by sending a message."
invitation.style.visibility = "visible"
} else { } else {
const className = `sender_image_${contactId}`.replace(/@/g, "_").replace(/\./g, "_") const className = `sender_image_${contactId}`.replace(/@/g, "_").replace(/\./g, "_")
if (!inviteImage.classList.contains(className)) { if (!inviteImage.classList.contains(className)) {
inviteImage.classList.add(className) inviteImage.classList.add(className)
} }
invitationText.innerHTML = "<b>"
+ i18n.sprintf(i18n.gettext("%s is not in your contacts"), contactAlias)
+ "</b><br/>"
+ i18n.gettext("Note: you can automatically accept this invitation by sending a message.")
} }
invitationText.innerHTML = "<b>"
+ i18n.sprintf(i18n.gettext("%s is not in your contacts"), contactAlias)
+ "</b><br/>"
+ i18n.gettext("Note: you can automatically accept this invitation by sending a message.")
hasInvitation = true hasInvitation = true
invitation.style.visibility = "visible" invitation.style.visibility = "visible"
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment