From 0caf04617ea2e476e942a867ea4611e694da7dc1 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:17:35 -0300 Subject: [PATCH 01/10] Fixed translated variable name "w" as in "week" was translated into "s" (as in "semana"), which is obviously wrong. --- src/lib/i18n/locales/pt-BR/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/pt-BR/translation.json b/src/lib/i18n/locales/pt-BR/translation.json index 0a81b6821..55a1d8656 100644 --- a/src/lib/i18n/locales/pt-BR/translation.json +++ b/src/lib/i18n/locales/pt-BR/translation.json @@ -1,5 +1,5 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 's' ou '-1' para não expirar.", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' ou '-1' para não expirar.", "(Beta)": "(Beta)", "(e.g. `sh webui.sh --api`)": "(por exemplo, `sh webui.sh --api`)", "(latest)": "(mais recente)", From b352732b435e51aa5e5c1e693d09650ea6c5f76b Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:19:55 -0300 Subject: [PATCH 02/10] Fixed translated variable names --- src/lib/i18n/locales/bg-BG/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/bg-BG/translation.json b/src/lib/i18n/locales/bg-BG/translation.json index ff71b604b..f463816e4 100644 --- a/src/lib/i18n/locales/bg-BG/translation.json +++ b/src/lib/i18n/locales/bg-BG/translation.json @@ -1,5 +1,5 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'с', 'м', 'ч', 'д', 'с' или '-1' за неограничен срок.", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' или '-1' за неограничен срок.", "(Beta)": "(Бета)", "(e.g. `sh webui.sh --api`)": "(например `sh webui.sh --api`)", "(latest)": "(последна)", From e720afacfab442410dc581039c010b7de1ea06e3 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:24:29 -0300 Subject: [PATCH 03/10] Fixed translated variable names --- src/lib/i18n/locales/ja-JP/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/ja-JP/translation.json b/src/lib/i18n/locales/ja-JP/translation.json index 600e44d8e..58fe45b09 100644 --- a/src/lib/i18n/locales/ja-JP/translation.json +++ b/src/lib/i18n/locales/ja-JP/translation.json @@ -1,5 +1,5 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'秒', '分', '時間', '日', '週' または '-1' で無期限。", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' または '-1' で無期限。", "(Beta)": "(ベータ版)", "(e.g. sh webui.sh --api)": "(例: sh webui.sh --api)", "(latest)": "(最新)", From c235a3d539b3e62b562f14e69ede62a4f735ed0b Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:25:39 -0300 Subject: [PATCH 04/10] Fixed translated variable names --- src/lib/i18n/locales/ko-KR/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json index 49c8f75fa..ea3c6e560 100644 --- a/src/lib/i18n/locales/ko-KR/translation.json +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -1,5 +1,5 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'초', '분', '시간', '일', '주' 또는 만료 없음 '-1'", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' 또는 만료 없음 '-1'", "(Beta)": "(Beta)", "(e.g. `sh webui.sh --api`)": "(예: `sh webui.sh --api`)", "(latest)": "(latest)", From 44f9e930d272715211c42373fd23680d1463e3f7 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:26:54 -0300 Subject: [PATCH 05/10] Fixed malformed date string --- src/lib/i18n/locales/pl-pl/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/pl-pl/translation.json b/src/lib/i18n/locales/pl-pl/translation.json index e8b38d17b..855a29482 100644 --- a/src/lib/i18n/locales/pl-pl/translation.json +++ b/src/lib/i18n/locales/pl-pl/translation.json @@ -86,7 +86,7 @@ "Customize Ollama models for a specific purpose": "Dostosuj modele Ollama do określonego celu", "Dark": "Ciemny", "Database": "Baza danych", - "DD/MM/YYYY HH:mm": "DD/MM/RRRR GG:MM", + "DD/MM/YYYY HH:mm": "DD/MM/YYYY GG:MM", "Default": "Domyślny", "Default (Automatic1111)": "Domyślny (Automatyczny1111)", "Default (Web API)": "Domyślny (Interfejs API)", From 941dc41c3d8151fe4f677870772e19c6a62d37c1 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:28:10 -0300 Subject: [PATCH 06/10] Fixed translated variable names and malformed date string --- src/lib/i18n/locales/pt-PT/translation.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/i18n/locales/pt-PT/translation.json b/src/lib/i18n/locales/pt-PT/translation.json index 80d16eb0f..48f15a4e8 100644 --- a/src/lib/i18n/locales/pt-PT/translation.json +++ b/src/lib/i18n/locales/pt-PT/translation.json @@ -1,5 +1,5 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 's' ou '-1' para nenhuma expiração.", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' ou '-1' para nenhuma expiração.", "(Beta)": "(Beta)", "(e.g. `sh webui.sh --api`)": "(por exemplo, `sh webui.sh --api`)", "(latest)": "(mais recente)", @@ -86,7 +86,7 @@ "Customize Ollama models for a specific purpose": "Personalize os modelos Ollama para um propósito específico", "Dark": "Escuro", "Database": "Banco de dados", - "DD/MM/YYYY HH:mm": "DD/MM/AAAA HH:mm", + "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", "Default": "Padrão", "Default (Automatic1111)": "Padrão (Automatic1111)", "Default (Web API)": "Padrão (API Web)", @@ -190,7 +190,7 @@ "Mirostat": "Mirostat", "Mirostat Eta": "Mirostat Eta", "Mirostat Tau": "Mirostat Tau", - "MMMM DD, YYYY": "MMMM DD, AAAA", + "MMMM DD, YYYY": "DD/MM/YYYY", "Model '{{modelName}}' has been successfully downloaded.": "O modelo '{{modelName}}' foi baixado com sucesso.", "Model '{{modelTag}}' is already in queue for downloading.": "O modelo '{{modelTag}}' já está na fila para download.", "Model {{modelId}} not found": "Modelo {{modelId}} não encontrado", From 5f16ec077a41517142bd38dabe33c38a1449fcc2 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:34:03 -0300 Subject: [PATCH 07/10] Fixed malformed time format --- src/lib/i18n/locales/pl-pl/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/pl-pl/translation.json b/src/lib/i18n/locales/pl-pl/translation.json index 855a29482..e3eb19a0d 100644 --- a/src/lib/i18n/locales/pl-pl/translation.json +++ b/src/lib/i18n/locales/pl-pl/translation.json @@ -86,7 +86,7 @@ "Customize Ollama models for a specific purpose": "Dostosuj modele Ollama do określonego celu", "Dark": "Ciemny", "Database": "Baza danych", - "DD/MM/YYYY HH:mm": "DD/MM/YYYY GG:MM", + "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", "Default": "Domyślny", "Default (Automatic1111)": "Domyślny (Automatyczny1111)", "Default (Web API)": "Domyślny (Interfejs API)", From b788514a10ee49fee4b53b7f4dacc87c5e9200c6 Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:38:26 -0300 Subject: [PATCH 08/10] Fixed translated author name --- src/lib/i18n/locales/pl-pl/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/pl-pl/translation.json b/src/lib/i18n/locales/pl-pl/translation.json index e3eb19a0d..9de1d9d3c 100644 --- a/src/lib/i18n/locales/pl-pl/translation.json +++ b/src/lib/i18n/locales/pl-pl/translation.json @@ -88,7 +88,7 @@ "Database": "Baza danych", "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", "Default": "Domyślny", - "Default (Automatic1111)": "Domyślny (Automatyczny1111)", + "Default (Automatic1111)": "Domyślny (Automatic1111)", "Default (Web API)": "Domyślny (Interfejs API)", "Default model updated": "Domyślny model zaktualizowany", "Default Prompt Suggestions": "Domyślne sugestie promptów", From a53c1cfc7775acf8f3eca0e5b0e7549294e111fd Mon Sep 17 00:00:00 2001 From: Valentino Stillhardt <4715129+Fusseldieb@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:40:38 -0300 Subject: [PATCH 09/10] Fixed translated author name --- src/lib/i18n/locales/ru-RU/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/locales/ru-RU/translation.json b/src/lib/i18n/locales/ru-RU/translation.json index 2ff0bfb9f..3b4c551a9 100644 --- a/src/lib/i18n/locales/ru-RU/translation.json +++ b/src/lib/i18n/locales/ru-RU/translation.json @@ -88,7 +88,7 @@ "Database": "База данных", "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", "Default": "По умолчанию", - "Default (Automatic1111)": "По умолчанию (Автоматический1111)", + "Default (Automatic1111)": "По умолчанию (Automatic1111)", "Default (Web API)": "По умолчанию (Web API)", "Default model updated": "Модель по умолчанию обновлена", "Default Prompt Suggestions": "Предложения промтов по умолчанию", From a4083f43cbeb6e808ecc4504a21b0fa90ac60f57 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 19 Apr 2024 06:34:55 -0500 Subject: [PATCH 10/10] fix: safari copy link issue --- src/lib/components/chat/Messages.svelte | 42 ++++--------------- src/lib/components/chat/ShareChatModal.svelte | 15 ++++--- src/lib/utils/index.ts | 25 +++++++---- 3 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 892777662..2da91c50f 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -12,6 +12,7 @@ import Placeholder from './Messages/Placeholder.svelte'; import Spinner from '../common/Spinner.svelte'; import { imageGenerations } from '$lib/apis/images'; + import { copyToClipboard } from '$lib/utils'; const i18n = getContext('i18n'); @@ -42,40 +43,11 @@ element.scrollTop = element.scrollHeight; }; - const copyToClipboard = (text) => { - if (!navigator.clipboard) { - var textArea = document.createElement('textarea'); - textArea.value = text; - - // Avoid scrolling to bottom - textArea.style.top = '0'; - textArea.style.left = '0'; - textArea.style.position = 'fixed'; - - document.body.appendChild(textArea); - textArea.focus(); - textArea.select(); - - try { - var successful = document.execCommand('copy'); - var msg = successful ? 'successful' : 'unsuccessful'; - console.log('Fallback: Copying text command was ' + msg); - } catch (err) { - console.error('Fallback: Oops, unable to copy', err); - } - - document.body.removeChild(textArea); - return; + const copyToClipboardWithToast = async (text) => { + const res = await copyToClipboard(text); + if (res) { + toast.success($i18n.t('Copying to clipboard was successful!')); } - navigator.clipboard.writeText(text).then( - function () { - console.log('Async: Copying to clipboard was successful!'); - toast.success($i18n.t('Copying to clipboard was successful!')); - }, - function (err) { - console.error('Async: Could not copy text: ', err); - } - ); }; const confirmEditMessage = async (messageId, content) => { @@ -330,7 +302,7 @@ {confirmEditMessage} {showPreviousMessage} {showNextMessage} - {copyToClipboard} + copyToClipboard={copyToClipboardWithToast} /> {:else} { diff --git a/src/lib/components/chat/ShareChatModal.svelte b/src/lib/components/chat/ShareChatModal.svelte index 4fa98947d..1ef2d834e 100644 --- a/src/lib/components/chat/ShareChatModal.svelte +++ b/src/lib/components/chat/ShareChatModal.svelte @@ -10,17 +10,18 @@ import Link from '../icons/Link.svelte'; let chat = null; + let shareUrl = null; const i18n = getContext('i18n'); const shareLocalChat = async () => { const _chat = chat; const sharedChat = await shareChatById(localStorage.token, $chatId); - const chatShareUrl = `${window.location.origin}/s/${sharedChat.id}`; - - toast.success($i18n.t('Copied shared chat URL to clipboard!')); - copyToClipboard(chatShareUrl); + shareUrl = `${window.location.origin}/s/${sharedChat.id}`; + console.log(shareUrl); chat = await getChatById(localStorage.token, $chatId); + + return shareUrl; }; const shareChat = async () => { @@ -131,8 +132,12 @@