From 26121c5d881b2d34ed90eb0cca0abb4edabe07ff Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Sun, 24 Mar 2024 06:46:18 +0330 Subject: [PATCH 01/42] wip: Set default language from config --- backend/data/config.json | 1 + backend/main.py | 6 ++--- src/lib/i18n/index.ts | 54 ++++++++++++++++++++++----------------- src/routes/+layout.svelte | 7 ++++- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/backend/data/config.json b/backend/data/config.json index cd6687d79..7d15c9e69 100644 --- a/backend/data/config.json +++ b/backend/data/config.json @@ -1,6 +1,7 @@ { "version": 0, "ui": { + "locale": "en-US", "prompt_suggestions": [ { "title": [ diff --git a/backend/main.py b/backend/main.py index d4b67079c..6a5206213 100644 --- a/backend/main.py +++ b/backend/main.py @@ -32,6 +32,7 @@ from utils.utils import get_admin_user from apps.rag.utils import rag_messages from config import ( + CONFIG_DATA, WEBUI_NAME, ENV, VERSION, @@ -88,7 +89,6 @@ class RAGMiddleware(BaseHTTPMiddleware): # Example: Add a new key-value pair or modify existing ones # data["modified"] = True # Example modification if "docs" in data: - data = {**data} data["messages"] = rag_messages( data["docs"], @@ -163,11 +163,11 @@ app.mount("/rag/api/v1", rag_app) @app.get("/api/config") async def get_app_config(): - return { "status": True, "name": WEBUI_NAME, "version": VERSION, + "locale": CONFIG_DATA["ui"]["locale"], "images": images_app.state.ENABLED, "default_models": webui_app.state.DEFAULT_MODELS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, @@ -191,7 +191,6 @@ class ModelFilterConfigForm(BaseModel): async def update_model_filter_config( form_data: ModelFilterConfigForm, user=Depends(get_admin_user) ): - app.state.MODEL_FILTER_ENABLED = form_data.enabled app.state.MODEL_FILTER_LIST = form_data.models @@ -231,7 +230,6 @@ async def update_webhook_url(form_data: UrlForm, user=Depends(get_admin_user)): @app.get("/api/version") async def get_app_config(): - return { "version": VERSION, } diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts index 23edb2e1b..b0580345f 100644 --- a/src/lib/i18n/index.ts +++ b/src/lib/i18n/index.ts @@ -37,30 +37,36 @@ const createIsLoadingStore = (i18n: i18nType) => { return isLoading; }; -i18next - .use( - resourcesToBackend( - (language: string, namespace: string) => import(`./locales/${language}/${namespace}.json`) - ) - ) - .use(LanguageDetector) - .init({ - debug: false, - detection: { - order: ['querystring', 'localStorage', 'navigator'], - caches: ['localStorage'], - lookupQuerystring: 'lang', - lookupLocalStorage: 'locale' - }, - fallbackLng: { - default: ['en-US'] - }, - ns: 'translation', - returnEmptyString: false, - interpolation: { - escapeValue: false // not needed for svelte as it escapes by default - } - }); +export const initI18n = (defaultLocale: string) => { + let detectionOrder = defaultLocale + ? ['querystring', 'localStorage'] + : ['querystring', 'localStorage', 'navigator']; + let fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['en-US']; + + const loadResource = (language: string, namespace: string) => + import(`./locales/${language}/${namespace}.json`); + + i18next + .use(resourcesToBackend(loadResource)) + .use(LanguageDetector) + .init({ + debug: false, + detection: { + order: detectionOrder, + caches: ['localStorage'], + lookupQuerystring: 'lang', + lookupLocalStorage: 'locale' + }, + fallbackLng: { + default: fallbackDefaultLocale + }, + ns: 'translation', + returnEmptyString: false, + interpolation: { + escapeValue: false // not needed for svelte as it escapes by default + } + }); +}; const i18n = createI18nStore(i18next); const isLoadingStore = createIsLoadingStore(i18next); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 865155eee..3334e0d2e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -11,7 +11,7 @@ import '../tailwind.css'; import 'tippy.js/dist/tippy.css'; import { WEBUI_BASE_URL } from '$lib/constants'; - import i18n from '$lib/i18n'; + import i18n, { initI18n } from '$lib/i18n'; setContext('i18n', i18n); @@ -25,6 +25,11 @@ if (backendConfig) { // Save Backend Status to Store await config.set(backendConfig); + if ($config.locale) { + initI18n($config.locale); + } else { + initI18n(); + } await WEBUI_NAME.set(backendConfig.name); console.log(backendConfig); From 64e60036275a5200faeade6112c62bc91e30389f Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Tue, 26 Mar 2024 23:04:01 +0330 Subject: [PATCH 02/42] refac: Remove translation values for en-US Translation values for en-US are not necessary, the keys will be used as fallback. --- src/lib/i18n/locales/en-US/translation.json | 662 ++++++++++---------- 1 file changed, 331 insertions(+), 331 deletions(-) diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index 57f3d432c..251834e00 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -1,128 +1,128 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.", - "(Beta)": "(Beta)", - "(e.g. `sh webui.sh --api`)": "(e.g. `sh webui.sh --api`)", - "(latest)": "(latest)", - "{{modelName}} is thinking...": "{{modelName}} is thinking...", - "{{webUIName}} Backend Required": "{{webUIName}} Backend Required", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "", + "(Beta)": "", + "(e.g. `sh webui.sh --api`)": "", + "(latest)": "", + "{{modelName}} is thinking...": "", + "{{webUIName}} Backend Required": "", "a user": "", - "About": "About", - "Account": "Account", - "Action": "Action", - "Add a model": "Add a model", - "Add a model tag name": "Add a model tag name", - "Add a short description about what this modelfile does": "Add a short description about what this modelfile does", - "Add a short title for this prompt": "Add a short title for this prompt", - "Add a tag": "Add a tag", - "Add Docs": "Add Docs", - "Add Files": "Add Files", - "Add message": "Add message", - "add tags": "add tags", - "Adjusting these settings will apply changes universally to all users.": "Adjusting these settings will apply changes universally to all users.", - "admin": "admin", - "Admin Panel": "Admin Panel", - "Admin Settings": "Admin Settings", - "Advanced Parameters": "Advanced Parameters", - "all": "all", - "All Users": "All Users", - "Allow": "Allow", - "Allow Chat Deletion": "Allow Chat Deletion", - "alphanumeric characters and hyphens": "alphanumeric characters and hyphens", - "Already have an account?": "Already have an account?", + "About": "", + "Account": "", + "Action": "", + "Add a model": "", + "Add a model tag name": "", + "Add a short description about what this modelfile does": "", + "Add a short title for this prompt": "", + "Add a tag": "", + "Add Docs": "", + "Add Files": "", + "Add message": "", + "add tags": "", + "Adjusting these settings will apply changes universally to all users.": "", + "admin": "", + "Admin Panel": "", + "Admin Settings": "", + "Advanced Parameters": "", + "all": "", + "All Users": "", + "Allow": "", + "Allow Chat Deletion": "", + "alphanumeric characters and hyphens": "", + "Already have an account?": "", "an assistant": "", - "and": "and", - "API Base URL": "API Base URL", - "API Key": "API Key", - "API RPM": "API RPM", - "are allowed - Activate this command by typing": "are allowed - Activate this command by typing", + "and": "", + "API Base URL": "", + "API Key": "", + "API RPM": "", + "are allowed - Activate this command by typing": "", "Are you sure?": "", - "Audio": "Audio", - "Auto-playback response": "Auto-playback response", - "Auto-send input after 3 sec.": "Auto-send input after 3 sec.", - "AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", + "Audio": "", + "Auto-playback response": "", + "Auto-send input after 3 sec.": "", + "AUTOMATIC1111 Base URL": "", "AUTOMATIC1111 Base URL is required.": "", - "available!": "available!", - "Back": "Back", - "Builder Mode": "Builder Mode", - "Cancel": "Cancel", - "Categories": "Categories", - "Change Password": "Change Password", - "Chat": "Chat", - "Chat History": "Chat History", - "Chat History is off for this browser.": "Chat History is off for this browser.", - "Chats": "Chats", - "Check Again": "Check Again", - "Check for updates": "Check for updates", - "Checking for updates...": "Checking for updates...", - "Choose a model before saving...": "Choose a model before saving...", - "Chunk Overlap": "Chunk Overlap", - "Chunk Params": "Chunk Params", - "Chunk Size": "Chunk Size", - "Click here for help.": "Click here for help.", - "Click here to check other modelfiles.": "Click here to check other modelfiles.", + "available!": "", + "Back": "", + "Builder Mode": "", + "Cancel": "", + "Categories": "", + "Change Password": "", + "Chat": "", + "Chat History": "", + "Chat History is off for this browser.": "", + "Chats": "", + "Check Again": "", + "Check for updates": "", + "Checking for updates...": "", + "Choose a model before saving...": "", + "Chunk Overlap": "", + "Chunk Params": "", + "Chunk Size": "", + "Click here for help.": "", + "Click here to check other modelfiles.": "", "Click here to select": "", "Click here to select documents.": "", - "click here.": "click here.", - "Click on the user role button to change a user's role.": "Click on the user role button to change a user's role.", - "Close": "Close", - "Collection": "Collection", - "Command": "Command", - "Confirm Password": "Confirm Password", - "Connections": "Connections", - "Content": "Content", - "Context Length": "Context Length", - "Conversation Mode": "Conversation Mode", - "Copy last code block": "Copy last code block", - "Copy last response": "Copy last response", - "Copying to clipboard was successful!": "Copying to clipboard was successful!", - "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':", - "Create a modelfile": "Create a modelfile", - "Create Account": "Create Account", - "Created at": "Created at", - "Created by": "Created by", - "Current Model": "Current Model", - "Current Password": "Current Password", - "Custom": "Custom", - "Customize Ollama models for a specific purpose": "Customize Ollama models for a specific purpose", - "Dark": "Dark", - "Database": "Database", - "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", - "Default": "Default", + "click here.": "", + "Click on the user role button to change a user's role.": "", + "Close": "", + "Collection": "", + "Command": "", + "Confirm Password": "", + "Connections": "", + "Content": "", + "Context Length": "", + "Conversation Mode": "", + "Copy last code block": "", + "Copy last response": "", + "Copying to clipboard was successful!": "", + "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "", + "Create a modelfile": "", + "Create Account": "", + "Created at": "", + "Created by": "", + "Current Model": "", + "Current Password": "", + "Custom": "", + "Customize Ollama models for a specific purpose": "", + "Dark": "", + "Database": "", + "DD/MM/YYYY HH:mm": "", + "Default": "", "Default (Automatic1111)": "", - "Default (Web API)": "Default (Web API)", - "Default model updated": "Default model updated", - "Default Prompt Suggestions": "Default Prompt Suggestions", - "Default User Role": "Default User Role", - "delete": "delete", - "Delete a model": "Delete a model", - "Delete chat": "Delete chat", - "Delete Chats": "Delete Chats", - "Deleted {{deleteModelTag}}": "Deleted {{deleteModelTag}}", - "Deleted {tagName}": "Deleted {tagName}", - "Description": "Description", - "Desktop Notifications": "Notification", - "Disabled": "Disabled", - "Discover a modelfile": "Discover a modelfile", - "Discover a prompt": "Discover a prompt", - "Discover, download, and explore custom prompts": "Discover, download, and explore custom prompts", - "Discover, download, and explore model presets": "Discover, download, and explore model presets", - "Display the username instead of You in the Chat": "Display the username instead of 'You' in the Chat", - "Document": "Document", - "Document Settings": "Document Settings", - "Documents": "Documents", - "does not make any external connections, and your data stays securely on your locally hosted server.": "does not make any external connections, and your data stays securely on your locally hosted server.", - "Don't Allow": "Don't Allow", - "Don't have an account?": "Don't have an account?", - "Download as a File": "Download as a File", - "Download Database": "Download Database", - "Drop any files here to add to the conversation": "Drop any files here to add to the conversation", - "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.", - "Edit Doc": "Edit Doc", - "Edit User": "Edit User", - "Email": "Email", - "Enable Chat History": "Enable Chat History", - "Enable New Sign Ups": "Enable New Sign Ups", - "Enabled": "Enabled", + "Default (Web API)": "", + "Default model updated": "", + "Default Prompt Suggestions": "", + "Default User Role": "", + "delete": "", + "Delete a model": "", + "Delete chat": "", + "Delete Chats": "", + "Deleted {{deleteModelTag}}": "", + "Deleted {tagName}": "", + "Description": "", + "Desktop Notifications": "", + "Disabled": "", + "Discover a modelfile": "", + "Discover a prompt": "", + "Discover, download, and explore custom prompts": "", + "Discover, download, and explore model presets": "", + "Display the username instead of You in the Chat": "", + "Document": "", + "Document Settings": "", + "Documents": "", + "does not make any external connections, and your data stays securely on your locally hosted server.": "", + "Don't Allow": "", + "Don't have an account?": "", + "Download as a File": "", + "Download Database": "", + "Drop any files here to add to the conversation": "", + "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "", + "Edit Doc": "", + "Edit User": "", + "Email": "", + "Enable Chat History": "", + "Enable New Sign Ups": "", + "Enabled": "", "Enter {{role}} message here": "", "Enter API Key": "", "Enter Chunk Overlap": "", @@ -135,229 +135,229 @@ "Enter Max Tokens (litellm_params.max_tokens)": "", "Enter model tag (e.g. {{modelTag}})": "", "Enter Number of Steps (e.g. 50)": "", - "Enter stop sequence": "Enter stop sequence", + "Enter stop sequence": "", "Enter Top K": "", "Enter URL (e.g. http://127.0.0.1:7860/)": "", - "Enter Your Email": "Enter Your Email", - "Enter Your Full Name": "Enter Your Full Name", - "Enter Your Password": "Enter Your Password", - "Experimental": "Experimental", - "Export All Chats (All Users)": "Export All Chats (All Users)", - "Export Chats": "Export Chats", - "Export Documents Mapping": "Export Documents Mapping", - "Export Modelfiles": "Export Modelfiles", - "Export Prompts": "Export Prompts", - "Failed to read clipboard contents": "Failed to read clipboard contents", - "File Mode": "File Mode", - "File not found.": "File not found.", - "Focus chat input": "Focus chat input", - "Format your variables using square brackets like this:": "Format your variables using square brackets like this:", - "From (Base Model)": "From (Base Model)", - "Full Screen Mode": "Full Screen Mode", - "General": "General", - "General Settings": "General Settings", - "Hello, {{name}}": "Hello, {{name}}", - "Hide": "Hide", - "Hide Additional Params": "Hide Additional Params", - "How can I help you today?": "How can I help you today?", - "Image Generation (Experimental)": "Image Generation (Experimental)", + "Enter Your Email": "", + "Enter Your Full Name": "", + "Enter Your Password": "", + "Experimental": "", + "Export All Chats (All Users)": "", + "Export Chats": "", + "Export Documents Mapping": "", + "Export Modelfiles": "", + "Export Prompts": "", + "Failed to read clipboard contents": "", + "File Mode": "", + "File not found.": "", + "Focus chat input": "", + "Format your variables using square brackets like this:": "", + "From (Base Model)": "", + "Full Screen Mode": "", + "General": "", + "General Settings": "", + "Hello, {{name}}": "", + "Hide": "", + "Hide Additional Params": "", + "How can I help you today?": "", + "Image Generation (Experimental)": "", "Image Generation Engine": "", - "Image Settings": "Image Settings", - "Images": "Images", - "Import Chats": "Import Chats", - "Import Documents Mapping": "Import Documents Mapping", - "Import Modelfiles": "Import Modelfiles", - "Import Prompts": "Import Prompts", - "Include `--api` flag when running stable-diffusion-webui": "Include `--api` flag when running stable-diffusion-webui", - "Interface": "Interface", - "join our Discord for help.": "join our Discord for help.", - "JSON": "JSON", - "JWT Expiration": "JWT Expiration", - "JWT Token": "JWT Token", - "Keep Alive": "Keep Alive", - "Keyboard shortcuts": "Keyboard shortcuts", - "Language": "Language", - "Light": "Light", - "Listening...": "Listening...", - "LLMs can make mistakes. Verify important information.": "LLMs can make mistakes. Verify important information.", - "Made by OpenWebUI Community": "Made by OpenWebUI Community", - "Make sure to enclose them with": "Make sure to enclose them with", - "Manage LiteLLM Models": "Manage LiteLLM Models", - "Manage Models": "Manage Models", - "Manage Ollama Models": "Manage Ollama Models", - "Max Tokens": "Max Tokens", - "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "Maximum of 3 models can be downloaded simultaneously. Please try again later.", - "Mirostat": "Mirostat", - "Mirostat Eta": "Mirostat Eta", - "Mirostat Tau": "Mirostat Tau", - "MMMM DD, YYYY": "MMMM DD, YYYY", - "Model '{{modelName}}' has been successfully downloaded.": "Model '{{modelName}}' has been successfully downloaded.", - "Model '{{modelTag}}' is already in queue for downloading.": "Model '{{modelTag}}' is already in queue for downloading.", - "Model {{modelId}} not found": "Model {{modelId}} not found", - "Model {{modelName}} already exists.": "Model {{modelName}} already exists.", - "Model Name": "Model Name", - "Model not selected": "Model not selected", - "Model Tag Name": "Model Tag Name", - "Model Whitelisting": "Model Whitelisting", - "Model(s) Whitelisted": "Model(s) Whitelisted", - "Modelfile": "Modelfile", - "Modelfile Advanced Settings": "Modelfile Advanced Settings", - "Modelfile Content": "Modelfile Content", - "Modelfiles": "Modelfiles", - "Models": "Models", - "My Documents": "My Documents", - "My Modelfiles": "My Modelfiles", - "My Prompts": "My Prompts", - "Name": "Name", - "Name Tag": "Name Tag", - "Name your modelfile": "Name your modelfile", - "New Chat": "New Chat", - "New Password": "New Password", - "Not sure what to add?": "Not sure what to add?", - "Not sure what to write? Switch to": "Not sure what to write? Switch to", - "Off": "Off", - "Okay, Let's Go!": "Okay, Let's Go!", + "Image Settings": "", + "Images": "", + "Import Chats": "", + "Import Documents Mapping": "", + "Import Modelfiles": "", + "Import Prompts": "", + "Include `--api` flag when running stable-diffusion-webui": "", + "Interface": "", + "join our Discord for help.": "", + "JSON": "", + "JWT Expiration": "", + "JWT Token": "", + "Keep Alive": "", + "Keyboard shortcuts": "", + "Language": "", + "Light": "", + "Listening...": "", + "LLMs can make mistakes. Verify important information.": "", + "Made by OpenWebUI Community": "", + "Make sure to enclose them with": "", + "Manage LiteLLM Models": "", + "Manage Models": "", + "Manage Ollama Models": "", + "Max Tokens": "", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "", + "Mirostat": "", + "Mirostat Eta": "", + "Mirostat Tau": "", + "MMMM DD, YYYY": "", + "Model '{{modelName}}' has been successfully downloaded.": "", + "Model '{{modelTag}}' is already in queue for downloading.": "", + "Model {{modelId}} not found": "", + "Model {{modelName}} already exists.": "", + "Model Name": "", + "Model not selected": "", + "Model Tag Name": "", + "Model Whitelisting": "", + "Model(s) Whitelisted": "", + "Modelfile": "", + "Modelfile Advanced Settings": "", + "Modelfile Content": "", + "Modelfiles": "", + "Models": "", + "My Documents": "", + "My Modelfiles": "", + "My Prompts": "", + "Name": "", + "Name Tag": "", + "Name your modelfile": "", + "New Chat": "", + "New Password": "", + "Not sure what to add?": "", + "Not sure what to write? Switch to": "", + "Off": "", + "Okay, Let's Go!": "", "Ollama Base URL": "", - "Ollama Version": "Ollama Version", - "On": "On", - "Only": "Only", - "Only alphanumeric characters and hyphens are allowed in the command string.": "Only alphanumeric characters and hyphens are allowed in the command string.", - "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.", - "Oops! Looks like the URL is invalid. Please double-check and try again.": "Oops! Looks like the URL is invalid. Please double-check and try again.", - "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.", - "Open": "Open", - "Open AI": "Open AI", + "Ollama Version": "", + "On": "", + "Only": "", + "Only alphanumeric characters and hyphens are allowed in the command string.": "", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "", + "Oops! Looks like the URL is invalid. Please double-check and try again.": "", + "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "", + "Open": "", + "Open AI": "", "Open AI (Dall-E)": "", - "Open new chat": "Open new chat", - "OpenAI API": "OpenAI API", + "Open new chat": "", + "OpenAI API": "", "OpenAI API Key": "", "OpenAI API Key is required.": "", - "or": "or", - "Parameters": "Parameters", - "Password": "Password", - "PDF Extract Images (OCR)": "PDF Extract Images (OCR)", - "pending": "pending", - "Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", - "Playground": "Playground", - "Profile": "Profile", - "Prompt Content": "Prompt Content", - "Prompt suggestions": "Prompt suggestions", - "Prompts": "Prompts", - "Pull a model from Ollama.com": "Pull a model from Ollama.com", - "Pull Progress": "Pull Progress", - "Query Params": "Query Params", - "RAG Template": "RAG Template", - "Raw Format": "Raw Format", - "Record voice": "Record voice", - "Redirecting you to OpenWebUI Community": "Redirecting you to OpenWebUI Community", - "Release Notes": "Release Notes", - "Repeat Last N": "Repeat Last N", - "Repeat Penalty": "Repeat Penalty", - "Request Mode": "Request Mode", - "Reset Vector Storage": "Reset Vector Storage", - "Response AutoCopy to Clipboard": "Response AutoCopy to Clipboard", - "Role": "Role", - "Rosé Pine": "Rosé Pine", - "Rosé Pine Dawn": "Rosé Pine Dawn", - "Save": "Save", - "Save & Create": "Save & Create", - "Save & Submit": "Save & Submit", - "Save & Update": "Save & Update", - "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through", - "Scan": "Scan", - "Scan complete!": "Scan complete!", - "Scan for documents from {{path}}": "Scan for documents from {{path}}", - "Search": "Search", - "Search Documents": "Search Documents", - "Search Prompts": "Search Prompts", - "See readme.md for instructions": "See readme.md for instructions", - "See what's new": "See what's new", - "Seed": "Seed", + "or": "", + "Parameters": "", + "Password": "", + "PDF Extract Images (OCR)": "", + "pending": "", + "Permission denied when accessing microphone: {{error}}": "", + "Playground": "", + "Profile": "", + "Prompt Content": "", + "Prompt suggestions": "", + "Prompts": "", + "Pull a model from Ollama.com": "", + "Pull Progress": "", + "Query Params": "", + "RAG Template": "", + "Raw Format": "", + "Record voice": "", + "Redirecting you to OpenWebUI Community": "", + "Release Notes": "", + "Repeat Last N": "", + "Repeat Penalty": "", + "Request Mode": "", + "Reset Vector Storage": "", + "Response AutoCopy to Clipboard": "", + "Role": "", + "Rosé Pine": "", + "Rosé Pine Dawn": "", + "Save": "", + "Save & Create": "", + "Save & Submit": "", + "Save & Update": "", + "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "", + "Scan": "", + "Scan complete!": "", + "Scan for documents from {{path}}": "", + "Search": "", + "Search Documents": "", + "Search Prompts": "", + "See readme.md for instructions": "", + "See what's new": "", + "Seed": "", "Select a mode": "", - "Select a model": "Select a model", + "Select a model": "", "Select an Ollama instance": "", - "Send a Message": "Send a Message", - "Send message": "Send message", - "Server connection verified": "Server connection verified", - "Set as default": "Set as default", - "Set Default Model": "Set Default Model", - "Set Image Size": "Set Image Size", - "Set Steps": "Set Steps", - "Set Title Auto-Generation Model": "Set Title Auto-Generation Model", - "Set Voice": "Set Voice", - "Settings": "Settings", - "Settings saved successfully!": "Settings saved successfully!", - "Share to OpenWebUI Community": "Share to OpenWebUI Community", - "short-summary": "short-summary", - "Show": "Show", - "Show Additional Params": "Show Additional Params", - "Show shortcuts": "Show shortcuts", - "sidebar": "sidebar", - "Sign in": "Sign in", - "Sign Out": "Sign Out", - "Sign up": "Sign up", - "Speech recognition error: {{error}}": "Speech recognition error: {{error}}", - "Speech-to-Text Engine": "Speech-to-Text Engine", - "SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.", - "Stop Sequence": "Stop Sequence", - "STT Settings": "STT Settings", - "Submit": "Submit", - "Success": "Success", - "Successfully updated.": "Successfully updated.", - "Sync All": "Sync All", - "System": "System", - "System Prompt": "System Prompt", - "Tags": "Tags", - "Temperature": "Temperature", - "Template": "Template", - "Text Completion": "Text Completion", - "Text-to-Speech Engine": "Text-to-Speech Engine", - "Tfs Z": "Tfs Z", - "Theme": "Theme", - "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "This ensures that your valuable conversations are securely saved to your backend database. Thank you!", - "This setting does not sync across browsers or devices.": "This setting does not sync across browsers or devices.", - "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.", - "Title": "Title", - "Title Auto-Generation": "Title Auto-Generation", - "Title Generation Prompt": "Title Generation Prompt", - "to": "to", - "To access the available model names for downloading,": "To access the available model names for downloading,", - "To access the GGUF models available for downloading,": "To access the GGUF models available for downloading,", - "to chat input.": "to chat input.", - "Toggle settings": "Toggle settings", - "Toggle sidebar": "Toggle sidebar", - "Top K": "Top K", - "Top P": "Top P", - "Trouble accessing Ollama?": "Trouble accessing Ollama?", - "TTS Settings": "TTS Settings", + "Send a Message": "", + "Send message": "", + "Server connection verified": "", + "Set as default": "", + "Set Default Model": "", + "Set Image Size": "", + "Set Steps": "", + "Set Title Auto-Generation Model": "", + "Set Voice": "", + "Settings": "", + "Settings saved successfully!": "", + "Share to OpenWebUI Community": "", + "short-summary": "", + "Show": "", + "Show Additional Params": "", + "Show shortcuts": "", + "sidebar": "", + "Sign in": "", + "Sign Out": "", + "Sign up": "", + "Speech recognition error: {{error}}": "", + "Speech-to-Text Engine": "", + "SpeechRecognition API is not supported in this browser.": "", + "Stop Sequence": "", + "STT Settings": "", + "Submit": "", + "Success": "", + "Successfully updated.": "", + "Sync All": "", + "System": "", + "System Prompt": "", + "Tags": "", + "Temperature": "", + "Template": "", + "Text Completion": "", + "Text-to-Speech Engine": "", + "Tfs Z": "", + "Theme": "", + "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "", + "This setting does not sync across browsers or devices.": "", + "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "", + "Title": "", + "Title Auto-Generation": "", + "Title Generation Prompt": "", + "to": "", + "To access the available model names for downloading,": "", + "To access the GGUF models available for downloading,": "", + "to chat input.": "", + "Toggle settings": "", + "Toggle sidebar": "", + "Top K": "", + "Top P": "", + "Trouble accessing Ollama?": "", + "TTS Settings": "", "Type Hugging Face Resolve (Download) URL": "", - "Uh-oh! There was an issue connecting to {{provider}}.": "Uh-oh! There was an issue connecting to {{provider}}.", - "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "Unknown File Type '{{file_type}}', but accepting and treating as plain text", - "Update password": "Update password", - "Upload a GGUF model": "Upload a GGUF model", - "Upload files": "Upload files", - "Upload Progress": "Upload Progress", - "URL Mode": "URL Mode", - "Use '#' in the prompt input to load and select your documents.": "Use '#' in the prompt input to load and select your documents.", + "Uh-oh! There was an issue connecting to {{provider}}.": "", + "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "", + "Update password": "", + "Upload a GGUF model": "", + "Upload files": "", + "Upload Progress": "", + "URL Mode": "", + "Use '#' in the prompt input to load and select your documents.": "", "Use Gravatar": "", - "user": "user", - "User Permissions": "User Permissions", - "Users": "Users", - "Utilize": "Utilize", - "Valid time units:": "Valid time units:", - "variable": "variable", - "variable to have them replaced with clipboard content.": "variable to have them replaced with clipboard content.", - "Version": "Version", - "Web": "Web", - "WebUI Add-ons": "WebUI Add-ons", - "WebUI Settings": "WebUI Settings", - "WebUI will make requests to": "WebUI will make requests to", - "What’s New in": "What’s New in", - "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "When history is turned off, new chats on this browser won't appear in your history on any of your devices.", - "Whisper (Local)": "Whisper (Local)", - "Write a prompt suggestion (e.g. Who are you?)": "Write a prompt suggestion (e.g. Who are you?)", - "Write a summary in 50 words that summarizes [topic or keyword].": "Write a summary in 50 words that summarizes [topic or keyword].", - "You": "You", - "You're a helpful assistant.": "You're a helpful assistant.", - "You're now logged in.": "You're now logged in." + "user": "", + "User Permissions": "", + "Users": "", + "Utilize": "", + "Valid time units:": "", + "variable": "", + "variable to have them replaced with clipboard content.": "", + "Version": "", + "Web": "", + "WebUI Add-ons": "", + "WebUI Settings": "", + "WebUI will make requests to": "", + "What’s New in": "", + "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "", + "Whisper (Local)": "", + "Write a prompt suggestion (e.g. Who are you?)": "", + "Write a summary in 50 words that summarizes [topic or keyword].": "", + "You": "", + "You're a helpful assistant.": "", + "You're now logged in.": "" } From 0c021e42f5c4f50444d6223221a884c5c7501ddf Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Tue, 26 Mar 2024 23:15:51 +0330 Subject: [PATCH 03/42] rename config key to default_locale --- backend/data/config.json | 2 +- backend/main.py | 2 +- src/routes/+layout.svelte | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/data/config.json b/backend/data/config.json index 7d15c9e69..91259c3f1 100644 --- a/backend/data/config.json +++ b/backend/data/config.json @@ -1,7 +1,7 @@ { "version": 0, "ui": { - "locale": "en-US", + "default_locale": "en-US", "prompt_suggestions": [ { "title": [ diff --git a/backend/main.py b/backend/main.py index 6a5206213..b118c673a 100644 --- a/backend/main.py +++ b/backend/main.py @@ -167,7 +167,7 @@ async def get_app_config(): "status": True, "name": WEBUI_NAME, "version": VERSION, - "locale": CONFIG_DATA["ui"]["locale"], + "default_locale": CONFIG_DATA["ui"]["default_locale"], "images": images_app.state.ENABLED, "default_models": webui_app.state.DEFAULT_MODELS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3334e0d2e..4ab2a62e4 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -25,8 +25,8 @@ if (backendConfig) { // Save Backend Status to Store await config.set(backendConfig); - if ($config.locale) { - initI18n($config.locale); + if ($config.default_locale) { + initI18n($config.default_locale); } else { initI18n(); } From addee2f248fd2fa6b4c01a57c591751739dfb1d9 Mon Sep 17 00:00:00 2001 From: ryankupk Date: Tue, 26 Mar 2024 23:07:01 +0000 Subject: [PATCH 04/42] Update svelte.config.js to suppress unused CSS selector warnings --- svelte.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/svelte.config.js b/svelte.config.js index a3c75a019..be8b3f529 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -16,7 +16,15 @@ const config = { assets: 'build', fallback: 'index.html' }) - } + }, + onwarn: (warning, handler) => { + const { code, _ } = warning; + if (code === "css-unused-selector") + return; + + handler(warning); + }, + }; export default config; From f87d5d3d9bc946a951cac119326fcf5482a4496b Mon Sep 17 00:00:00 2001 From: Lim Geun Date: Wed, 27 Mar 2024 23:05:45 +0900 Subject: [PATCH 05/42] add ko-KR translation --- src/lib/i18n/locales/ko-KR/translation.json | 362 ++++++++++++++++++++ src/lib/i18n/locales/languages.json | 4 + 2 files changed, 366 insertions(+) create mode 100644 src/lib/i18n/locales/ko-KR/translation.json diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json new file mode 100644 index 000000000..87a9efe33 --- /dev/null +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -0,0 +1,362 @@ +{ + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'초', '분', '시간', '일', '주' 또는 만료 없음 '-1'", + "(Beta)": "(Beta)", + "(e.g. `sh webui.sh --api`)": "(예: `sh webui.sh --api`)", + "(latest)": "(latest)", + "{{modelName}} is thinking...": "{{modelName}} 이(가) 생각중입니다....", + "{{webUIName}} Backend Required": "{{webUIName}} 백엔드가 필요합니다.", + "a user": "사용자", + "About": "소개", + "Account": "계정", + "Action": "액션", + "Add a model": "모델 추가", + "Add a model tag name": "모델 태그명 추가", + "Add a short description about what this modelfile does": "이 모델파일이 하는 일에 대한 간단한 설명 추가", + "Add a short title for this prompt": "이 프롬프트에 대한 간단한 제목 추가", + "Add a tag": "태그 추가", + "Add Docs": "문서 추가", + "Add Files": "파일 추가", + "Add message": "메시지 추가", + "add tags": "태그들 추가", + "Adjusting these settings will apply changes universally to all users.": "이 설정을 조정하면 모든 사용자에게 적용됩니다.", + "admin": "관리자", + "Admin Panel": "관리자 패널", + "Admin Settings": "관리자 설정", + "Advanced Parameters": "고급 매개변수", + "all": "모두", + "All Users": "모든 사용자", + "Allow": "허용", + "Allow Chat Deletion": "채팅 삭제 허용", + "alphanumeric characters and hyphens": "영문자,숫자 및 하이픈", + "Already have an account?": "이미 계정이 있으신가요?", + "an assistant": "어시스턴트", + "and": "그리고", + "API Base URL": "API 기본 URL", + "API Key": "API키", + "API RPM": "API RPM", + "are allowed - Activate this command by typing": "허용됩니다 - 이 명령을 활성화하려면 입력하세요.", + "Are you sure?": "확실합니까?", + "Audio": "오디오", + "Auto-playback response": "응답 자동 재생", + "Auto-send input after 3 sec.": "3초 후 입력 자동 전송", + "AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", + "AUTOMATIC1111 Base URL is required.": "AUTOMATIC1111 Base URL이 필요합니다.", + "available!": "사용 가능!", + "Back": "뒤로가기", + "Builder Mode": "빌더 모드", + "Cancel": "취소", + "Categories": "분류", + "Change Password": "비밀번호 변경", + "Chat": "채팅", + "Chat History": "채팅 기록", + "Chat History is off for this browser.": "이 브라우저에서 채팅 기록이 꺼져 있습니다.", + "Chats": "채팅", + "Check Again": "다시 확인", + "Check for updates": "업데이트 확인", + "Checking for updates...": "업데이트 확인중...", + "Choose a model before saving...": "저장하기 전에 모델을 선택하세요...", + "Chunk Overlap": "Chunk Overlap", + "Chunk Params": "Chunk Params", + "Chunk Size": "Chunk Size", + "Click here for help.": "도움말을 보려면 여기를 클릭하세요.", + "Click here to check other modelfiles.": "다른 모델파일을 확인하려면 여기를 클릭하세요.", + "Click here to select": "선택하려면 여기를 클릭하세요.", + "Click here to select documents.": "문서를 선택하려면 여기를 클릭하세요.", + "click here.": "여기를 클릭하세요.", + "Click on the user role button to change a user's role.": "사용자 역할 버튼을 클릭하여 사용자의 역할을 변경하세요.", + "Close": "닫기", + "Collection": "컬렉션", + "Command": "명령", + "Confirm Password": "비밀번호 확인", + "Connections": "연결", + "Content": "내용", + "Context Length": "내용 길이", + "Conversation Mode": "대화 모드", + "Copy last code block": "마지막 코드 블록 복사", + "Copy last response": "마지막 응답 복사", + "Copying to clipboard was successful!": "클립보드에 복사되었습니다!", + "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "다음 질문에 대한 제목으로 간결한 3-5 단어 문구를 만드되 3-5 단어 제한을 엄격히 준수하고 'title' 단어 사용을 피하세요:", + "Create a modelfile": "모델파일 만들기", + "Create Account": "계정 만들기", + "Created at": "생성일", + "Created by": "생성자", + "Current Model": "현재 모델", + "Current Password": "현재 비밀번호", + "Custom": "사용자 정의", + "Customize Ollama models for a specific purpose": "특정 목적으로 Ollama 모델 사용자 정의", + "Dark": "어두운", + "Database": "데이터베이스", + "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", + "Default": "기본값", + "Default (Automatic1111)": "기본값 (Automatic1111)", + "Default (Web API)": "기본값 (Web API)", + "Default model updated": "기본 모델이 업데이트되었습니다.", + "Default Prompt Suggestions": "기본 프롬프트 제안", + "Default User Role": "기본 사용자 역할", + "delete": "삭제", + "Delete a model": "모델 삭제", + "Delete chat": "채팅 삭제", + "Delete Chats": "채팅들 삭제", + "Deleted {{deleteModelTag}}": "{{deleteModelTag}} 삭제됨", + "Deleted {tagName}": "{tagName} 삭제됨", + "Description": "설명", + "Desktop Notifications": "알림", + "Disabled": "비활성화", + "Discover a modelfile": "모델파일 검색", + "Discover a prompt": "프롬프트 검색", + "Discover, download, and explore custom prompts": "사용자 정의 프롬프트 검색, 다운로드 및 탐색", + "Discover, download, and explore model presets": "모델 사전 설정 검색, 다운로드 및 탐색", + "Display the username instead of You in the Chat": "채팅에서 'You' 대신 사용자 이름 표시", + "Document": "문서", + "Document Settings": "문서 설정", + "Documents": "문서들", + "does not make any external connections, and your data stays securely on your locally hosted server.": "어떠한 외부 연결도 하지 않으며, 데이터는 로컬에서 호스팅되는 서버에 안전하게 유지됩니다.", + "Don't Allow": "허용 안 함", + "Don't have an account?": "계정이 없으신가요?", + "Download as a File": "파일로 다운로드", + "Download Database": "데이터베이스 다운로드", + "Drop any files here to add to the conversation": "대화에 추가할 파일을 여기에 드롭하세요.", + "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "예: '30s','10m'. 유효한 시간 단위는 's', 'm', 'h'입니다.", + "Edit Doc": "문서 편집", + "Edit User": "사용자 편집", + "Email": "이메일", + "Enable Chat History": "채팅 기록 활성화", + "Enable New Sign Ups": "새 회원가입 활성화", + "Enabled": "활성화", + "Enter {{role}} message here": "여기에 {{role}} 메시지 입력", + "Enter API Key": "API 키 입력", + "Enter Chunk Overlap": "청크 오버랩 입력", + "Enter Chunk Size": "청크 크기 입력", + "Enter Image Size (e.g. 512x512)": "이미지 크기 입력(예: 512x512)", + "Enter LiteLLM API Base URL (litellm_params.api_base)": "LiteLLM API 기본 URL 입력(litellm_params.api_base)", + "Enter LiteLLM API Key (litellm_params.api_key)": "LiteLLM API 키 입력(litellm_params.api_key)", + "Enter LiteLLM API RPM (litellm_params.rpm)": "LiteLLM API RPM 입력(litellm_params.rpm)", + "Enter LiteLLM Model (litellm_params.model)": "LiteLLM 모델 입력(litellm_params.model)", + "Enter Max Tokens (litellm_params.max_tokens)": "최대 토큰 수 입력(litellm_params.max_tokens)", + "Enter model tag (e.g. {{modelTag}})": "모델 태그 입력(예: {{modelTag}})", + "Enter Number of Steps (e.g. 50)": "단계 수 입력(예: 50)", + "Enter stop sequence": "중지 시퀀스 입력", + "Enter Top K": "Top K 입력", + "Enter URL (e.g. http://127.0.0.1:7860/)": "URL 입력(예: http://127.0.0.1:7860/)", + "Enter Your Email": "이메일 입력", + "Enter Your Full Name": "전체 이름 입력", + "Enter Your Password": "비밀번호 입력", + "Experimental": "실험적", + "Export All Chats (All Users)": "모든 채팅 내보내기 (모든 사용자)", + "Export Chats": "채팅 내보내기", + "Export Documents Mapping": "문서 매핑 내보내기", + "Export Modelfiles": "모델파일 내보내기", + "Export Prompts": "프롬프트 내보내기", + "Failed to read clipboard contents": "클립보드 내용을 읽는 데 실패했습니다.", + "File Mode": "파일 모드", + "File not found.": "파일을 찾을 수 없습니다.", + "Focus chat input": "채팅 입력 포커스", + "Format your variables using square brackets like this:": "이렇게 대괄호를 사용하여 변수를 형식화하세요:", + "From (Base Model)": "출처(기본 모델)", + "Full Screen Mode": "전체 화면 모드", + "General": "일반", + "General Settings": "일반 설정", + "Hello, {{name}}": "안녕하세요, {{name}}", + "Hide": "숨기기", + "Hide Additional Params": "추가 매개변수 숨기기", + "How can I help you today?": "오늘 어떻게 도와드릴까요?", + "Image Generation (Experimental)": "이미지 생성(실험적)", + "Image Generation Engine": "이미지 생성 엔진", + "Image Settings": "이미지 설정", + "Images": "이미지", + "Import Chats": "채팅 가져오기", + "Import Documents Mapping": "문서 매핑 가져오기", + "Import Modelfiles": "모델파일 가져오기", + "Import Prompts": "프롬프트 가져오기", + "Include --api flag when running stable-diffusion-webui": "stable-diffusion-webui를 실행할 때 --api 플래그 포함", + "Interface": "인터페이스", + "join our Discord for help.": "도움말을 보려면 Discord에 가입하세요.", + "JSON": "JSON", + "JWT Expiration": "JWT 만료", + "JWT Token": "JWT 토큰", + "Keep Alive": "계속 유지하기", + "Keyboard shortcuts": "키보드 단축키", + "Language": "언어", + "Light": "밝음", + "Listening...": "청취 중...", + "LLMs can make mistakes. Verify important information.": "LLM은 실수를 할 수 있습니다. 중요한 정보를 확인하세요.", + "Made by OpenWebUI Community": "OpenWebUI 커뮤니티에서 제작", + "Make sure to enclose them with": "다음으로 묶는 것을 잊지 마세요:", + "Manage LiteLLM Models": "LiteLLM 모델 관리", + "Manage Models": "모델 관리", + "Manage Ollama Models": "Ollama 모델 관리", + "Max Tokens": "최대 토큰 수", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "최대 3개의 모델을 동시에 다운로드할 수 있습니다. 나중에 다시 시도하세요.", + "Mirostat": "Mirostat", + "Mirostat Eta": "Mirostat Eta", + "Mirostat Tau": "Mirostat Tau", + "Model '{{modelName}}' has been successfully downloaded.": "모델 '{{modelName}}'이(가) 성공적으로 다운로드되었습니다.", + "Model '{{modelTag}}' is already in queue for downloading.": "모델 '{{modelTag}}'이(가) 이미 다운로드 대기열에 있습니다.", + "Model {{modelId}} not found": "모델 {{modelId}}를 찾을 수 없습니다.", + "Model {{modelName}} already exists.": "모델 {{modelName}}이(가) 이미 존재합니다.", + "Model Name": "모델 이름", + "Model not selected": "모델이 선택되지 않았습니다.", + "Model Tag Name": "모델 태그 이름", + "Model Whitelisting": "모델 허용 목록", + "Model(s) Whitelisted": "허용된 모델", + "Modelfile": "모델파일", + "Modelfile Advanced Settings": "모델파일 고급 설정", + "Modelfile Content": "모델파일 내용", + "Modelfiles": "모델파일", + "Models": "모델", + "My Documents": "내 문서", + "My Modelfiles": "내 모델파일", + "My Prompts": "내 프롬프트", + "Name": "이름", + "Name Tag": "이름 태그", + "Name your modelfile": "모델파일 이름 지정", + "New Chat": "새 채팅", + "New Password": "새 비밀번호", + "Not sure what to add?": "추가할 것이 궁금하세요?", + "Not sure what to write? Switch to": "무엇을 쓸지 모르겠나요? 전환하세요.", + "Off": "끄기", + "Okay, Let's Go!": "그렇습니다, 시작합시다!", + "Ollama Base URL": "Ollama 기본 URL", + "Ollama Version": "Ollama 버전", + "On": "켜기", + "Only": "오직", + "Only alphanumeric characters and hyphens are allowed in the command string.": "명령어 문자열에는 영문자, 숫자 및 하이픈만 허용됩니다.", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "이런! 잠시만 기다려 주세요! 파일이 아직 처리 중입니다. 완벽하게 준비하고 있습니다. 잠시만 기다려주시면 준비가 되면 알려드리겠습니다.", + "Oops! Looks like the URL is invalid. Please double-check and try again.": "이런! URL이 잘못된 것 같습니다. 다시 한번 확인하고 다시 시도해주세요.", + "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "이런! 지원되지 않는 방식(프론트엔드 전용)을 사용하고 계십니다. 백엔드에서 WebUI를 제공해주세요.", + "Open": "열기", + "Open AI": "Open AI", + "Open AI (Dall-E)": "OpenAI (Dall-E)", + "Open new chat": "새 채팅 열기", + "OpenAI API": "OpenAI API", + "OpenAI API Key": "OpenAI API 키", + "OpenAI API Key is required.": "OpenAI API 키가 필요합니다.", + "or": "또는", + "Parameters": "매개변수", + "Password": "비밀번호", + "PDF Extract Images (OCR)": "PDF에서 이미지 추출 (OCR)", + "pending": "보류 중", + "Permission denied when accessing microphone: {{error}}": "마이크 액세스가 거부되었습니다: {{error}}", + "Playground": "놀이터", + "Profile": "프로필", + "Prompt Content": "프롬프트 내용", + "Prompt suggestions": "프롬프트 제안", + "Prompts": "프롬프트", + "Pull a model from Ollama.com": "Ollama.com에서 모델 가져오기", + "Pull Progress": "가져오기 진행 상황", + "Query Params": "쿼리 매개변수", + "RAG Template": "RAG 템플릿", + "Raw Format": "Raw 형식", + "Record voice": "음성 녹음", + "Redirecting you to OpenWebUI Community": "OpenWebUI 커뮤니티로 리디렉션하는 중", + "Release Notes": "릴리스 노트", + "Repeat Last N": "마지막 N 반복", + "Repeat Penalty": "반복 패널티", + "Request Mode": "요청 모드", + "Reset Vector Storage": "벡터 스토리지 초기화", + "Response AutoCopy to Clipboard": "응답 자동 클립보드 복사", + "Role": "역할", + "Rosé Pine": "로제 파인", + "Rosé Pine Dawn": "로제 파인 던", + "Save": "저장", + "Save & Create": "저장 및 생성", + "Save & Submit": "저장 및 제출", + "Save & Update": "저장 및 업데이트", + "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "브라우저의 저장소에 채팅 로그를 직접 저장하는 것은 더 이상 지원되지 않습니다. 아래 버튼을 클릭하여 채팅 로그를 다운로드하고 삭제하세요. 걱정 마세요. 백엔드를 통해 채팅 로그를 쉽게 다시 가져올 수 있습니다.", + "Scan": "스캔", + "Scan complete!": "스캔 완료!", + "Scan for documents from {{path}}": "{{path}}에서 문서 스캔", + "Search": "검색", + "Search Documents": "문서 검색", + "Search Prompts": "프롬프트 검색", + "See readme.md for instructions": "설명은 readme.md를 참조하세요.", + "See what's new": "새로운 기능 보기", + "Seed": "시드", + "Select a mode": "모드 선택", + "Select a model": "모델 선택", + "Select an Ollama instance": "Ollama 인스턴스 선택", + "Send a Message": "메시지 보내기", + "Send message": "메시지 보내기", + "Server connection verified": "서버 연결 확인됨", + "Set as default": "기본값으로 설정", + "Set Default Model": "기본 모델 설정", + "Set Image Size": "이미지 크기 설정", + "Set Steps": "단계 설정", + "Set Title Auto-Generation Model": "제목 자동 생성 모델 설정", + "Set Voice": "음성 설정", + "Settings": "설정", + "Settings saved successfully!": "설정이 성공적으로 저장되었습니다!", + "Share to OpenWebUI Community": "OpenWebUI 커뮤니티에 공유", + "short-summary": "간단한 요약", + "Show": "보이기", + "Show Additional Params": "추가 매개변수 보기", + "Show shortcuts": "단축키 보기", + "sidebar": "사이드바", + "Sign in": "로그인", + "Sign Out": "로그아웃", + "Sign up": "가입", + "Speech recognition error: {{error}}": "음성 인식 오류: {{error}}", + "Speech-to-Text Engine": "음성-텍스트 엔진", + "SpeechRecognition API is not supported in this browser.": "이 브라우저에서는 SpeechRecognition API를 지원하지 않습니다.", + "Stop Sequence": "중지 시퀀스", + "STT Settings": "STT 설정", + "Submit": "제출", + "Success": "성공", + "Successfully updated.": "성공적으로 업데이트되었습니다.", + "Sync All": "모두 동기화", + "System": "시스템", + "System Prompt": "시스템 프롬프트", + "Tags": "Tags", + "Temperature": "Temperature", + "Template": "Template", + "Text Completion": "텍스트 완성", + "Text-to-Speech Engine": "텍스트-음성 엔진", + "Tfs Z": "Tfs Z", + "Theme": "테마", + "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "이렇게 하면 소중한 대화 내용이 백엔드 데이터베이스에 안전하게 저장됩니다. 감사합니다!", + "This setting does not sync across browsers or devices.": "이 설정은 브라우저 또는 장치 간에 동기화되지 않습니다.", + "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "팁: 각 대체 후 채팅 입력에서 탭 키를 눌러 여러 개의 변수 슬롯을 연속적으로 업데이트하세요.", + "Title": "제목", + "Title Auto-Generation": "제목 자동 생성", + "Title Generation Prompt": "제목 생성 프롬프트", + "to": "~까지", + "To access the available model names for downloading,": "다운로드 가능한 모델명을 확인하려면,", + "To access the GGUF models available for downloading,": "다운로드 가능한 GGUF 모델을 확인하려면,", + "to chat input.": "채팅 입력으로.", + "Toggle settings": "설정 전환", + "Toggle sidebar": "사이드바 전환", + "Top K": "Top K", + "Top P": "Top P", + "Trouble accessing Ollama?": "Ollama에 접근하는 데 문제가 있나요?", + "TTS Settings": "TTS 설정", + "Type Hugging Face Resolve (Download) URL": "Hugging Face Resolve (다운로드) URL 입력", + "Uh-oh! There was an issue connecting to {{provider}}.": "앗! {{provider}}에 연결하는 데 문제가 있었습니다.", + "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "알 수 없는 파일 유형 '{{file_type}}', 하지만 일반 텍스트로 허용하고 처리합니다.", + "Update password": "비밀번호 업데이트", + "Upload a GGUF model": "GGUF 모델 업로드", + "Upload files": "파일 업로드", + "Upload Progress": "업로드 진행 상황", + "URL Mode": "URL 모드", + "Use '#' in the prompt input to load and select your documents.": "프롬프트 입력에서 '#'를 사용하여 문서를 로드하고 선택하세요.", + "Use Gravatar": "Gravatar 사용", + "user": "사용자", + "User Permissions": "사용자 권한", + "Users": "사용자", + "Utilize": "활용", + "Valid time units:": "유효한 시간 단위:", + "variable": "변수", + "variable to have them replaced with clipboard content.": "변수를 사용하여 클립보드 내용으로 바꾸세요.", + "Version": "버전", + "Web": "웹", + "WebUI Add-ons": "WebUI 애드온", + "WebUI Settings": "WebUI 설정", + "WebUI will make requests to": "WebUI가 요청할 대상:", + "What's New in": "새로운 기능", + "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "기록 기능이 꺼져 있으면 이 브라우저의 새 채팅이 다른 장치의 채팅 기록에 나타나지 않습니다.", + "Whisper (Local)": "위스퍼 (Local)", + "Write a prompt suggestion (e.g. Who are you?)": "프롬프트 제안 작성 (예: 당신은 누구인가요?)", + "Write a summary in 50 words that summarizes [topic or keyword].": "[주제 또는 키워드]에 대한 50단어 요약문 작성.", + "You": "당신", + "You're a helpful assistant.": "당신은 유용한 어시스턴트입니다.", + "You're now logged in.": "로그인되었습니다." +} diff --git a/src/lib/i18n/locales/languages.json b/src/lib/i18n/locales/languages.json index b2f3e36e6..becba8c2d 100644 --- a/src/lib/i18n/locales/languages.json +++ b/src/lib/i18n/locales/languages.json @@ -66,5 +66,9 @@ { "code": "zh-TW", "title": "Chinese (Traditional)" + }, + { + "code": "ko-KR", + "title": "Korean" } ] \ No newline at end of file From 976c714063b10cceabb7cb7310cb52731382e2f0 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 10:50:30 -0700 Subject: [PATCH 06/42] feat: OLED dark theme --- src/lib/components/chat/Settings/General.svelte | 15 ++++++++++++--- tailwind.config.js | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 35f777a78..e1869f828 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -97,6 +97,10 @@ themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; } + if (themeToApply === 'dark') { + document.documentElement.style.setProperty('--color-gray-900', '#171717'); + } + themes .filter((e) => e !== themeToApply) .forEach((e) => { @@ -113,10 +117,14 @@ }; const themeChangeHandler = (_theme: string) => { - theme.set(_theme); - localStorage.setItem('theme', _theme); + if (_theme === 'oled') { + document.documentElement.style.setProperty('--color-gray-900', '#000000'); + } else { + theme.set(_theme); + localStorage.setItem('theme', _theme); - applyTheme(_theme); + applyTheme(_theme); + } }; @@ -139,6 +147,7 @@ + diff --git a/tailwind.config.js b/tailwind.config.js index 4a2143191..63413ccdb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -16,8 +16,7 @@ export default { 700: '#4e4e4e', 800: '#333', 850: '#262626', - - 900: '#171717', + 900: 'var(--color-gray-900, #171717)', 950: '#0d0d0d' } }, From c24d9d3beab709479a88979f26728095f25d32ee Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 11:23:00 -0700 Subject: [PATCH 07/42] Add 'oled' theme option to themes list --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index e1869f828..fb05668eb 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -14,7 +14,7 @@ export let getModels: Function; // General - let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light']; + let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light', 'oled']; let selectedTheme = 'system'; let languages = []; From 19d21212527dab4008e9ce68d7108b5f20a38772 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 27 Mar 2024 13:08:43 -0700 Subject: [PATCH 08/42] fix: docker issue --- backend/config.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/config.py b/backend/config.py index 27311face..ff73baf75 100644 --- a/backend/config.py +++ b/backend/config.py @@ -117,7 +117,18 @@ else: log = logging.getLogger(__name__) log.info(f"GLOBAL_LOG_LEVEL: {GLOBAL_LOG_LEVEL}") -log_sources = ["AUDIO", "CONFIG", "DB", "IMAGES", "LITELLM", "MAIN", "MODELS", "OLLAMA", "OPENAI", "RAG"] +log_sources = [ + "AUDIO", + "CONFIG", + "DB", + "IMAGES", + "LITELLM", + "MAIN", + "MODELS", + "OLLAMA", + "OPENAI", + "RAG", +] SRC_LOG_LEVELS = {} @@ -239,7 +250,7 @@ OLLAMA_API_BASE_URL = os.environ.get( ) OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "") -KUBERNETES_SERVICE_HOST = os.environ.get("KUBERNETES_SERVICE_HOST", "") +K8S_FLAG = os.environ.get("K8S_FLAG", "") if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": OLLAMA_BASE_URL = ( @@ -249,9 +260,10 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": ) if ENV == "prod": - if OLLAMA_BASE_URL == "/ollama" and KUBERNETES_SERVICE_HOST == "": + if OLLAMA_BASE_URL == "/ollama": OLLAMA_BASE_URL = "http://host.docker.internal:11434" - else: + + elif K8S_FLAG: OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" From 25c71d8ac2eadea2babb25e2cc077c843ac5aea0 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:04:34 -0700 Subject: [PATCH 09/42] Update theme options and persist OLED dark theme if selected --- src/app.html | 6 +++++- .../components/chat/Settings/General.svelte | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/app.html b/src/app.html index c52cff98c..45b5d20e7 100644 --- a/src/app.html +++ b/src/app.html @@ -9,7 +9,11 @@ @@ -147,7 +150,7 @@ - + From dfeadf9595e6893bf5134e55ad911527071098f5 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:05:37 -0700 Subject: [PATCH 10/42] ordering of themes in select menu, group dark themes together --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 5e9c3c414..95b93824b 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -147,10 +147,10 @@ > + - From cf442097300c42fb7d40dced3e51bfef351ec00a Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:19:02 -0700 Subject: [PATCH 11/42] refac: code style --- src/lib/components/chat/Settings/General.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 95b93824b..65d358f8c 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -91,11 +91,7 @@ }); const applyTheme = (_theme: string) => { - let themeToApply = _theme; - - if (themeToApply.includes('oled')) { - themeToApply = 'dark'; - } + let themeToApply = _theme === 'oled-dark' ? 'dark' : _theme; if (_theme === 'system') { themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; From 572eefe18175c7a8b6643ceb2923a3f65c8cd586 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:19:57 -0700 Subject: [PATCH 12/42] =?UTF-8?q?use=20=F0=9F=8C=83=20emoji=20for=20oled-d?= =?UTF-8?q?ark=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 65d358f8c..3da335170 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -143,7 +143,7 @@ > - + From 9ad097d2655aff1822c2e4a4639482911a12eff5 Mon Sep 17 00:00:00 2001 From: ConnorsApps Date: Wed, 27 Mar 2024 20:35:21 -0400 Subject: [PATCH 13/42] fix: pvc storageClassName typo --- kubernetes/helm/templates/ollama-statefulset.yaml | 2 +- kubernetes/helm/templates/webui-pvc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/helm/templates/ollama-statefulset.yaml b/kubernetes/helm/templates/ollama-statefulset.yaml index a87aeab09..c348b04c0 100644 --- a/kubernetes/helm/templates/ollama-statefulset.yaml +++ b/kubernetes/helm/templates/ollama-statefulset.yaml @@ -88,7 +88,7 @@ spec: resources: requests: storage: {{ .Values.ollama.persistence.size | quote }} - storageClass: {{ .Values.ollama.persistence.storageClass }} + storageClassName: {{ .Values.ollama.persistence.storageClass }} {{- with .Values.ollama.persistence.selector }} selector: {{- toYaml . | nindent 8 }} diff --git a/kubernetes/helm/templates/webui-pvc.yaml b/kubernetes/helm/templates/webui-pvc.yaml index 06b2cc4a4..f06454e7a 100644 --- a/kubernetes/helm/templates/webui-pvc.yaml +++ b/kubernetes/helm/templates/webui-pvc.yaml @@ -17,7 +17,7 @@ spec: resources: requests: storage: {{ .Values.webui.persistence.size }} - storageClass: {{ .Values.webui.persistence.storageClass }} + storageClassName: {{ .Values.webui.persistence.storageClass }} {{- with .Values.webui.persistence.selector }} selector: {{- toYaml . | nindent 4 }} From 67865fc5adb230c0cfb74385482665b0caf87172 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 22:39:47 -0700 Subject: [PATCH 14/42] dynamically adjust --color-gray-950 value for OLED black sidebar --- src/app.html | 1 + src/lib/components/chat/Settings/General.svelte | 2 ++ tailwind.config.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.html b/src/app.html index 45b5d20e7..c9f86d8f6 100644 --- a/src/app.html +++ b/src/app.html @@ -11,6 +11,7 @@ (() => { if (localStorage.theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#000000'); + document.documentElement.style.setProperty('--color-gray-950', '#000000'); document.documentElement.classList.add('dark'); } else if ( diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 3da335170..3b7126d85 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -99,6 +99,7 @@ if (themeToApply === 'dark' && !_theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#171717'); + document.documentElement.style.setProperty('--color-gray-950', '#0d0d0d'); } themes @@ -121,6 +122,7 @@ localStorage.setItem('theme', _theme); if (_theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#000000'); + document.documentElement.style.setProperty('--color-gray-950', '#000000'); document.documentElement.classList.add('dark'); } applyTheme(_theme); diff --git a/tailwind.config.js b/tailwind.config.js index 63413ccdb..9caccabf5 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -17,7 +17,7 @@ export default { 800: '#333', 850: '#262626', 900: 'var(--color-gray-900, #171717)', - 950: '#0d0d0d' + 950: 'var(--color-gray-950, #0d0d0d)' } }, typography: { From d187b1615a751d83d648bcbeab1dd71f8ff298db Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 27 Mar 2024 23:51:26 -0700 Subject: [PATCH 15/42] fix: language ordering --- src/lib/i18n/locales/languages.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/i18n/locales/languages.json b/src/lib/i18n/locales/languages.json index becba8c2d..567900722 100644 --- a/src/lib/i18n/locales/languages.json +++ b/src/lib/i18n/locales/languages.json @@ -39,6 +39,10 @@ "code": "ja-JP", "title": "Japanese" }, + { + "code": "ko-KR", + "title": "Korean" + }, { "code": "nl-NL", "title": "Dutch (Netherlands)" @@ -66,9 +70,5 @@ { "code": "zh-TW", "title": "Chinese (Traditional)" - }, - { - "code": "ko-KR", - "title": "Korean" } ] \ No newline at end of file From b93bdfb222d2b83ac6c69ce23c1131ede4ed8f99 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 28 Mar 2024 02:44:16 -0700 Subject: [PATCH 16/42] fix: theme issue --- src/app.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app.html b/src/app.html index c9f86d8f6..f731761cf 100644 --- a/src/app.html +++ b/src/app.html @@ -9,12 +9,11 @@
{#if showTagInput}
-
- - {/if}
-
- +
+
+
+
+ model.name !== 'hr') + .map((model) => ({ + value: model.id, + label: model.name, + info: model + }))} + bind:value={selectedModelId} + /> +
+
+