mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
messagewebview: remove jed.js and provide i18n strings for chatview
Change-Id: Ica3e4af26e8e62d7fec1b58959a8604f90ac627c
This commit is contained in:
parent
e7f24d01c8
commit
e53534b499
3 changed files with 72 additions and 11 deletions
|
@ -78,7 +78,6 @@
|
||||||
<file alias="chatview.css">../lrc/src/web-chatview/chatview.css</file>
|
<file alias="chatview.css">../lrc/src/web-chatview/chatview.css</file>
|
||||||
<file alias="chatview.html">../lrc/src/web-chatview/chatview.html</file>
|
<file alias="chatview.html">../lrc/src/web-chatview/chatview.html</file>
|
||||||
<file alias="chatview.js">../lrc/src/web-chatview/chatview.js</file>
|
<file alias="chatview.js">../lrc/src/web-chatview/chatview.js</file>
|
||||||
<file alias="jed.js">../lrc/src/web-chatview/jed.js</file>
|
|
||||||
<file alias="linkify.js">../lrc/src/web-chatview/linkify.js</file>
|
<file alias="linkify.js">../lrc/src/web-chatview/linkify.js</file>
|
||||||
<file alias="linkify-html.js">../lrc/src/web-chatview/linkify-html.js</file>
|
<file alias="linkify-html.js">../lrc/src/web-chatview/linkify-html.js</file>
|
||||||
<file alias="linkify-string.js">../lrc/src/web-chatview/linkify-string.js</file>
|
<file alias="linkify-string.js">../lrc/src/web-chatview/linkify-string.js</file>
|
||||||
|
|
|
@ -387,4 +387,35 @@ Item {
|
||||||
// Generic dialog options
|
// Generic dialog options
|
||||||
property string optionOk: qsTr("Ok")
|
property string optionOk: qsTr("Ok")
|
||||||
property string optionCancel: qsTr("Cancel")
|
property string optionCancel: qsTr("Cancel")
|
||||||
|
|
||||||
|
// ChatView
|
||||||
|
property string backButtonTitle: qsTr("Hide chat view")
|
||||||
|
property string placeCallButtonTitle: qsTr("Place video call")
|
||||||
|
property string placeAudioCallButtonTitle: qsTr("Place audio call")
|
||||||
|
property string addToConversationsButtonTitle: qsTr("Add to conversations")
|
||||||
|
property string unbanButtonTitle: qsTr("Unban contact")
|
||||||
|
property string sendButtonTitle: qsTr("Send")
|
||||||
|
property string optionsButtonTitle: qsTr("Options")
|
||||||
|
property string backToBottomBtnInnerHTML: qsTr("Jump to latest")
|
||||||
|
property string sendFileButtonTitle: qsTr("Send file")
|
||||||
|
property string videoRecordButtonTitle: qsTr("Leave video message")
|
||||||
|
property string audioRecordButtonTitle: qsTr("Leave audio message")
|
||||||
|
property string acceptButtonTitle: qsTr("Accept")
|
||||||
|
property string refuseButtonTitle: qsTr("Refuse")
|
||||||
|
property string blockButtonTitle: qsTr("Block")
|
||||||
|
property string messageBarInputPlaceholder: qsTr("Type a message")
|
||||||
|
property string placeHolderTemporaryContact: qsTr("Note: an interaction will create a new contact.")
|
||||||
|
property string isNotInYourContacts: qsTr("is not in your contacts")
|
||||||
|
property string automaticallyAcceptInvitation: qsTr("Note: you can automatically accept this invitation by sending a message.")
|
||||||
|
property string daysAgo: qsTr("days ago")
|
||||||
|
property string dayAgo: qsTr("day ago")
|
||||||
|
property string hoursAgo: qsTr("hours ago")
|
||||||
|
property string hourAgo: qsTr("hour ago")
|
||||||
|
property string minutesAgo: qsTr("minutes ago")
|
||||||
|
property string justNow: qsTr("just now")
|
||||||
|
property string failureString: qsTr("Failure")
|
||||||
|
property string acceptString: qsTr("Accept")
|
||||||
|
property string refuseString: qsTr("Refuse")
|
||||||
|
property string deleteString: qsTr("Delete")
|
||||||
|
property string retryString: qsTr("Retry")
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,11 +108,9 @@ Rectangle {
|
||||||
QtObject {
|
QtObject {
|
||||||
id: jsBridgeObject
|
id: jsBridgeObject
|
||||||
|
|
||||||
|
|
||||||
// ID, under which this object will be known at chatview.js side.
|
// ID, under which this object will be known at chatview.js side.
|
||||||
WebChannel.id: "jsbridge"
|
WebChannel.id: "jsbridge"
|
||||||
|
|
||||||
|
|
||||||
// Functions that are exposed, return code can be derived from js side
|
// Functions that are exposed, return code can be derived from js side
|
||||||
// by setting callback function.
|
// by setting callback function.
|
||||||
function deleteInteraction(arg) {
|
function deleteInteraction(arg) {
|
||||||
|
@ -193,6 +191,40 @@ Rectangle {
|
||||||
function onComposing(isComposing) {
|
function onComposing(isComposing) {
|
||||||
MessagesAdapter.onComposing(isComposing)
|
MessagesAdapter.onComposing(isComposing)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseI18nData() {
|
||||||
|
return {
|
||||||
|
["backButtonTitle"] : JamiStrings.backButtonTitle,
|
||||||
|
["placeCallButtonTitle"] : JamiStrings.placeCallButtonTitle,
|
||||||
|
["placeAudioCallButtonTitle"] : JamiStrings.placeAudioCallButtonTitle,
|
||||||
|
["addToConversationsButtonTitle"] : JamiStrings.addToConversationsButtonTitle,
|
||||||
|
["unbanButtonTitle"] : JamiStrings.unbanButtonTitle,
|
||||||
|
["sendButtonTitle"] : JamiStrings.sendButtonTitle,
|
||||||
|
["optionsButtonTitle"] : JamiStrings.optionsButtonTitle,
|
||||||
|
["backToBottomBtnInnerHTML"] : JamiStrings.backToBottomBtnInnerHTML,
|
||||||
|
["sendFileButtonTitle"] : JamiStrings.sendFileButtonTitle,
|
||||||
|
["videoRecordButtonTitle"] : JamiStrings.videoRecordButtonTitle,
|
||||||
|
["audioRecordButtonTitle"] : JamiStrings.audioRecordButtonTitle,
|
||||||
|
["acceptButtonTitle"] : JamiStrings.acceptButtonTitle,
|
||||||
|
["refuseButtonTitle"] : JamiStrings.refuseButtonTitle,
|
||||||
|
["blockButtonTitle"] : JamiStrings.blockButtonTitle,
|
||||||
|
["messageBarInputPlaceholder"] : JamiStrings.messageBarInputPlaceholder,
|
||||||
|
["placeHolderTemporaryContact"] : JamiStrings.placeHolderTemporaryContact,
|
||||||
|
["isNotInYourContacts"] : JamiStrings.isNotInYourContacts,
|
||||||
|
["automaticallyAcceptInvitation"] : JamiStrings.automaticallyAcceptInvitation,
|
||||||
|
["daysAgo"] : JamiStrings.daysAgo,
|
||||||
|
["dayAgo"] : JamiStrings.dayAgo,
|
||||||
|
["hoursAgo"] : JamiStrings.hoursAgo,
|
||||||
|
["hourAgo"] : JamiStrings.hourAgo,
|
||||||
|
["minutesAgo"] : JamiStrings.minutesAgo,
|
||||||
|
["justNow"] : JamiStrings.justNow,
|
||||||
|
["failureString"] : JamiStrings.failureString,
|
||||||
|
["acceptString"] : JamiStrings.acceptString,
|
||||||
|
["refuseString"] : JamiStrings.refuseString,
|
||||||
|
["deleteString"] : JamiStrings.deleteString,
|
||||||
|
["retryString"] : JamiStrings.retryString
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebEngineView {
|
WebEngineView {
|
||||||
|
@ -245,9 +277,6 @@ Rectangle {
|
||||||
"chatwin",
|
"chatwin",
|
||||||
UtilsAdapter.qStringFromFile(
|
UtilsAdapter.qStringFromFile(
|
||||||
":/chatview-windows.css")))
|
":/chatview-windows.css")))
|
||||||
|
|
||||||
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
|
||||||
":/jed.js"))
|
|
||||||
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
||||||
":/linkify.js"))
|
":/linkify.js"))
|
||||||
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
||||||
|
@ -256,11 +285,13 @@ Rectangle {
|
||||||
":/linkify-string.js"))
|
":/linkify-string.js"))
|
||||||
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
||||||
":/qwebchannel.js"))
|
":/qwebchannel.js"))
|
||||||
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
messageWebView.runJavaScript(
|
||||||
":/chatview.js"),
|
UtilsAdapter.qStringFromFile(":/chatview.js"),
|
||||||
function(){jsLoaded = true})
|
function() {
|
||||||
messageWebView.runJavaScript("init_i18n();")
|
messageWebView.runJavaScript("init_i18n();")
|
||||||
messageWebView.runJavaScript("displayNavbar(false);")
|
messageWebView.runJavaScript("displayNavbar(false);")
|
||||||
|
jsLoaded = true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue