diff --git a/src/common.ts b/src/common.ts index 62438ddef..511f7e044 100644 --- a/src/common.ts +++ b/src/common.ts @@ -32,8 +32,10 @@ export async function decompress(compressedArray: Uint8Array) { } } +const LANG = getLang(); + export function translate(locale: string, text: string): string { - const lang = locale.substring(locale.length - 2).toLowerCase(); + const lang = LANG || locale.substring(locale.length - 2).toLowerCase(); let en = LANGS.en as any; let dict = (LANGS as any)[lang]; if (!dict) dict = en; @@ -63,3 +65,13 @@ export function mapKey(name: string, isDesktop: Boolean) { export async function sleep(ms: number) { await new Promise((r) => setTimeout(r, ms)); } + +function getLang(): string { + try { + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + return urlParams.get("lang") || ""; + } catch (e) { + return ""; + } +} diff --git a/src/connection.ts b/src/connection.ts index f59fdc7ba..43abcab64 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -17,6 +17,7 @@ const SCHEMA = "ws://"; type MsgboxCallback = (type: string, title: string, text: string) => void; type DrawCallback = (data: Uint8Array) => void; +//const cursorCanvas = document.createElement("canvas"); export default class Connection { _msgs: any[]; @@ -32,6 +33,7 @@ export default class Connection { _password: Uint8Array | undefined; _options: any; _videoTestSpeed: number[]; + //_cursors: { [name: number]: any }; constructor() { this._msgbox = globals.msgbox; @@ -39,6 +41,7 @@ export default class Connection { this._msgs = []; this._id = ""; this._videoTestSpeed = [0, 0]; + //this._cursors = {}; } async start(id: string) { @@ -269,7 +272,7 @@ export default class Connection { cb.content = c; } try { - await navigator.clipboard.writeText(new TextDecoder().decode(cb.content)); + globals.copyToClipboard(new TextDecoder().decode(cb.content)); } catch (e) { console.error(e); } @@ -280,6 +283,29 @@ export default class Connection { if (!c) continue; cd.colors = c; globals.pushEvent("cursor_data", cd); + /* + let ctx = cursorCanvas.getContext("2d"); + cursorCanvas.width = cd.width; + cursorCanvas.height = cd.height; + let imgData = new ImageData( + new Uint8ClampedArray(c), + cd.width, + cd.height + ); + ctx?.clearRect(0, 0, cd.width, cd.height); + ctx?.putImageData(imgData, 0, 0); + let url = cursorCanvas.toDataURL(); + const img = document.createElement("img"); + img.src = url; + this._cursors[cd.id] = img; + //cursorCanvas.width /= 2.; + //cursorCanvas.height /= 2.; + //ctx?.drawImage(img, cursorCanvas.width, cursorCanvas.height); + url = cursorCanvas.toDataURL(); + document.body.style.cursor = + "url(" + url + ")" + cd.hotx + " " + cd.hoty + ", default"; + console.log(document.body.style.cursor); + */ } else if (msg?.cursor_id) { globals.pushEvent("cursor_id", { id: msg?.cursor_id }); } else if (msg?.cursor_position) { diff --git a/src/gen_js_from_hbb.ts b/src/gen_js_from_hbb.ts index c3ab11959..118f03b70 100644 --- a/src/gen_js_from_hbb.ts +++ b/src/gen_js_from_hbb.ts @@ -5,9 +5,11 @@ export const LANGS = { "desk_tip": "Ваш рабочий стол доступен с этим идентификатором и паролем", "Password": "Пароль", "Ready": "Готово", + "Established": "Учредил", "connecting_status": "Подключение к сети RustDesk..", "Enable Service": "Включить связанный сервер", "Start Service": "Запуск связанного сервера", + "Service is running": "Служба работает", "Service is not running": "Связанный сервер не запущен", "not_ready_status": "Не готово. Пожалуйста, проверьте подключение", "Control Remote Desktop": "Управление удаленным рабочим столом", @@ -262,6 +264,274 @@ export const LANGS = { "android_stop_service_tip": "Закрытие службы автоматически закроет все установленные соединения.", "android_version_audio_tip": "Текущая версия Android не поддерживает захват звука, обновите ее до Android 10 или выше.", "android_start_service_tip": "Коснитесь [Запуск связанного сервера] или ОТКРЫТЬ разрешение [Скриншот], чтобы запустить службу демонстрации экрана.", + "Account": "Аккаунт", + }, + ptbr: { + "Status": "Status", + "Your Desktop": "Seu Desktop", + "desk_tip": "Seu desktop pode ser acessado com este ID e senha.", + "Password": "Senha", + "Ready": "Pronto", + "Established": "Estabelecido", + "connecting_status": "Conectando à rede do RustDesk...", + "Enable Service": "Habilitar Serviço", + "Start Service": "Iniciar Serviço", + "Service is running": "Serviço está em execução", + "Service is not running": "Serviço não está em execução", + "not_ready_status": "Não está pronto. Por favor verifique sua conexão", + "Control Remote Desktop": "Controle o Desktop à distância", + "Transfer File": "Transferir Arquivo", + "Connect": "Conectar", + "Recent Sessions": "Sessões recentes", + "Address Book": "Lista de Endereços", + "Confirmation": "Confirmação", + "TCP Tunneling": "Tunelamento TCP", + "Remove": "Remover", + "Refresh random password": "Atualizar senha aleatória", + "Set your own password": "Configure sua própria senha", + "Enable Keyboard/Mouse": "Habilitar Teclado/Mouse", + "Enable Clipboard": "Habilitar Área de Transferência", + "Enable File Transfer": "Habilitar Transferência de Arquivos", + "Enable TCP Tunneling": "Habilitar Tunelamento TCP", + "IP Whitelisting": "Whitelisting de IP", + "ID/Relay Server": "Servidor ID/Relay", + "Stop service": "Parar serviço", + "Change ID": "Alterar ID", + "Website": "Website", + "About": "Sobre", + "Mute": "Emudecer", + "Audio Input": "Endtrada de Áudio", + "ID Server": "Servidor de ID", + "Relay Server": "Servidor de Relay", + "API Server": "Servidor da API", + "invalid_http": "deve iniciar com http:// ou https://", + "Invalid IP": "IP inválido", + "id_change_tip": "Somente os caracteres a-z, A-Z, 0-9 e _ (sublinhado) são permitidos. A primeira letra deve ser a-z, A-Z. Comprimento entre 6 e 16.", + "Invalid format": "Formato inválido", + "This function is turned off by the server": "Esta funcionalidade foi desligada pelo servidor", + "Not available": "Indisponível", + "Too frequent": "Muito frequente", + "Cancel": "Cancelar", + "Skip": "Pular", + "Close": "Fechar", + "Retry": "Tentar novamente", + "OK": "OK", + "Password Required": "Senha Necessária", + "Please enter your password": "Por favor informe sua senha", + "Remember password": "Lembrar senha", + "Wrong Password": "Senha Incorreta", + "Do you want to enter again?": "Você quer entrar novamente?", + "Connection Error": "Erro de Conexão", + "Error": "Erro", + "Reset by the peer": "Reiniciado pelo par", + "Connecting...": "Conectando...", + "Connection in progress. Please wait.": "Conexão em progresso. Aguarde por favor.", + "Please try 1 minute later": "Por favor tente após 1 minuto", + "Login Error": "Erro de Login", + "Successful": "Sucesso", + "Connected, waiting for image...": "Conectado. Aguardando pela imagem...", + "Name": "Nome", + "Type": "Tipo", + "Modified": "Modificado", + "Size": "Tamanho", + "Show Hidden Files": "Mostrar Arquivos Ocultos", + "Receive": "Receber", + "Send": "Enviar", + "Refresh File": "Atualizar Arquivo", + "Local": "Local", + "Remote": "Remoto", + "Remote Computer": "Computador Remoto", + "Local Computer": "Computador Local", + "Confirm Delete": "Comfirmar Apagar", + "Delete": "Apagar", + "Properties": "Propriedades", + "Multi Select": "Seleção Múltipla", + "Empty Directory": "Diretório Vazio", + "Not an empty directory": "Diretório não está vazio", + "Are you sure you want to delete this file?": "Tem certeza que deseja apagar este arquivo?", + "Are you sure you want to delete this empty directory?": "Tem certeza que deseja apagar este diretório vazio?", + "Are you sure you want to delete the file of this directory?": "Tem certeza que deseja apagar este arquivo deste diretório?", + "Do this for all conflicts": "Fazer isto para todos os conflitos", + "This is irreversible!": "Isso é irreversível!", + "Deleting": "Apagando", + "files": "arquivos", + "Waiting": "Aguardando", + "Finished": "Completo", + "Speed": "Velocidade", + "Custom Image Quality": "Qualidade Visual Personalizada", + "Privacy mode": "Modo privado", + "Block user input": "Bloquear entrada de usuário", + "Unblock user input": "Desbloquear entrada de usuário", + "Adjust Window": "Ajustar Janela", + "Original": "Original", + "Shrink": "Reduzir", + "Stretch": "Aumentar", + "Good image quality": "Qualidade visual boa", + "Balanced": "Balanceada", + "Optimize reaction time": "Otimizar tempo de reação", + "Custom": "Personalizado", + "Show remote cursor": "Mostrar cursor remoto", + "Disable clipboard": "Desabilitar área de transferência", + "Lock after session end": "Bloquear após o fim da sessão", + "Insert": "Inserir", + "Insert Lock": "Inserir Trava", + "Refresh": "Atualizar", + "ID does not exist": "ID não existe", + "Failed to connect to rendezvous server": "Falha ao conectar ao servidor de rendezvous", + "Please try later": "Por favor tente mais tarde", + "Remote desktop is offline": "Desktop remoto está offline", + "Key mismatch": "Chaves incompatíveis", + "Timeout": "Tempo esgotado", + "Failed to connect to relay server": "Falha ao conectar ao servidor de relay", + "Failed to connect via rendezvous server": "Falha ao conectar ao servidor de rendezvous", + "Failed to connect via relay server": "Falha ao conectar através do servidor de relay", + "Failed to make direct connection to remote desktop": "Falha ao fazer conexão direta ao desktop remoto", + "Set Password": "Definir Senha", + "OS Password": "Senha do SO", + "install_tip": "Devido ao UAC, o RustDesk não funciona corretamente como o lado remoto em alguns casos. Para evitar o UAC, por favor clique no botão abaixo para instalar o RustDesk no sistema.", + "Click to upgrade": "Clique para fazer o upgrade", + "Click to download": "Clique para baixar", + "Click to update": "Clique para fazer o update", + "Configuration Permissions": "Permissões de Configuração", + "Configure": "Configurar", + "config_acc": "Para controlar seu Desktop remotamente, você precisa conceder ao RustDesk permissões de \"Acessibilidade\".", + "config_screen": "Para acessar seu Desktop remotamente, você precisa conceder ao RustDesk permissões de \"Gravar a Tela\"/", + "Installing ...": "Instalando ...", + "Install": "Instalar", + "Installation": "Instalação", + "Installation Path": "Caminho da Instalação", + "Create start menu shortcuts": "Criar atalhos no menu iniciar", + "Create desktop icon": "Criar ícone na área de trabalho", + "agreement_tip": "Ao iniciar a instalação, você concorda com o acordo de licença.", + "Accept and Install": "Aceitar e Instalar", + "End-user license agreement": "Acordo de licença do usuário final", + "Generating ...": "Gerando ...", + "Your installation is lower version.": "Sua instalação é de uma versão menor.", + "not_close_tcp_tip": "Não feche esta janela enquanto estiver utilizando o túnel", + "Listening ...": "Escutando ...", + "Remote Host": "Host Remoto", + "Remote Port": "Porta Remota", + "Action": "Ação", + "Add": "Adicionar", + "Local Port": "Porta Local", + "setup_server_tip": "Para uma conexão mais rápida, por favor configure seu próprio servidor", + "Too short, at least 6 characters.": "Muito curto, pelo menos 6 caracteres.", + "The confirmation is not identical.": "A confirmação não é idêntica.", + "Permissions": "Permissões", + "Accept": "Aceitar", + "Dismiss": "Dispensar", + "Disconnect": "Desconectar", + "Allow using keyboard and mouse": "Permitir o uso de teclado e mouse", + "Allow using clipboard": "Permitir o uso da área de transferência", + "Allow hearing sound": "Permitir escutar som", + "Allow file transfer": "Permitir transferência de arquivo", + "File transfer": "Transferência de arquivo", + "Connected": "Conectado", + "Direct and encrypted connection": "Conexão direta e criptografada", + "Relayed and encrypted connection": "Conexão via relay e criptografada", + "Direct and unencrypted connection": "Conexão direta e não criptografada", + "Relayed and unencrypted connection": "Conexão via relay e não criptografada", + "Enter Remote ID": "Informe o ID Remoto", + "Enter your password": "Informe sua senha", + "Logging in...": "Fazendo Login...", + "Enable RDP session sharing": "Habilitar compartilhamento de sessão RDP", + "Auto Login": "Login Automático (Somente válido se você habilitou \"Bloquear após o fim da sessão\")", + "Enable Direct IP Access": "Habilitar Acesso IP Direto", + "Rename": "Renomear", + "Space": "Espaõ", + "Create Desktop Shortcut": "Criar Atalho na Área de Trabalho", + "Change Path": "Alterar Caminho", + "Create Folder": "Criar Diretório", + "Please enter the folder name": "Por favor informe o nome do diretório", + "Fix it": "Conserte", + "Warning": "Aguardando", + "Login screen using Wayland is not supported": "Tela de Login utilizando Wayland não é suportada", + "Reboot required": "Reinicialização necessária", + "Unsupported display server ": "Servidor de display não suportado", + "x11 expected": "x11 esperado", + "Port": "Porta", + "Settings": "Configurações", + "Username": "Nome de usuário", + "Invalid port": "Porta inválida", + "Closed manually by the peer": "Fechada manualmente pelo par", + "Enable remote configuration modification": "Habilitar modificações de configuração remotas", + "Run without install": "Executar sem instalar", + "Always connected via relay": "Sempre conectado via relay", + "Always connect via relay": "Sempre conectar via relay", + "whitelist_tip": "Somente IPs na whitelist podem me acessar", + "Login": "Login", + "Logout": "Sair", + "Tags": "Tags", + "Search ID": "Buscar ID", + "Current Wayland display server is not supported": "Servidor de display Wayland atual não é suportado", + "whitelist_sep": "Separado por vírcula, ponto-e-vírgula, espaços ou nova linha", + "Add ID": "Adicionar ID", + "Add Tag": "Adicionar Tag", + "Unselect all tags": "Desselecionar todas as tags", + "Network error": "Erro de rede", + "Username missed": "Nome de usuário faltante", + "Password missed": "Senha faltante", + "Wrong credentials": "Nome de usuário ou senha incorretos", + "Edit Tag": "Editar Tag", + "Unremember Password": "Esquecer Senha", + "Favorites": "Favoritos", + "Add to Favorites": "Adicionar aos Favoritos", + "Remove from Favorites": "Remover dos Favoritos", + "Empty": "Vazio", + "Invalid folder name": "Nome de diretório inválido", + "Socks5 Proxy": "Proxy Socks5", + "Hostname": "Nome de anfitrião", + "Discovered": "Descoberto", + "install_daemon_tip": "Para inicialização junto ao sistema, você deve instalar o serviço de sistema.", + "Remote ID": "ID Remoto", + "Paste": "Colar", + "Paste here?": "Colar aqui?", + "Are you sure to close the connection?": "Tem certeza que deseja fechar a conexão?", + "Download new version": "Baixar nova versão", + "Touch mode": "Modo toque", + "TouchPad mode": "Modo TouchPad", + "One-Finger Tap": "Toque com um dedo", + "Left Mouse": "Botão esquerdo do mouse", + "One-Long Tap": "Um toque longo", + "Two-Finger Tap": "Toque com dois dedos", + "Right Mouse": "Botão direito do mouse", + "One-Finger Move": "Mover com um dedo", + "Double Tap & Move": "Toque duplo & mover", + "Mouse Drag": "Arrastar com o mouse", + "Two-Finger vertically": "Dois dedos verticalmente", + "Mouse Wheel": "Roda do Mouse", + "Two-Finger Move": "Mover com dois dedos", + "Canvas Move": "Mover Tela", + "Pinch to Zoom": "Beliscar para Zoom", + "Canvas Zoom": "Zoom na Tela", + "Reset canvas": "Reiniciar tela", + "No permission of file transfer": "Sem permissões de transferência de arquivo", + "Note": "Nota", + "Connection": "Conexão", + "Share Screen": "Compartilhar Tela", + "CLOSE": "FECHAR", + "OPEN": "ABRIR", + "Chat": "Chat", + "Total": "Total", + "items": "itens", + "Selected": "Selecionado", + "Screen Capture": "Captura de Tela", + "Mouse Control": "Controle do Mouse", + "File Transfer": "Transferência de Arquivo", + "Audio Capture": "Captura de Áudio", + "File Connection": "Conexão de Arquivo", + "Screen Connection": "Conexão de Tela", + "Do you accept?": "Você aceita?", + "Open System Setting": "Abrir Configurações do Sistema", + "How to get Android input permission?": "Como habilitar a permissão de entrada do Android?", + "android_input_permission_tip1": "Após obter permissão de entrada, o dispositivo remoto pode controlar este dispositivo Android via mouse", + "android_input_permission_tip2": "Por favor vá para a próxima página de configuração do sistema, encontre e entre [Serviços Instalados], HABILITE o serviço [RustDesk Input]", + "android_new_connection_tip": "Nova requisição de controle recebida, solicita o controle de seu dispositivo atual.", + "android_service_will_start_tip": "Habilitar a Captura de Tela irá automaticamente inicalizar o serviço, permitindo que outros dispositivos solicitem uma conexão deste dispositivo.", + "android_stop_service_tip": "Fechar o serviço irá automaticamente fechar todas as conexões estabelecidas.", + "android_version_audio_tip": "A versão atual do Android não suporta captura de áudio, por favor atualize para o Android 10 ou maior.", + "android_start_service_tip": "Toque [Iniciar Serviço] ou ABRA a permissão [Captura de Tela] para iniciar o serviço de compartilhamento de tela.", + "Account": "Conta", }, de: { "Status": "Status", @@ -269,9 +539,11 @@ export const LANGS = { "desk_tip": "Mit dieser ID und diesem Passwort können Sie auf Ihren Desktop zugreifen.", "Password": "Passwort", "Ready": "Bereit", + "Established": "Etabliert", "connecting_status": "Verbinden mit dem RustDesk-Netzwerk...", "Enable Service": "Verbindungsserver einschalten", "Start Service": "Starte Verbindungsserver", + "Service is running": "Dienst läuft", "Service is not running": "Der Verbindungsserver läuft nicht", "not_ready_status": "Nicht bereit. Bitte überprüfen Sie Ihre Verbindung", "Control Remote Desktop": "Entfernten Desktop steuern", @@ -410,8 +682,8 @@ export const LANGS = { "Add": "Hinzufügen", "Local Port": "Lokaler Port", "setup_server_tip": "Für eine schnellere Verbindung, richten Sie bitte Ihren eigenen Verbindungsserver ein", - "Too short, at least 6 characters": "Zu kurz, mindestens 6 Zeichen", - "The confirmation is not identical": "Die Bestätigung ist nicht identisch", + "Too short, at least 6 characters.": "Zu kurz, mindestens 6 Zeichen.", + "The confirmation is not identical.": "Die Bestätigung ist nicht identisch.", "Permissions": "Berechtigungen", "Accept": "Akzeptieren", "Dismiss": "Ablehnen", @@ -526,6 +798,7 @@ export const LANGS = { "android_stop_service_tip": "Durch das Schließen des Dienstes werden automatisch alle hergestellten Verbindungen geschlossen.", "android_version_audio_tip": "Die aktuelle Android-Version unterstützt keine Audioaufnahme, bitte aktualisieren Sie auf Android 10 oder höher.", "android_start_service_tip": "Tippen Sie auf [Dienst starten] oder ÖFFNEN Sie die Berechtigung [Bildschirmaufnahme], um den Bildschirmfreigabedienst zu starten.", + "Account": "Konto", }, eo: { "Status": "Stato", @@ -533,9 +806,11 @@ export const LANGS = { "desk_tip": "Via aparato povas esti alirita kun tiu identigilo kaj pasvorto", "Password": "Pasvorto", "Ready": "Preta", + "Established": "", "connecting_status": "Konektante al la reto RustDesk...", "Enable Service": "Ebligi servon", "Start Service": "Starti servon", + "Service is running": "", "Service is not running": "La servo ne funkcias", "not_ready_status": "Ne preta, bonvolu kontroli la retkonekto", "Control Remote Desktop": "Kontroli foran aparaton", @@ -589,7 +864,7 @@ export const LANGS = { "Login Error": "Eraro de konektado", "Successful": "Sukceso", "Connected, waiting for image...": "Konektita, atendante bildon...", - "Name": "Nomo de dosiero", + "Name": "Nomo", "Type": "", "Modified": "Modifita", "Size": "Grandeco", @@ -604,7 +879,7 @@ export const LANGS = { "Confirm Delete": "Konfermi la forigo", "Delete": "", "Properties": "", - "CheckBox": "", + "Multi Select": "", "Empty Directory": "", "Not an empty directory": "", "Are you sure you want to delete this file?": "Ĉu vi vere volas forigi tiun dosieron?", @@ -790,6 +1065,7 @@ export const LANGS = { "android_stop_service_tip": "", "android_version_audio_tip": "", "android_start_service_tip": "", + "Account": "", }, cn: { "Status": "状态", @@ -797,9 +1073,11 @@ export const LANGS = { "desk_tip": "你的桌面可以通过下面的ID和密码访问。", "Password": "密码", "Ready": "就绪", + "Established": "已建立", "connecting_status": "正在接入RustDesk网络...", "Enable Service": "允许服务", "Start Service": "启动服务", + "Service is running": "服务正在运行", "Service is not running": "服务没有启动", "not_ready_status": "未就绪,请检查网络连接", "Control Remote Desktop": "控制远程桌面", @@ -853,7 +1131,7 @@ export const LANGS = { "Login Error": "登录错误", "Successful": "成功", "Connected, waiting for image...": "已连接,等待画面传输...", - "Name": "文件名", + "Name": "名称", "Type": "类型", "Modified": "修改时间", "Size": "大小", @@ -1054,6 +1332,7 @@ export const LANGS = { "android_stop_service_tip": "关闭服务将自动关闭所有已建立的连接。", "android_version_audio_tip": "当前安卓版本不支持音频录制,请升级至安卓10或更高。", "android_start_service_tip": "点击 [启动服务] 或打开 [屏幕录制] 权限开启手机屏幕共享服务。", + "Account": "账号", }, it: { "Status": "Stato", @@ -1061,9 +1340,11 @@ export const LANGS = { "desk_tip": "Puoi accedere al tuo desktop usando l'ID e la password riportati qui.", "Password": "Password", "Ready": "Pronto", + "Established": "Stabilito", "connecting_status": "Connessione alla rete RustDesk in corso...", "Enable Service": "Abilita servizio", "Start Service": "Avvia servizio", + "Service is running": "Il servizio è in esecuzione", "Service is not running": "Il servizio non è in esecuzione", "not_ready_status": "Non pronto. Verifica la tua connessione", "Control Remote Desktop": "Controlla una scrivania remota", @@ -1318,6 +1599,7 @@ export const LANGS = { "android_stop_service_tip": "La chiusura del servizio chiuderà automaticamente tutte le connessioni stabilite.", "android_version_audio_tip": "L'attuale versione di Android non supporta l'acquisizione audio, esegui l'upgrade ad Android 10 o versioni successive.", "android_start_service_tip": "Toccare [Avvia servizio] o APRI l'autorizzazione [Cattura schermo] per avviare il servizio di condivisione dello schermo.", + "Account": "Account", }, tw: { "Status": "狀態", @@ -1325,9 +1607,11 @@ export const LANGS = { "desk_tip": "您可以透過此 ID 及密碼存取您的桌面", "Password": "密碼", "Ready": "就緒", + "Established": "已建立", "connecting_status": "正在連接至 RustDesk 網路...", "Enable Service": "啟用服務", "Start Service": "啟動服務", + "Service is running": "服務正在運行", "Service is not running": "服務尚未執行", "not_ready_status": "尚未就緒。請檢查您的網路連線", "Control Remote Desktop": "控制遠端桌面", @@ -1582,6 +1866,7 @@ export const LANGS = { "android_stop_service_tip": "關閉服務將自動關閉所有已建立的連接。", "android_version_audio_tip": "當前安卓版本不支持音頻錄製,請升級至安卓10或更高。", "android_start_service_tip": "點擊 [啟動服務] 或打開 [屏幕錄製] 權限開啟手機屏幕共享服務。", + "Account": "帳戶", }, en: { "desk_tip": "Your desktop can be accessed with this ID and password.", @@ -1614,9 +1899,11 @@ export const LANGS = { "desk_tip": "Votre bureau est accessible via l'identifiant et le mot de passe ci-dessous.", "Password": "Mot de passe", "Ready": "Prêt", + "Established": "Établi", "connecting_status": "Connexion au réseau RustDesk...", "Enable Service": "Autoriser le service", "Start Service": "Démarrer le service", + "Service is running": "Le service est en cours d'exécution", "Service is not running": "Le service ne fonctionne pas", "not_ready_status": "Pas prêt, veuillez vérifier la connexion réseau", "Control Remote Desktop": "Contrôler le bureau à distance", @@ -1670,7 +1957,7 @@ export const LANGS = { "Login Error": "Erreur de connexion", "Successful": "Succès", "Connected, waiting for image...": "Connecté, en attente de transmission d'image...", - "Name": "Nom du fichier", + "Name": "Nom", "Type": "Taper", "Modified": "Modifié", "Size": "Taille", @@ -1871,6 +2158,7 @@ export const LANGS = { "android_stop_service_tip": "La fermeture du service fermera automatiquement toutes les connexions établies.", "android_version_audio_tip": "La version actuelle d'Android ne prend pas en charge la capture audio, veuillez passer à Android 10 ou supérieur.", "android_start_service_tip": "Appuyez sur [Démarrer le service] ou sur l'autorisation OUVRIR [Capture d'écran] pour démarrer le service de partage d'écran.", + "Account": "Compte", }, } diff --git a/src/globals.js b/src/globals.js index cb0490150..a9eb941a5 100644 --- a/src/globals.js +++ b/src/globals.js @@ -376,4 +376,29 @@ function newAudioPlayer(channels, sampleRate) { sampleRate, flushingTime: 2000 }); +} + +export function copyToClipboard(text) { + if (window.clipboardData && window.clipboardData.setData) { + // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. + return window.clipboardData.setData("Text", text); + + } + else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { + var textarea = document.createElement("textarea"); + textarea.textContent = text; + textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. + document.body.appendChild(textarea); + textarea.select(); + try { + return document.execCommand("copy"); // Security exception may be thrown by some browsers. + } + catch (ex) { + console.warn("Copy to clipboard failed.", ex); + // return prompt("Copy to clipboard: Ctrl+C, Enter", text); + } + finally { + document.body.removeChild(textarea); + } + } } \ No newline at end of file