diff --git a/qml/components/PollPreview.qml b/qml/components/PollPreview.qml index fbb3171..c4261e2 100644 --- a/qml/components/PollPreview.qml +++ b/qml/components/PollPreview.qml @@ -80,6 +80,7 @@ Item { visible: text !== "" text: Emoji.emojify(pollData.question, Theme.fontSizeSmall) wrapMode: Text.WrapAtWordBoundaryOrAnywhere + textFormat: Text.StyledText color: pollMessageComponent.isOwnMessage ? Theme.highlightColor : Theme.primaryColor } @@ -102,10 +103,11 @@ Item { id: canAnswerDelegate TextSwitch { id: optionDelegate + // TextSwitch changes the html base path: + property url emojiBase: "../js/emoji/" width: pollMessageComponent.width automaticCheck: false - // emojify does not work here :/ - text: modelData.text + text: Emoji.emojify(modelData.text, Theme.fontSizeMedium, emojiBase) checked: pollMessageComponent.chosenIndexes.indexOf(index) > -1 onClicked: { pollMessageComponent.handleChoose(index); @@ -151,6 +153,7 @@ Item { Label { id: displayOptionLabel text: Emoji.emojify(modelData.text, Theme.fontSizeMedium) + textFormat: Text.StyledText wrapMode: Text.WrapAtWordBoundaryOrAnywhere anchors { @@ -263,6 +266,7 @@ Item { Component { id: closePollMenuItemComponent MenuItem { + visible: !pollData.is_closed && pollMessageComponent.canEdit text: qsTr("Close Poll") onClicked: { tdLibWrapper.stopPoll(pollMessageComponent.chatId, pollMessageComponent.messageId); @@ -272,6 +276,7 @@ Item { Component { id: resetAnswerMenuItemComponent MenuItem { + visible: !pollData.is_closed && !pollMessageComponent.isQuiz && pollMessageComponent.hasAnswered text: qsTr("Reset Answer") onClicked: { pollMessageComponent.resetChosen() @@ -282,12 +287,8 @@ Item { Component.onCompleted: { opacity = 1; if(messageItem && messageItem.menu ) { // workaround to add menu entries - if(!pollData.is_closed && pollMessageComponent.canEdit) { - closePollMenuItemComponent.createObject(messageItem.menu._contentColumn); - } - if(!pollData.is_closed && !pollMessageComponent.isQuiz && pollMessageComponent.hasAnswered) { - resetAnswerMenuItemComponent.createObject(messageItem.menu._contentColumn); - } + closePollMenuItemComponent.createObject(messageItem.menu._contentColumn); + resetAnswerMenuItemComponent.createObject(messageItem.menu._contentColumn); } } } diff --git a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml index 7077a61..d078191 100644 --- a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml +++ b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml @@ -79,18 +79,18 @@ ChatInformationTabItemBase { width: parent.width // chat title isPrivateChat ? () : - primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize) + primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize, "../../js/emoji/") // last user prologSecondaryText.text: "@"+(user.username !== "" ? user.username : user_id) + (user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "") secondaryText { horizontalAlignment: Text.AlignRight property string statusText: Functions.getChatMemberStatusText(model.status["@type"]) - property string customText: model.status.custom_title ? Emoji.emojify(model.status.custom_title, secondaryText.font.pixelSize) : "" + property string customText: model.status.custom_title ? Emoji.emojify(model.status.custom_title, secondaryText.font.pixelSize, "../../js/emoji/") : "" text: (statusText !== "" && customText !== "") ? statusText + ", " + customText : statusText + customText } tertiaryText { maximumLineCount: 1 - text: user.type["@type"] === "userTypeBot" ? (Emoji.emojify("🤖 "+bot_info.description, tertiaryText.font.pixelSize)) : Functions.getChatPartnerStatusText(user.status["@type"], user.status.was_online); + text: user.type["@type"] === "userTypeBot" ? (Emoji.emojify("🤖 "+bot_info.description, tertiaryText.font.pixelSize, "../../js/emoji/")) : Functions.getChatPartnerStatusText(user.status["@type"], user.status.was_online); elide: Text.ElideRight } @@ -162,7 +162,7 @@ ChatInformationTabItemBase { onChatChanged: { if (changedChatId === chat_id) { // Force update of some list item elements (currently only last message text seems to create problems). dataChanged() doesn't seem to trigger them all :( - secondaryText.text = last_message_text ? Emoji.emojify(last_message_text, Theme.fontSizeExtraSmall) : qsTr("Unknown") + secondaryText.text = last_message_text ? Emoji.emojify(last_message_text, Theme.fontSizeExtraSmall, "../../js/emoji/") : qsTr("Unknown") } } } diff --git a/qml/components/chatInformationPage/ChatInformationTextItem.qml b/qml/components/chatInformationPage/ChatInformationTextItem.qml index 4cffc6e..edb52bb 100644 --- a/qml/components/chatInformationPage/ChatInformationTextItem.qml +++ b/qml/components/chatInformationPage/ChatInformationTextItem.qml @@ -50,7 +50,7 @@ Column { font.pixelSize: Theme.fontSizeExtraSmall textFormat: Text.StyledText color: Theme.highlightColor - text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "
"), Theme.fontSizeExtraSmall).replace(/\.\.\/js/g, "../../js") + text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "
"), Theme.fontSizeExtraSmall, "../../js/emoji/") linkColor: Theme.primaryColor visible: text !== "" onLinkActivated: { diff --git a/qml/js/functions.js b/qml/js/functions.js index b62ffb9..fbd193e 100644 --- a/qml/js/functions.js +++ b/qml/js/functions.js @@ -98,16 +98,16 @@ function getMessageText(message, simple, myself) { return myself ? qsTr("changed the chat title to %1", "myself").arg(message.content.title) : qsTr("changed the chat title to %1").arg(message.content.title); } if (message.content['@type'] === 'messagePoll') { - if(message.content.poll.type['@type'] === "pollTypeQuiz") { - if(message.content.poll.is_anonymous) { - return myself ? qsTr("sent an anonymous quiz", "myself") : qsTr("sent an anonymous quiz"); + if (message.content.poll.type['@type'] === "pollTypeQuiz") { + if (message.content.poll.is_anonymous) { + return simple ? (myself ? qsTr("sent an anonymous quiz", "myself") : qsTr("sent an anonymous quiz")) : ("" + qsTr("Anonymous Quiz") + ""); } - return myself ? qsTr("sent a quiz", "myself") : qsTr("sent a quiz"); + return simple ? (myself ? qsTr("sent a quiz", "myself") : qsTr("sent a quiz")) : ("" + qsTr("Quiz") + ""); } - if(message.content.poll.is_anonymous) { - return myself ? qsTr("sent an anonymous poll", "myself") : qsTr("sent an anonymous poll"); + if (message.content.poll.is_anonymous) { + return simple ? (myself ? qsTr("sent an anonymous poll", "myself") : qsTr("sent an anonymous poll")) : ("" + qsTr("Anonymous Poll") + ""); } - return myself ? qsTr("sent a poll", "myself") : qsTr("sent a poll"); + return simple ? (myself ? qsTr("sent a poll", "myself") : qsTr("sent a poll")) : ("" + qsTr("Poll") + ""); } return qsTr("Unsupported message: %1").arg(message.content['@type'].substring(7)); } diff --git a/qml/js/twemoji.js b/qml/js/twemoji.js index abfce8f..446931a 100644 --- a/qml/js/twemoji.js +++ b/qml/js/twemoji.js @@ -568,8 +568,8 @@ var twemoji = (function ( }()); -function emojify(rawText, emojiSize) { - var curatedText = twemoji.parse(rawText, { callback: function(icon, options, variant) { return '../js/emoji/' + icon + '.svg'; }, size: emojiSize }); +function emojify(rawText, emojiSize, basePath) { + var curatedText = twemoji.parse(rawText, { callback: function(icon, options, variant) { return (basePath || '../js/emoji/') + icon + '.svg'; }, size: emojiSize }); // QML has a weird bug. If an ampersand is followed by an HTML tag or a character, the tag is ignored and returned as string or the following string is omitted // Therefore replacing the ampersand with & in these cases... return curatedText.replace(/((\&[\w\d]+\;)|((\&)(\<|\w+)))/g, function(match, p1, p2, p3, p4, p5, offset, string) { diff --git a/qml/pages/ChatInformationPage.qml b/qml/pages/ChatInformationPage.qml index 79e3376..0bbe1e1 100644 --- a/qml/pages/ChatInformationPage.qml +++ b/qml/pages/ChatInformationPage.qml @@ -265,8 +265,10 @@ Page { : "../components/chatInformationPage/ChatInformationProfilePicture.qml" } } + // PageHeader changes the html base path: + property url emojiBase: "../js/emoji/" leftMargin: imageContainer.minDimension + Theme.horizontalPageMargin + Theme.paddingMedium - title: chatInformation.title !== "" ? Emoji.emojify(chatInformation.title, Theme.fontSizeLarge) : qsTr("Unknown") + title: chatInformation.title !== "" ? Emoji.emojify(chatInformation.title, Theme.fontSizeLarge, emojiBase) : qsTr("Unknown") description: chatInformationPage.isPrivateChat ? ("@"+(chatInformationPage.privateChatUserInformation.username || chatInformationPage.chatPartnerGroupId)) : "" } diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index eaae40c..88e665b 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1190,5 +1190,21 @@ sent an anonymous poll hat eine anonyme Umfrage gesendet + + Anonymous Quiz + Anonymes Quiz + + + Quiz + Quiz + + + Anonymous Poll + Anonyme Umfrage + + + Poll + Umfrage + diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 2843445..abf9faa 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -545,20 +545,20 @@ sent a poll myself - + envió una encuesta sent a poll - + envió una encuesta sent a quiz myself - + envió un cuestionario sent a quiz - + envió un cuestionario @@ -707,83 +707,83 @@ PollCreationPage All answers have to contain 1-100 characters. - + Todas las respuestas deben contener de 1 a 100 caracteres. To send a quiz, you have to specify the right answer. - + Para enviar una cuestión, debe especificar la respuesta correcta. You have to enter a question. - + Introducir una pregunta. The question has to be shorter than 256 characters. - + La pregunta debe tener menos de 256 caracteres. A poll requires 2-10 answers. - + Una encuesta requiere de 2 a 10 respuestas. Create a Poll Dialog Header - + Encuesta in %1 After dialog header… Create a Poll in [group name] - + en %1 Enter your question here - + Introducir su pregunta aquí Question (%n1 characters left) - - + + Pregunta (quedan %n1 caracteres) Answers Section header - + Respuestas Enter an answer here - + Introducir una respuesta aquí Answer (%n1 characters left) - - + + Respuesta (quedan %n1 caracteres) Add an answer - + Agregar una respuesta Poll Options Section header - + Opciones de encuesta Anonymous answers - + Respuestas anónimas Multiple answers allowed - + Se permiten múltiples respuestas Quiz Mode - + Modo interrogar Quizzes have one correct answer. Participants can't revoke their responses. - + Los interrogatorios tienen una respuesta correcta. Los participantes no pueden revocar sus respuestas. @@ -791,81 +791,81 @@ %L1% % of votes for option - + %L1% Final Result: - + Resultado final: Multiple Answers are allowed. - + Se permiten múltiples respuestas. %L1 vote(s) total number of total votes - - + + %L1 votos totales Close Poll - + Cerrar encuesta Reset Answer - + Restablecer respuesta PollResultsPage Quiz Results - + Resultados de cuestionario Poll Results - + Resultados de encuesta %L1 vote(s) total number of total votes - - + + %L1 total de votos Question section header - + Pregunta Results section header - + Resultados %L1 vote(s) number of votes for option - - + + %L1 votos %L1% % of votes for option - + %L1% Chosen by: This answer has been chosen by the following users - + Elegido por: %L1 vote(s) including yours number of votes for option - - + + %L1 votos incluyendo el suyo @@ -1151,37 +1151,53 @@ sent a poll myself - + envió una encuesta sent a poll - + envió una encuesta sent an anonymous quiz myself - + envió un cuestionario anónimo sent an anonymous quiz - + envió un cuestionario anónimo sent a quiz myself - + envió un cuestionario sent a quiz - + envió un cuestionario sent an anonymous poll myself - + envió una encuesta anónima sent an anonymous poll + envió una encuesta anónima + + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index c7dfa43..081cfa2 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1191,5 +1191,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 42c4433..7116eeb 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1184,5 +1184,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index 73aa1d1..794a756 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -111,7 +111,7 @@ The Invite Link has been copied to the clipboard. - Il link d'invito è stato copiato nella clipboard + Il link d'invito è stato copiato nella clipboard. %1 members, %2 online @@ -142,7 +142,7 @@ There is no information text available, yet. - Attualmente non è disponibile nessuna informazione + Attualmente non è disponibile nessuna informazione. Chat Title @@ -261,10 +261,6 @@ You Tu - - Loading messages… - Carica messaggi… - Unmute Chat Riattiva suoni chat @@ -289,10 +285,6 @@ Delete Message Cancella messaggio - - Uploading… - Carica… - Forwarded Message Messaggio inoltrato @@ -301,6 +293,14 @@ This chat is empty. Questa chat è vuota. + + Loading messages... + Carica messaggi... + + + Uploading... + Carica... + CoverPage @@ -317,8 +317,20 @@ in - Waiting for network… - Attendo la rete… + Connected + Connesso + + + chat + chat + + + chats + chat + + + Waiting for network... + Attendo la rete... Connecting to network… @@ -329,20 +341,8 @@ Connetto al proxy… - Connected - Connesso - - - Updating content… - Aggiorna contenuti… - - - chat - chat - - - chats - chat + Updating content... + Aggiorna contenuti... @@ -605,10 +605,6 @@ Please enter the code that you received: Inserisci il codice che hai ricevuto: - - Loading… - Carica… - Unable to authenticate you with the entered code. Autenticazione non riuscita con il codice inserito. @@ -645,6 +641,10 @@ Use the international format, e.g. %1 Utilizza il formato internazionale, es. %1 + + Loading... + Carica... + LocationPreview @@ -671,8 +671,20 @@ Fernschreiber - Waiting for network… - Attendo la rete… + Unknown + Sconosciuto + + + Settings + Impostazioni + + + You don't have any chats yet. + Non hai nessuna chat. + + + Waiting for network... + Attendo la rete... Connecting to network… @@ -687,20 +699,8 @@ Aggiorna contenuti… - Unknown - Sconosciuto - - - Loading chat list… - Carica lista chat… - - - Settings - Impostazioni - - - You don't have any chats yet. - Non hai nessuna chat. + Loading chat list... + Carica lista chat... @@ -801,7 +801,7 @@ Multiple Answers are allowed. - Risposte multiple consentite + Risposte multiple consentite. %L1 vote(s) total @@ -1190,5 +1190,21 @@ sent an anonymous poll ha inviato un sondaggio anonimo + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 0ad2981..289adc5 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1196,5 +1196,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 69bf463..47be5ba 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1196,5 +1196,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index fbed347..90b83f4 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -545,20 +545,20 @@ sent a quiz myself - + skickade en frågesport sent a quiz - + skickade en frågesport sent a poll myself - + skickade en omröstning sent a poll - + skickade en omröstning @@ -707,172 +707,172 @@ PollCreationPage You have to enter a question. - + Du måste ange en fråga. The question has to be shorter than 256 characters. - + Frågan måste vara kortare än 256 tecken. A poll requires 2-10 answers. - + En omröstning kräver 2-10 svarsalternativ. All answers have to contain 1-100 characters. - + Alla svarsalternativ måste innehålla 1-100 tecken. To send a quiz, you have to specify the right answer. - + För att skicka en frågesport, måste du ange rätt svar. Create a Poll Dialog Header - + Skapa en omröstning in %1 After dialog header… Create a Poll in [group name] - + i %1 Enter your question here - + Ange din fråga här Question (%n1 characters left) - - - + + Fråga (%n1 tecken kvar) + Fråga (%n1 tecken kvar) Answers Section header - + Svar Enter an answer here - + Ange svaret här Answer (%n1 characters left) - - - + + Svar (%n1 tecken kvar) + Svar (%n1 tecken kvar) Add an answer - + Lägg till ett svar Poll Options Section header - + Omröstningsalternativ Anonymous answers - + Anonyma svar Multiple answers allowed - + Flera svarsalternativ tillåtna Quiz Mode - + Frågesportsläge Quizzes have one correct answer. Participants can't revoke their responses. - + Frågor har ett korrekt svar. Deltagarna kan inte återkalla sina svar. PollPreview Final Result: - + Slutresultat: Multiple Answers are allowed. - + Flera svarsalternativ tillåtna. %L1% % of votes for option - + %L1% %L1 vote(s) total number of total votes - - - + + %L1 röst sammanlagt + %L1 röster sammanlagt Close Poll - + Stäng omröstningen Reset Answer - + Återställ svar PollResultsPage Quiz Results - + Frågesportresultat Poll Results - + Omröstningsresultat %L1 vote(s) total number of total votes - - - + + %L1 röst sammanlagt + %L1 röster sammanlagt Question section header - + Fråga Results section header - + Resultat %L1 vote(s) including yours number of votes for option - - - + + %L1 röst inklusive din + %L1 röster inklusive din %L1 vote(s) number of votes for option - - - + + %L1 röst + %L1 röster %L1% % of votes for option - + %L1% Chosen by: This answer has been chosen by the following users - + Valt av @@ -1157,37 +1157,53 @@ sent an anonymous quiz myself - + skickade en anonym frågesport sent an anonymous quiz - + skickade en anonym frågesport sent a quiz myself - + skickade en frågesport sent a quiz - + skickade en frågesport sent an anonymous poll myself - + skickade en anonym omröstning sent an anonymous poll - + skickade en anonym omröstning sent a poll myself - + skickade en omröstning sent a poll + skickade en omröstning + + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 7ef0098..7085c5f 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1184,5 +1184,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + + diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 48bfa9e..3c5dd70 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1184,5 +1184,21 @@ sent an anonymous poll + + Anonymous Quiz + + + + Quiz + + + + Anonymous Poll + + + + Poll + +