Fix concatenation of translated strings in paste mode

This commit is contained in:
schlagmichdoch 2023-09-18 20:35:50 +02:00
parent 0bae7c84bd
commit dbe3381e7d
12 changed files with 84 additions and 82 deletions

View file

@ -16,8 +16,6 @@
"dialogs": { "dialogs": {
"share": "Teilen", "share": "Teilen",
"download": "Herunterladen", "download": "Herunterladen",
"activate-paste-mode-base": "Öffne PairDrop auf anderen Geräten um",
"activate-paste-mode-and-other-files": "und {{count}} andere Dateien zu senden",
"pair-devices-title": "Geräte dauerhaft koppeln", "pair-devices-title": "Geräte dauerhaft koppeln",
"input-key-on-this-device": "Gebe diesen Schlüssel auf einem anderen Gerät ein", "input-key-on-this-device": "Gebe diesen Schlüssel auf einem anderen Gerät ein",
"enter-key-from-another-device": "Gebe den Schlüssel von einem anderen Gerät hier ein.", "enter-key-from-another-device": "Gebe den Schlüssel von einem anderen Gerät hier ein.",
@ -39,20 +37,19 @@
"receive-text-title": "Textnachricht erhalten", "receive-text-title": "Textnachricht erhalten",
"file-other-description-image-plural": "und {{count}} andere Bilder", "file-other-description-image-plural": "und {{count}} andere Bilder",
"file-other-description-file-plural": "und {{count}} andere Dateien", "file-other-description-file-plural": "und {{count}} andere Dateien",
"activate-paste-mode-activate-paste-mode-shared-text": "Freigegebener Text",
"auto-accept-instructions-1": "Aktiviere", "auto-accept-instructions-1": "Aktiviere",
"auto-accept": "auto-accept", "auto-accept": "auto-accept",
"auto-accept-instructions-2": "um automatisch alle Dateien von diesem Gerät zu akzeptieren.", "auto-accept-instructions-2": "um automatisch alle Dateien von diesem Gerät zu akzeptieren.",
"has-sent": "hat Folgendes gesendet:", "has-sent": "hat Folgendes gesendet:",
"send-message-title": "Textnachricht senden", "send-message-title": "Textnachricht senden",
"send-message-to": "Sende eine Textnachricht an", "send-message-to": "Sende eine Textnachricht an",
"base64-tap-to-paste": "Tippe hier um {{type}} einzufügen", "base64-tap-to-paste": "Hier tippen, um {{type}} einzufügen",
"base64-paste-to-send": "Füge {{type}} hier zum Versenden ein", "base64-paste-to-send": "Hier einfügen, um {{type}} zu versenden",
"base64-text": "Text", "base64-text": "Text",
"base64-files": "Dateien", "base64-files": "Dateien",
"base64-processing": "Bearbeitung läuft…", "base64-processing": "Bearbeitung läuft…",
"file-other-description-image": "und 1 anderes Bild", "file-other-description-image": "und ein anderes Bild",
"file-other-description-file": "und 1 andere Datei", "file-other-description-file": "und eine andere Datei",
"receive-title": "{{descriptor}} erhalten", "receive-title": "{{descriptor}} erhalten",
"download-again": "Erneut herunterladen", "download-again": "Erneut herunterladen",
"system-language": "Systemsprache", "system-language": "Systemsprache",
@ -127,15 +124,18 @@
"online-requirement-public-room": "Du musst online sein, um öffentliche Räume erstellen zu können." "online-requirement-public-room": "Du musst online sein, um öffentliche Räume erstellen zu können."
}, },
"instructions": { "instructions": {
"x-instructions_desktop": "Klicke zum Senden von Dateien oder klicke mit der rechten Maustaste zum Senden von Textnachrichten", "x-instructions_desktop": "Klicke, um Dateien zu Senden oder klicke mit der rechten Maustaste, um Textnachrichten zu senden",
"no-peers-title": "Öffne PairDrop auf anderen Geräten um Dateien zu senden", "no-peers-title": "Öffne PairDrop auf anderen Geräten, um Dateien zu senden",
"no-peers_data-drop-bg": "Hier ablegen, um Empfänger auszuwählen", "no-peers_data-drop-bg": "Hier ablegen, um Empfänger auszuwählen",
"no-peers-subtitle": "Kopple Geräte oder besuche einen öffentlichen Raum, damit du in anderen Netzwerken sichtbar bist", "no-peers-subtitle": "Kopple Geräte oder besuche einen öffentlichen Raum, damit du in anderen Netzwerken sichtbar bist",
"click-to-send": "Klicke zum Senden", "click-to-send": "Klicke zum Senden von",
"tap-to-send": "Tippe zum Senden", "tap-to-send": "Tippe zum Senden von",
"x-instructions_data-drop-peer": "Hier ablegen, um an Peer zu senden", "x-instructions_data-drop-peer": "Hier ablegen, um an Peer zu senden",
"x-instructions_data-drop-bg": "Loslassen um Empfänger auszuwählen", "x-instructions_data-drop-bg": "Loslassen um Empfänger auszuwählen",
"x-instructions_mobile": "Tippe zum Senden von Dateien oder tippe lange zum Senden von Nachrichten" "x-instructions_mobile": "Tippe zum Senden von Dateien oder tippe lange zum Senden von Nachrichten",
"activate-paste-mode-base": "Öffne PairDrop auf anderen Geräten zum Senden von",
"activate-paste-mode-and-other-files": "und {{count}} anderen Dateien",
"activate-paste-mode-shared-text": "freigegebenem Text"
}, },
"document-titles": { "document-titles": {
"file-transfer-requested": "Datenübertagung angefordert", "file-transfer-requested": "Datenübertagung angefordert",

View file

@ -22,7 +22,10 @@
"x-instructions_data-drop-peer": "Release to send to peer", "x-instructions_data-drop-peer": "Release to send to peer",
"x-instructions_data-drop-bg": "Release to select recipient", "x-instructions_data-drop-bg": "Release to select recipient",
"click-to-send": "Click to send", "click-to-send": "Click to send",
"tap-to-send": "Tap to send" "tap-to-send": "Tap to send",
"activate-paste-mode-base": "Open PairDrop on other devices to send",
"activate-paste-mode-and-other-files": "and {{count}} other files",
"activate-paste-mode-shared-text": "shared text"
}, },
"footer": { "footer": {
"known-as": "You are known as:", "known-as": "You are known as:",
@ -40,9 +43,6 @@
"webrtc": "if WebRTC is not available." "webrtc": "if WebRTC is not available."
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-base": "Open PairDrop on other devices to send",
"activate-paste-mode-and-other-files": "and {{count}} other files",
"activate-paste-mode-activate-paste-mode-shared-text": "shared text",
"pair-devices-title": "Pair Devices Permanently", "pair-devices-title": "Pair Devices Permanently",
"input-key-on-this-device": "Input this key on another device", "input-key-on-this-device": "Input this key on another device",
"scan-qr-code": "or scan the QR-code.", "scan-qr-code": "or scan the QR-code.",

View file

@ -30,7 +30,10 @@
"no-peers-title": "Åpne PairDrop på andre enheter for å sende filer", "no-peers-title": "Åpne PairDrop på andre enheter for å sende filer",
"no-peers-subtitle": "Sammenkoble enheter for å kunne oppdages på andre nettverk", "no-peers-subtitle": "Sammenkoble enheter for å kunne oppdages på andre nettverk",
"x-instructions_data-drop-peer": "Slipp for å sende til likemann", "x-instructions_data-drop-peer": "Slipp for å sende til likemann",
"tap-to-send": "Trykk for å sende" "tap-to-send": "Trykk for å sende",
"activate-paste-mode-base": "Åpne PairDrop på andre enheter for å sende",
"activate-paste-mode-and-other-files": "og {{count}} andre filer",
"activate-paste-mode-shared-text": "delt tekst"
}, },
"dialogs": { "dialogs": {
"input-key-on-this-device": "Skriv inn denne nøkkelen på en annen enhet", "input-key-on-this-device": "Skriv inn denne nøkkelen på en annen enhet",
@ -70,10 +73,7 @@
"file-other-description-file": "og én annen fil", "file-other-description-file": "og én annen fil",
"title-image": "Bilde", "title-image": "Bilde",
"title-file": "Fil", "title-file": "Fil",
"title-image-plural": "Bilder", "title-image-plural": "Bilder"
"activate-paste-mode-base": "Åpne PairDrop på andre enheter for å sende",
"activate-paste-mode-and-other-files": "og {{count}} andre filer",
"activate-paste-mode-activate-paste-mode-shared-text": "delt tekst"
}, },
"about": { "about": {
"close-about_aria-label": "Lukk «Om PairDrop»", "close-about_aria-label": "Lukk «Om PairDrop»",

View file

@ -22,7 +22,10 @@
"x-instructions_data-drop-peer": "Отпустите, чтобы послать узлу", "x-instructions_data-drop-peer": "Отпустите, чтобы послать узлу",
"x-instructions_mobile": "Прикоснитесь коротко, чтобы отправить файлы, или долго, чтобы отправить сообщение", "x-instructions_mobile": "Прикоснитесь коротко, чтобы отправить файлы, или долго, чтобы отправить сообщение",
"no-peers-title": "Откройте PairDrop на других устройствах, чтобы отправить файлы", "no-peers-title": "Откройте PairDrop на других устройствах, чтобы отправить файлы",
"no-peers-subtitle": "Сопрягите устройства или войдите в публичную комнату, чтобы вас могли обнаружить из других сетей" "no-peers-subtitle": "Сопрягите устройства или войдите в публичную комнату, чтобы вас могли обнаружить из других сетей",
"activate-paste-mode-and-other-files": "и {{count}} других файлов",
"activate-paste-mode-base": "Откройте PairDrop на других устройствах, чтобы отправить",
"activate-paste-mode-shared-text": "общий текст"
}, },
"footer": { "footer": {
"display-name_data-placeholder": "Загрузка…", "display-name_data-placeholder": "Загрузка…",
@ -40,9 +43,6 @@
"on-this-network_title": "Вы можете быть обнаружены кем угодно в этой сети." "on-this-network_title": "Вы можете быть обнаружены кем угодно в этой сети."
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-and-other-files": "и {{count}} других файлов",
"activate-paste-mode-base": "Откройте PairDrop на других устройствах, чтобы отправить",
"activate-paste-mode-activate-paste-mode-shared-text": "общий текст",
"edit-paired-devices-title": "Редактировать сопряженные устройства", "edit-paired-devices-title": "Редактировать сопряженные устройства",
"auto-accept": "автоприем", "auto-accept": "автоприем",
"close": "Закрыть", "close": "Закрыть",

View file

@ -22,7 +22,10 @@
"x-instructions_mobile": "轻触以发送文件 或 长按来发送信息", "x-instructions_mobile": "轻触以发送文件 或 长按来发送信息",
"x-instructions_data-drop-bg": "释放来选择接收者", "x-instructions_data-drop-bg": "释放来选择接收者",
"click-to-send": "点击发送", "click-to-send": "点击发送",
"tap-to-send": "轻触发送" "tap-to-send": "轻触发送",
"activate-paste-mode-base": "在其他设备上打开 PairDrop 来发送",
"activate-paste-mode-and-other-files": "和 {{count}} 个其他的文件",
"activate-paste-mode-shared-text": "分享文本"
}, },
"footer": { "footer": {
"routed": "途径服务器", "routed": "途径服务器",
@ -40,9 +43,6 @@
"on-this-network_title": "您可以被这个网络上的每个人发现。" "on-this-network_title": "您可以被这个网络上的每个人发现。"
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-base": "在其他设备上打开 PairDrop 来发送",
"activate-paste-mode-and-other-files": "和 {{count}} 个其他的文件",
"activate-paste-mode-activate-paste-mode-shared-text": "分享文本",
"pair-devices-title": "配对新设备(常驻)", "pair-devices-title": "配对新设备(常驻)",
"input-key-on-this-device": "在另一个设备上输入这串数字", "input-key-on-this-device": "在另一个设备上输入这串数字",
"base64-text": "信息", "base64-text": "信息",

View file

@ -259,27 +259,28 @@ class PeersUI {
_activatePasteMode(files, text) { _activatePasteMode(files, text) {
if (!window.pasteMode.activated && (files.length > 0 || text.length > 0)) { if (!window.pasteMode.activated && (files.length > 0 || text.length > 0)) {
let descriptor; const openPairDrop = Localization.getTranslation("instructions.activate-paste-mode-base");
let noPeersMessage; const andOtherFiles = Localization.getTranslation("instructions.activate-paste-mode-and-other-files", null, {count: files.length-1});
const sharedText = Localization.getTranslation("instructions.activate-paste-mode-shared-text");
const clickToSend = Localization.getTranslation("instructions.click-to-send")
const tapToSend = Localization.getTranslation("instructions.tap-to-send")
const openPairDrop = Localization.getTranslation("dialogs.activate-paste-mode-base"); let descriptor;
const andOtherFiles = Localization.getTranslation("dialogs.activate-paste-mode-and-other-files", null, {count: files.length-1});
const sharedText = Localization.getTranslation("dialogs.activate-paste-mode-shared-text");
if (files.length === 1) { if (files.length === 1) {
noPeersMessage = `${openPairDrop}<br><i>${files[0].name}</i>`; descriptor = `<i>${files[0].name}</i>`;
} else if (files.length > 1) { } else if (files.length > 1) {
noPeersMessage = `${openPairDrop}<br><i>${files[0].name}</i> ${andOtherFiles}`; descriptor = `<i>${files[0].name}</i><br>${andOtherFiles}`;
} else { } else {
noPeersMessage = `${openPairDrop}<br>${sharedText}`; descriptor = sharedText;
} }
this.$xInstructions.querySelector('p').innerHTML = noPeersMessage; this.$xInstructions.querySelector('p').innerHTML = `<i>${descriptor}</i>`;
this.$xInstructions.querySelector('p').style.display = 'block'; this.$xInstructions.querySelector('p').style.display = 'block';
this.$xInstructions.setAttribute('desktop', Localization.getTranslation("instructions.click-to-send")); this.$xInstructions.setAttribute('desktop', clickToSend);
this.$xInstructions.setAttribute('mobile', Localization.getTranslation("instructions.tap-to-send")); this.$xInstructions.setAttribute('mobile', tapToSend);
this.$xNoPeers.querySelector('h2').innerHTML = noPeersMessage; this.$xNoPeers.querySelector('h2').innerHTML = `${openPairDrop}<br>${descriptor}`;
const _callback = (e) => this._sendClipboardData(e, files, text); const _callback = (e) => this._sendClipboardData(e, files, text);
Events.on('paste-pointerdown', _callback); Events.on('paste-pointerdown', _callback);

View file

@ -16,8 +16,6 @@
"dialogs": { "dialogs": {
"share": "Teilen", "share": "Teilen",
"download": "Herunterladen", "download": "Herunterladen",
"activate-paste-mode-base": "Öffne PairDrop auf anderen Geräten um",
"activate-paste-mode-and-other-files": "und {{count}} andere Dateien zu senden",
"pair-devices-title": "Geräte dauerhaft koppeln", "pair-devices-title": "Geräte dauerhaft koppeln",
"input-key-on-this-device": "Gebe diesen Schlüssel auf einem anderen Gerät ein", "input-key-on-this-device": "Gebe diesen Schlüssel auf einem anderen Gerät ein",
"enter-key-from-another-device": "Gebe den Schlüssel von einem anderen Gerät hier ein.", "enter-key-from-another-device": "Gebe den Schlüssel von einem anderen Gerät hier ein.",
@ -39,20 +37,19 @@
"receive-text-title": "Textnachricht erhalten", "receive-text-title": "Textnachricht erhalten",
"file-other-description-image-plural": "und {{count}} andere Bilder", "file-other-description-image-plural": "und {{count}} andere Bilder",
"file-other-description-file-plural": "und {{count}} andere Dateien", "file-other-description-file-plural": "und {{count}} andere Dateien",
"activate-paste-mode-activate-paste-mode-shared-text": "Freigegebener Text",
"auto-accept-instructions-1": "Aktiviere", "auto-accept-instructions-1": "Aktiviere",
"auto-accept": "auto-accept", "auto-accept": "auto-accept",
"auto-accept-instructions-2": "um automatisch alle Dateien von diesem Gerät zu akzeptieren.", "auto-accept-instructions-2": "um automatisch alle Dateien von diesem Gerät zu akzeptieren.",
"has-sent": "hat Folgendes gesendet:", "has-sent": "hat Folgendes gesendet:",
"send-message-title": "Textnachricht senden", "send-message-title": "Textnachricht senden",
"send-message-to": "Sende eine Textnachricht an", "send-message-to": "Sende eine Textnachricht an",
"base64-tap-to-paste": "Tippe hier um {{type}} einzufügen", "base64-tap-to-paste": "Hier tippen, um {{type}} einzufügen",
"base64-paste-to-send": "Füge {{type}} hier zum Versenden ein", "base64-paste-to-send": "Hier einfügen, um {{type}} zu versenden",
"base64-text": "Text", "base64-text": "Text",
"base64-files": "Dateien", "base64-files": "Dateien",
"base64-processing": "Bearbeitung läuft…", "base64-processing": "Bearbeitung läuft…",
"file-other-description-image": "und 1 anderes Bild", "file-other-description-image": "und ein anderes Bild",
"file-other-description-file": "und 1 andere Datei", "file-other-description-file": "und eine andere Datei",
"receive-title": "{{descriptor}} erhalten", "receive-title": "{{descriptor}} erhalten",
"download-again": "Erneut herunterladen", "download-again": "Erneut herunterladen",
"system-language": "Systemsprache", "system-language": "Systemsprache",
@ -127,15 +124,18 @@
"online-requirement-public-room": "Du musst online sein, um öffentliche Räume erstellen zu können." "online-requirement-public-room": "Du musst online sein, um öffentliche Räume erstellen zu können."
}, },
"instructions": { "instructions": {
"x-instructions_desktop": "Klicke zum Senden von Dateien oder klicke mit der rechten Maustaste zum Senden von Textnachrichten", "x-instructions_desktop": "Klicke, um Dateien zu Senden oder klicke mit der rechten Maustaste, um Textnachrichten zu senden",
"no-peers-title": "Öffne PairDrop auf anderen Geräten um Dateien zu senden", "no-peers-title": "Öffne PairDrop auf anderen Geräten, um Dateien zu senden",
"no-peers_data-drop-bg": "Hier ablegen, um Empfänger auszuwählen", "no-peers_data-drop-bg": "Hier ablegen, um Empfänger auszuwählen",
"no-peers-subtitle": "Kopple Geräte oder besuche einen öffentlichen Raum, damit du in anderen Netzwerken sichtbar bist", "no-peers-subtitle": "Kopple Geräte oder besuche einen öffentlichen Raum, damit du in anderen Netzwerken sichtbar bist",
"click-to-send": "Klicke zum Senden", "click-to-send": "Klicke zum Senden von",
"tap-to-send": "Tippe zum Senden", "tap-to-send": "Tippe zum Senden von",
"x-instructions_data-drop-peer": "Hier ablegen, um an Peer zu senden", "x-instructions_data-drop-peer": "Hier ablegen, um an Peer zu senden",
"x-instructions_data-drop-bg": "Loslassen um Empfänger auszuwählen", "x-instructions_data-drop-bg": "Loslassen um Empfänger auszuwählen",
"x-instructions_mobile": "Tippe zum Senden von Dateien oder tippe lange zum Senden von Nachrichten" "x-instructions_mobile": "Tippe zum Senden von Dateien oder tippe lange zum Senden von Nachrichten",
"activate-paste-mode-base": "Öffne PairDrop auf anderen Geräten zum Senden von",
"activate-paste-mode-and-other-files": "und {{count}} anderen Dateien",
"activate-paste-mode-shared-text": "freigegebenem Text"
}, },
"document-titles": { "document-titles": {
"file-transfer-requested": "Datenübertagung angefordert", "file-transfer-requested": "Datenübertagung angefordert",

View file

@ -22,7 +22,10 @@
"x-instructions_data-drop-peer": "Release to send to peer", "x-instructions_data-drop-peer": "Release to send to peer",
"x-instructions_data-drop-bg": "Release to select recipient", "x-instructions_data-drop-bg": "Release to select recipient",
"click-to-send": "Click to send", "click-to-send": "Click to send",
"tap-to-send": "Tap to send" "tap-to-send": "Tap to send",
"activate-paste-mode-base": "Open PairDrop on other devices to send",
"activate-paste-mode-and-other-files": "and {{count}} other files",
"activate-paste-mode-shared-text": "shared text"
}, },
"footer": { "footer": {
"known-as": "You are known as:", "known-as": "You are known as:",
@ -40,9 +43,6 @@
"webrtc": "if WebRTC is not available." "webrtc": "if WebRTC is not available."
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-base": "Open PairDrop on other devices to send",
"activate-paste-mode-and-other-files": "and {{count}} other files",
"activate-paste-mode-activate-paste-mode-shared-text": "shared text",
"pair-devices-title": "Pair Devices Permanently", "pair-devices-title": "Pair Devices Permanently",
"input-key-on-this-device": "Input this key on another device", "input-key-on-this-device": "Input this key on another device",
"scan-qr-code": "or scan the QR-code.", "scan-qr-code": "or scan the QR-code.",

View file

@ -30,7 +30,10 @@
"no-peers-title": "Åpne PairDrop på andre enheter for å sende filer", "no-peers-title": "Åpne PairDrop på andre enheter for å sende filer",
"no-peers-subtitle": "Sammenkoble enheter for å kunne oppdages på andre nettverk", "no-peers-subtitle": "Sammenkoble enheter for å kunne oppdages på andre nettverk",
"x-instructions_data-drop-peer": "Slipp for å sende til likemann", "x-instructions_data-drop-peer": "Slipp for å sende til likemann",
"tap-to-send": "Trykk for å sende" "tap-to-send": "Trykk for å sende",
"activate-paste-mode-base": "Åpne PairDrop på andre enheter for å sende",
"activate-paste-mode-and-other-files": "og {{count}} andre filer",
"activate-paste-mode-shared-text": "delt tekst"
}, },
"dialogs": { "dialogs": {
"input-key-on-this-device": "Skriv inn denne nøkkelen på en annen enhet", "input-key-on-this-device": "Skriv inn denne nøkkelen på en annen enhet",
@ -70,10 +73,7 @@
"file-other-description-file": "og én annen fil", "file-other-description-file": "og én annen fil",
"title-image": "Bilde", "title-image": "Bilde",
"title-file": "Fil", "title-file": "Fil",
"title-image-plural": "Bilder", "title-image-plural": "Bilder"
"activate-paste-mode-base": "Åpne PairDrop på andre enheter for å sende",
"activate-paste-mode-and-other-files": "og {{count}} andre filer",
"activate-paste-mode-activate-paste-mode-shared-text": "delt tekst"
}, },
"about": { "about": {
"close-about_aria-label": "Lukk «Om PairDrop»", "close-about_aria-label": "Lukk «Om PairDrop»",

View file

@ -22,7 +22,10 @@
"x-instructions_data-drop-peer": "Отпустите, чтобы послать узлу", "x-instructions_data-drop-peer": "Отпустите, чтобы послать узлу",
"x-instructions_mobile": "Прикоснитесь коротко, чтобы отправить файлы, или долго, чтобы отправить сообщение", "x-instructions_mobile": "Прикоснитесь коротко, чтобы отправить файлы, или долго, чтобы отправить сообщение",
"no-peers-title": "Откройте PairDrop на других устройствах, чтобы отправить файлы", "no-peers-title": "Откройте PairDrop на других устройствах, чтобы отправить файлы",
"no-peers-subtitle": "Сопрягите устройства или войдите в публичную комнату, чтобы вас могли обнаружить из других сетей" "no-peers-subtitle": "Сопрягите устройства или войдите в публичную комнату, чтобы вас могли обнаружить из других сетей",
"activate-paste-mode-and-other-files": "и {{count}} других файлов",
"activate-paste-mode-base": "Откройте PairDrop на других устройствах, чтобы отправить",
"activate-paste-mode-shared-text": "общий текст"
}, },
"footer": { "footer": {
"display-name_data-placeholder": "Загрузка…", "display-name_data-placeholder": "Загрузка…",
@ -40,9 +43,6 @@
"on-this-network_title": "Вы можете быть обнаружены кем угодно в этой сети." "on-this-network_title": "Вы можете быть обнаружены кем угодно в этой сети."
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-and-other-files": "и {{count}} других файлов",
"activate-paste-mode-base": "Откройте PairDrop на других устройствах, чтобы отправить",
"activate-paste-mode-activate-paste-mode-shared-text": "общий текст",
"edit-paired-devices-title": "Редактировать сопряженные устройства", "edit-paired-devices-title": "Редактировать сопряженные устройства",
"auto-accept": "автоприем", "auto-accept": "автоприем",
"close": "Закрыть", "close": "Закрыть",

View file

@ -22,7 +22,10 @@
"x-instructions_mobile": "轻触以发送文件 或 长按来发送信息", "x-instructions_mobile": "轻触以发送文件 或 长按来发送信息",
"x-instructions_data-drop-bg": "释放来选择接收者", "x-instructions_data-drop-bg": "释放来选择接收者",
"click-to-send": "点击发送", "click-to-send": "点击发送",
"tap-to-send": "轻触发送" "tap-to-send": "轻触发送",
"activate-paste-mode-base": "在其他设备上打开 PairDrop 来发送",
"activate-paste-mode-and-other-files": "和 {{count}} 个其他的文件",
"activate-paste-mode-shared-text": "分享文本"
}, },
"footer": { "footer": {
"routed": "途径服务器", "routed": "途径服务器",
@ -40,9 +43,6 @@
"on-this-network_title": "您可以被这个网络上的每个人发现。" "on-this-network_title": "您可以被这个网络上的每个人发现。"
}, },
"dialogs": { "dialogs": {
"activate-paste-mode-base": "在其他设备上打开 PairDrop 来发送",
"activate-paste-mode-and-other-files": "和 {{count}} 个其他的文件",
"activate-paste-mode-activate-paste-mode-shared-text": "分享文本",
"pair-devices-title": "配对新设备(常驻)", "pair-devices-title": "配对新设备(常驻)",
"input-key-on-this-device": "在另一个设备上输入这串数字", "input-key-on-this-device": "在另一个设备上输入这串数字",
"base64-text": "信息", "base64-text": "信息",

View file

@ -259,27 +259,28 @@ class PeersUI {
_activatePasteMode(files, text) { _activatePasteMode(files, text) {
if (!window.pasteMode.activated && (files.length > 0 || text.length > 0)) { if (!window.pasteMode.activated && (files.length > 0 || text.length > 0)) {
let descriptor; const openPairDrop = Localization.getTranslation("instructions.activate-paste-mode-base");
let noPeersMessage; const andOtherFiles = Localization.getTranslation("instructions.activate-paste-mode-and-other-files", null, {count: files.length-1});
const sharedText = Localization.getTranslation("instructions.activate-paste-mode-shared-text");
const clickToSend = Localization.getTranslation("instructions.click-to-send")
const tapToSend = Localization.getTranslation("instructions.tap-to-send")
const openPairDrop = Localization.getTranslation("dialogs.activate-paste-mode-base"); let descriptor;
const andOtherFiles = Localization.getTranslation("dialogs.activate-paste-mode-and-other-files", null, {count: files.length-1});
const sharedText = Localization.getTranslation("dialogs.activate-paste-mode-shared-text");
if (files.length === 1) { if (files.length === 1) {
noPeersMessage = `${openPairDrop}<br><i>${files[0].name}</i>`; descriptor = `<i>${files[0].name}</i>`;
} else if (files.length > 1) { } else if (files.length > 1) {
noPeersMessage = `${openPairDrop}<br><i>${files[0].name}</i> ${andOtherFiles}`; descriptor = `<i>${files[0].name}</i><br>${andOtherFiles}`;
} else { } else {
noPeersMessage = `${openPairDrop}<br>${sharedText}`; descriptor = sharedText;
} }
this.$xInstructions.querySelector('p').innerHTML = noPeersMessage; this.$xInstructions.querySelector('p').innerHTML = `<i>${descriptor}</i>`;
this.$xInstructions.querySelector('p').style.display = 'block'; this.$xInstructions.querySelector('p').style.display = 'block';
this.$xInstructions.setAttribute('desktop', Localization.getTranslation("instructions.click-to-send")); this.$xInstructions.setAttribute('desktop', clickToSend);
this.$xInstructions.setAttribute('mobile', Localization.getTranslation("instructions.tap-to-send")); this.$xInstructions.setAttribute('mobile', tapToSend);
this.$xNoPeers.querySelector('h2').innerHTML = noPeersMessage; this.$xNoPeers.querySelector('h2').innerHTML = `${openPairDrop}<br>${descriptor}`;
const _callback = (e) => this._sendClipboardData(e, files, text); const _callback = (e) => this._sendClipboardData(e, files, text);
Events.on('paste-pointerdown', _callback); Events.on('paste-pointerdown', _callback);