Merge pull request #1313 from asedmammad/feat/i18n-navigator-config

feat: Configurable i18n default translation language
This commit is contained in:
Timothy Jaeryang Baek 2024-03-27 23:52:26 -07:00 committed by GitHub
commit c6bb0ded5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 370 additions and 360 deletions

View file

@ -1,6 +1,7 @@
{ {
"version": 0, "version": 0,
"ui": { "ui": {
"default_locale": "en-US",
"prompt_suggestions": [ "prompt_suggestions": [
{ {
"title": [ "title": [

View file

@ -32,6 +32,7 @@ from utils.utils import get_admin_user
from apps.rag.utils import rag_messages from apps.rag.utils import rag_messages
from config import ( from config import (
CONFIG_DATA,
WEBUI_NAME, WEBUI_NAME,
ENV, ENV,
VERSION, VERSION,
@ -88,7 +89,6 @@ class RAGMiddleware(BaseHTTPMiddleware):
# Example: Add a new key-value pair or modify existing ones # Example: Add a new key-value pair or modify existing ones
# data["modified"] = True # Example modification # data["modified"] = True # Example modification
if "docs" in data: if "docs" in data:
data = {**data} data = {**data}
data["messages"] = rag_messages( data["messages"] = rag_messages(
data["docs"], data["docs"],
@ -163,11 +163,11 @@ app.mount("/rag/api/v1", rag_app)
@app.get("/api/config") @app.get("/api/config")
async def get_app_config(): async def get_app_config():
return { return {
"status": True, "status": True,
"name": WEBUI_NAME, "name": WEBUI_NAME,
"version": VERSION, "version": VERSION,
"default_locale": CONFIG_DATA["ui"]["default_locale"],
"images": images_app.state.ENABLED, "images": images_app.state.ENABLED,
"default_models": webui_app.state.DEFAULT_MODELS, "default_models": webui_app.state.DEFAULT_MODELS,
"default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS,
@ -191,7 +191,6 @@ class ModelFilterConfigForm(BaseModel):
async def update_model_filter_config( async def update_model_filter_config(
form_data: ModelFilterConfigForm, user=Depends(get_admin_user) form_data: ModelFilterConfigForm, user=Depends(get_admin_user)
): ):
app.state.MODEL_FILTER_ENABLED = form_data.enabled app.state.MODEL_FILTER_ENABLED = form_data.enabled
app.state.MODEL_FILTER_LIST = form_data.models 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") @app.get("/api/version")
async def get_app_config(): async def get_app_config():
return { return {
"version": VERSION, "version": VERSION,
} }

View file

@ -37,23 +37,28 @@ const createIsLoadingStore = (i18n: i18nType) => {
return isLoading; return isLoading;
}; };
i18next export const initI18n = (defaultLocale: string) => {
.use( let detectionOrder = defaultLocale
resourcesToBackend( ? ['querystring', 'localStorage']
(language: string, namespace: string) => import(`./locales/${language}/${namespace}.json`) : ['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) .use(LanguageDetector)
.init({ .init({
debug: false, debug: false,
detection: { detection: {
order: ['querystring', 'localStorage', 'navigator'], order: detectionOrder,
caches: ['localStorage'], caches: ['localStorage'],
lookupQuerystring: 'lang', lookupQuerystring: 'lang',
lookupLocalStorage: 'locale' lookupLocalStorage: 'locale'
}, },
fallbackLng: { fallbackLng: {
default: ['en-US'] default: fallbackDefaultLocale
}, },
ns: 'translation', ns: 'translation',
returnEmptyString: false, returnEmptyString: false,
@ -61,6 +66,7 @@ i18next
escapeValue: false // not needed for svelte as it escapes by default escapeValue: false // not needed for svelte as it escapes by default
} }
}); });
};
const i18n = createI18nStore(i18next); const i18n = createI18nStore(i18next);
const isLoadingStore = createIsLoadingStore(i18next); const isLoadingStore = createIsLoadingStore(i18next);

View file

@ -1,128 +1,128 @@
{ {
"'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.", "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "",
"(Beta)": "(Beta)", "(Beta)": "",
"(e.g. `sh webui.sh --api`)": "(e.g. `sh webui.sh --api`)", "(e.g. `sh webui.sh --api`)": "",
"(latest)": "(latest)", "(latest)": "",
"{{modelName}} is thinking...": "{{modelName}} is thinking...", "{{modelName}} is thinking...": "",
"{{webUIName}} Backend Required": "{{webUIName}} Backend Required", "{{webUIName}} Backend Required": "",
"a user": "", "a user": "",
"About": "About", "About": "",
"Account": "Account", "Account": "",
"Action": "Action", "Action": "",
"Add a model": "Add a model", "Add a model": "",
"Add a model tag name": "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 description about what this modelfile does": "",
"Add a short title for this prompt": "Add a short title for this prompt", "Add a short title for this prompt": "",
"Add a tag": "Add a tag", "Add a tag": "",
"Add Docs": "Add Docs", "Add Docs": "",
"Add Files": "Add Files", "Add Files": "",
"Add message": "Add message", "Add message": "",
"add tags": "add tags", "add tags": "",
"Adjusting these settings will apply changes universally to all users.": "Adjusting these settings will apply changes universally to all users.", "Adjusting these settings will apply changes universally to all users.": "",
"admin": "admin", "admin": "",
"Admin Panel": "Admin Panel", "Admin Panel": "",
"Admin Settings": "Admin Settings", "Admin Settings": "",
"Advanced Parameters": "Advanced Parameters", "Advanced Parameters": "",
"all": "all", "all": "",
"All Users": "All Users", "All Users": "",
"Allow": "Allow", "Allow": "",
"Allow Chat Deletion": "Allow Chat Deletion", "Allow Chat Deletion": "",
"alphanumeric characters and hyphens": "alphanumeric characters and hyphens", "alphanumeric characters and hyphens": "",
"Already have an account?": "Already have an account?", "Already have an account?": "",
"an assistant": "", "an assistant": "",
"and": "and", "and": "",
"API Base URL": "API Base URL", "API Base URL": "",
"API Key": "API Key", "API Key": "",
"API RPM": "API RPM", "API RPM": "",
"are allowed - Activate this command by typing": "are allowed - Activate this command by typing", "are allowed - Activate this command by typing": "",
"Are you sure?": "", "Are you sure?": "",
"Audio": "Audio", "Audio": "",
"Auto-playback response": "Auto-playback response", "Auto-playback response": "",
"Auto-send input after 3 sec.": "Auto-send input after 3 sec.", "Auto-send input after 3 sec.": "",
"AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", "AUTOMATIC1111 Base URL": "",
"AUTOMATIC1111 Base URL is required.": "", "AUTOMATIC1111 Base URL is required.": "",
"available!": "available!", "available!": "",
"Back": "Back", "Back": "",
"Builder Mode": "Builder Mode", "Builder Mode": "",
"Cancel": "Cancel", "Cancel": "",
"Categories": "Categories", "Categories": "",
"Change Password": "Change Password", "Change Password": "",
"Chat": "Chat", "Chat": "",
"Chat History": "Chat History", "Chat History": "",
"Chat History is off for this browser.": "Chat History is off for this browser.", "Chat History is off for this browser.": "",
"Chats": "Chats", "Chats": "",
"Check Again": "Check Again", "Check Again": "",
"Check for updates": "Check for updates", "Check for updates": "",
"Checking for updates...": "Checking for updates...", "Checking for updates...": "",
"Choose a model before saving...": "Choose a model before saving...", "Choose a model before saving...": "",
"Chunk Overlap": "Chunk Overlap", "Chunk Overlap": "",
"Chunk Params": "Chunk Params", "Chunk Params": "",
"Chunk Size": "Chunk Size", "Chunk Size": "",
"Click here for help.": "Click here for help.", "Click here for help.": "",
"Click here to check other modelfiles.": "Click here to check other modelfiles.", "Click here to check other modelfiles.": "",
"Click here to select": "", "Click here to select": "",
"Click here to select documents.": "", "Click here to select documents.": "",
"click here.": "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.", "Click on the user role button to change a user's role.": "",
"Close": "Close", "Close": "",
"Collection": "Collection", "Collection": "",
"Command": "Command", "Command": "",
"Confirm Password": "Confirm Password", "Confirm Password": "",
"Connections": "Connections", "Connections": "",
"Content": "Content", "Content": "",
"Context Length": "Context Length", "Context Length": "",
"Conversation Mode": "Conversation Mode", "Conversation Mode": "",
"Copy last code block": "Copy last code block", "Copy last code block": "",
"Copy last response": "Copy last response", "Copy last response": "",
"Copying to clipboard was successful!": "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 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 a modelfile": "",
"Create Account": "Create Account", "Create Account": "",
"Created at": "Created at", "Created at": "",
"Created by": "Created by", "Created by": "",
"Current Model": "Current Model", "Current Model": "",
"Current Password": "Current Password", "Current Password": "",
"Custom": "Custom", "Custom": "",
"Customize Ollama models for a specific purpose": "Customize Ollama models for a specific purpose", "Customize Ollama models for a specific purpose": "",
"Dark": "Dark", "Dark": "",
"Database": "Database", "Database": "",
"DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", "DD/MM/YYYY HH:mm": "",
"Default": "Default", "Default": "",
"Default (Automatic1111)": "", "Default (Automatic1111)": "",
"Default (Web API)": "Default (Web API)", "Default (Web API)": "",
"Default model updated": "Default model updated", "Default model updated": "",
"Default Prompt Suggestions": "Default Prompt Suggestions", "Default Prompt Suggestions": "",
"Default User Role": "Default User Role", "Default User Role": "",
"delete": "delete", "delete": "",
"Delete a model": "Delete a model", "Delete a model": "",
"Delete chat": "Delete chat", "Delete chat": "",
"Delete Chats": "Delete Chats", "Delete Chats": "",
"Deleted {{deleteModelTag}}": "Deleted {{deleteModelTag}}", "Deleted {{deleteModelTag}}": "",
"Deleted {tagName}": "Deleted {tagName}", "Deleted {tagName}": "",
"Description": "Description", "Description": "",
"Desktop Notifications": "Notification", "Desktop Notifications": "",
"Disabled": "Disabled", "Disabled": "",
"Discover a modelfile": "Discover a modelfile", "Discover a modelfile": "",
"Discover a prompt": "Discover a prompt", "Discover a prompt": "",
"Discover, download, and explore custom prompts": "Discover, download, and explore custom prompts", "Discover, download, and explore custom prompts": "",
"Discover, download, and explore model presets": "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", "Display the username instead of You in the Chat": "",
"Document": "Document", "Document": "",
"Document Settings": "Document Settings", "Document Settings": "",
"Documents": "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.", "does not make any external connections, and your data stays securely on your locally hosted server.": "",
"Don't Allow": "Don't Allow", "Don't Allow": "",
"Don't have an account?": "Don't have an account?", "Don't have an account?": "",
"Download as a File": "Download as a File", "Download as a File": "",
"Download Database": "Download Database", "Download Database": "",
"Drop any files here to add to the conversation": "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'.", "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "",
"Edit Doc": "Edit Doc", "Edit Doc": "",
"Edit User": "Edit User", "Edit User": "",
"Email": "Email", "Email": "",
"Enable Chat History": "Enable Chat History", "Enable Chat History": "",
"Enable New Sign Ups": "Enable New Sign Ups", "Enable New Sign Ups": "",
"Enabled": "Enabled", "Enabled": "",
"Enter {{role}} message here": "", "Enter {{role}} message here": "",
"Enter API Key": "", "Enter API Key": "",
"Enter Chunk Overlap": "", "Enter Chunk Overlap": "",
@ -135,229 +135,229 @@
"Enter Max Tokens (litellm_params.max_tokens)": "", "Enter Max Tokens (litellm_params.max_tokens)": "",
"Enter model tag (e.g. {{modelTag}})": "", "Enter model tag (e.g. {{modelTag}})": "",
"Enter Number of Steps (e.g. 50)": "", "Enter Number of Steps (e.g. 50)": "",
"Enter stop sequence": "Enter stop sequence", "Enter stop sequence": "",
"Enter Top K": "", "Enter Top K": "",
"Enter URL (e.g. http://127.0.0.1:7860/)": "", "Enter URL (e.g. http://127.0.0.1:7860/)": "",
"Enter Your Email": "Enter Your Email", "Enter Your Email": "",
"Enter Your Full Name": "Enter Your Full Name", "Enter Your Full Name": "",
"Enter Your Password": "Enter Your Password", "Enter Your Password": "",
"Experimental": "Experimental", "Experimental": "",
"Export All Chats (All Users)": "Export All Chats (All Users)", "Export All Chats (All Users)": "",
"Export Chats": "Export Chats", "Export Chats": "",
"Export Documents Mapping": "Export Documents Mapping", "Export Documents Mapping": "",
"Export Modelfiles": "Export Modelfiles", "Export Modelfiles": "",
"Export Prompts": "Export Prompts", "Export Prompts": "",
"Failed to read clipboard contents": "Failed to read clipboard contents", "Failed to read clipboard contents": "",
"File Mode": "File Mode", "File Mode": "",
"File not found.": "File not found.", "File not found.": "",
"Focus chat input": "Focus chat input", "Focus chat input": "",
"Format your variables using square brackets like this:": "Format your variables using square brackets like this:", "Format your variables using square brackets like this:": "",
"From (Base Model)": "From (Base Model)", "From (Base Model)": "",
"Full Screen Mode": "Full Screen Mode", "Full Screen Mode": "",
"General": "General", "General": "",
"General Settings": "General Settings", "General Settings": "",
"Hello, {{name}}": "Hello, {{name}}", "Hello, {{name}}": "",
"Hide": "Hide", "Hide": "",
"Hide Additional Params": "Hide Additional Params", "Hide Additional Params": "",
"How can I help you today?": "How can I help you today?", "How can I help you today?": "",
"Image Generation (Experimental)": "Image Generation (Experimental)", "Image Generation (Experimental)": "",
"Image Generation Engine": "", "Image Generation Engine": "",
"Image Settings": "Image Settings", "Image Settings": "",
"Images": "Images", "Images": "",
"Import Chats": "Import Chats", "Import Chats": "",
"Import Documents Mapping": "Import Documents Mapping", "Import Documents Mapping": "",
"Import Modelfiles": "Import Modelfiles", "Import Modelfiles": "",
"Import Prompts": "Import Prompts", "Import Prompts": "",
"Include `--api` flag when running stable-diffusion-webui": "Include `--api` flag when running stable-diffusion-webui", "Include `--api` flag when running stable-diffusion-webui": "",
"Interface": "Interface", "Interface": "",
"join our Discord for help.": "join our Discord for help.", "join our Discord for help.": "",
"JSON": "JSON", "JSON": "",
"JWT Expiration": "JWT Expiration", "JWT Expiration": "",
"JWT Token": "JWT Token", "JWT Token": "",
"Keep Alive": "Keep Alive", "Keep Alive": "",
"Keyboard shortcuts": "Keyboard shortcuts", "Keyboard shortcuts": "",
"Language": "Language", "Language": "",
"Light": "Light", "Light": "",
"Listening...": "Listening...", "Listening...": "",
"LLMs can make mistakes. Verify important information.": "LLMs can make mistakes. Verify important information.", "LLMs can make mistakes. Verify important information.": "",
"Made by OpenWebUI Community": "Made by OpenWebUI Community", "Made by OpenWebUI Community": "",
"Make sure to enclose them with": "Make sure to enclose them with", "Make sure to enclose them with": "",
"Manage LiteLLM Models": "Manage LiteLLM Models", "Manage LiteLLM Models": "",
"Manage Models": "Manage Models", "Manage Models": "",
"Manage Ollama Models": "Manage Ollama Models", "Manage Ollama Models": "",
"Max Tokens": "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.", "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "",
"Mirostat": "Mirostat", "Mirostat": "",
"Mirostat Eta": "Mirostat Eta", "Mirostat Eta": "",
"Mirostat Tau": "Mirostat Tau", "Mirostat Tau": "",
"MMMM DD, YYYY": "MMMM DD, YYYY", "MMMM DD, YYYY": "",
"Model '{{modelName}}' has been successfully downloaded.": "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 '{{modelTag}}' is already in queue for downloading.": "",
"Model {{modelId}} not found": "Model {{modelId}} not found", "Model {{modelId}} not found": "",
"Model {{modelName}} already exists.": "Model {{modelName}} already exists.", "Model {{modelName}} already exists.": "",
"Model Name": "Model Name", "Model Name": "",
"Model not selected": "Model not selected", "Model not selected": "",
"Model Tag Name": "Model Tag Name", "Model Tag Name": "",
"Model Whitelisting": "Model Whitelisting", "Model Whitelisting": "",
"Model(s) Whitelisted": "Model(s) Whitelisted", "Model(s) Whitelisted": "",
"Modelfile": "Modelfile", "Modelfile": "",
"Modelfile Advanced Settings": "Modelfile Advanced Settings", "Modelfile Advanced Settings": "",
"Modelfile Content": "Modelfile Content", "Modelfile Content": "",
"Modelfiles": "Modelfiles", "Modelfiles": "",
"Models": "Models", "Models": "",
"My Documents": "My Documents", "My Documents": "",
"My Modelfiles": "My Modelfiles", "My Modelfiles": "",
"My Prompts": "My Prompts", "My Prompts": "",
"Name": "Name", "Name": "",
"Name Tag": "Name Tag", "Name Tag": "",
"Name your modelfile": "Name your modelfile", "Name your modelfile": "",
"New Chat": "New Chat", "New Chat": "",
"New Password": "New Password", "New Password": "",
"Not sure what to add?": "Not sure what to add?", "Not sure what to add?": "",
"Not sure what to write? Switch to": "Not sure what to write? Switch to", "Not sure what to write? Switch to": "",
"Off": "Off", "Off": "",
"Okay, Let's Go!": "Okay, Let's Go!", "Okay, Let's Go!": "",
"Ollama Base URL": "", "Ollama Base URL": "",
"Ollama Version": "Ollama Version", "Ollama Version": "",
"On": "On", "On": "",
"Only": "Only", "Only": "",
"Only alphanumeric characters and hyphens are allowed in the command string.": "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! 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! 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.", "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "",
"Open": "Open", "Open": "",
"Open AI": "Open AI", "Open AI": "",
"Open AI (Dall-E)": "", "Open AI (Dall-E)": "",
"Open new chat": "Open new chat", "Open new chat": "",
"OpenAI API": "OpenAI API", "OpenAI API": "",
"OpenAI API Key": "", "OpenAI API Key": "",
"OpenAI API Key is required.": "", "OpenAI API Key is required.": "",
"or": "or", "or": "",
"Parameters": "Parameters", "Parameters": "",
"Password": "Password", "Password": "",
"PDF Extract Images (OCR)": "PDF Extract Images (OCR)", "PDF Extract Images (OCR)": "",
"pending": "pending", "pending": "",
"Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", "Permission denied when accessing microphone: {{error}}": "",
"Playground": "Playground", "Playground": "",
"Profile": "Profile", "Profile": "",
"Prompt Content": "Prompt Content", "Prompt Content": "",
"Prompt suggestions": "Prompt suggestions", "Prompt suggestions": "",
"Prompts": "Prompts", "Prompts": "",
"Pull a model from Ollama.com": "Pull a model from Ollama.com", "Pull a model from Ollama.com": "",
"Pull Progress": "Pull Progress", "Pull Progress": "",
"Query Params": "Query Params", "Query Params": "",
"RAG Template": "RAG Template", "RAG Template": "",
"Raw Format": "Raw Format", "Raw Format": "",
"Record voice": "Record voice", "Record voice": "",
"Redirecting you to OpenWebUI Community": "Redirecting you to OpenWebUI Community", "Redirecting you to OpenWebUI Community": "",
"Release Notes": "Release Notes", "Release Notes": "",
"Repeat Last N": "Repeat Last N", "Repeat Last N": "",
"Repeat Penalty": "Repeat Penalty", "Repeat Penalty": "",
"Request Mode": "Request Mode", "Request Mode": "",
"Reset Vector Storage": "Reset Vector Storage", "Reset Vector Storage": "",
"Response AutoCopy to Clipboard": "Response AutoCopy to Clipboard", "Response AutoCopy to Clipboard": "",
"Role": "Role", "Role": "",
"Rosé Pine": "Rosé Pine", "Rosé Pine": "",
"Rosé Pine Dawn": "Rosé Pine Dawn", "Rosé Pine Dawn": "",
"Save": "Save", "Save": "",
"Save & Create": "Save & Create", "Save & Create": "",
"Save & Submit": "Save & Submit", "Save & Submit": "",
"Save & Update": "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", "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": "",
"Scan complete!": "Scan complete!", "Scan complete!": "",
"Scan for documents from {{path}}": "Scan for documents from {{path}}", "Scan for documents from {{path}}": "",
"Search": "Search", "Search": "",
"Search Documents": "Search Documents", "Search Documents": "",
"Search Prompts": "Search Prompts", "Search Prompts": "",
"See readme.md for instructions": "See readme.md for instructions", "See readme.md for instructions": "",
"See what's new": "See what's new", "See what's new": "",
"Seed": "Seed", "Seed": "",
"Select a mode": "", "Select a mode": "",
"Select a model": "Select a model", "Select a model": "",
"Select an Ollama instance": "", "Select an Ollama instance": "",
"Send a Message": "Send a Message", "Send a Message": "",
"Send message": "Send message", "Send message": "",
"Server connection verified": "Server connection verified", "Server connection verified": "",
"Set as default": "Set as default", "Set as default": "",
"Set Default Model": "Set Default Model", "Set Default Model": "",
"Set Image Size": "Set Image Size", "Set Image Size": "",
"Set Steps": "Set Steps", "Set Steps": "",
"Set Title Auto-Generation Model": "Set Title Auto-Generation Model", "Set Title Auto-Generation Model": "",
"Set Voice": "Set Voice", "Set Voice": "",
"Settings": "Settings", "Settings": "",
"Settings saved successfully!": "Settings saved successfully!", "Settings saved successfully!": "",
"Share to OpenWebUI Community": "Share to OpenWebUI Community", "Share to OpenWebUI Community": "",
"short-summary": "short-summary", "short-summary": "",
"Show": "Show", "Show": "",
"Show Additional Params": "Show Additional Params", "Show Additional Params": "",
"Show shortcuts": "Show shortcuts", "Show shortcuts": "",
"sidebar": "sidebar", "sidebar": "",
"Sign in": "Sign in", "Sign in": "",
"Sign Out": "Sign Out", "Sign Out": "",
"Sign up": "Sign up", "Sign up": "",
"Speech recognition error: {{error}}": "Speech recognition error: {{error}}", "Speech recognition error: {{error}}": "",
"Speech-to-Text Engine": "Speech-to-Text Engine", "Speech-to-Text Engine": "",
"SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.", "SpeechRecognition API is not supported in this browser.": "",
"Stop Sequence": "Stop Sequence", "Stop Sequence": "",
"STT Settings": "STT Settings", "STT Settings": "",
"Submit": "Submit", "Submit": "",
"Success": "Success", "Success": "",
"Successfully updated.": "Successfully updated.", "Successfully updated.": "",
"Sync All": "Sync All", "Sync All": "",
"System": "System", "System": "",
"System Prompt": "System Prompt", "System Prompt": "",
"Tags": "Tags", "Tags": "",
"Temperature": "Temperature", "Temperature": "",
"Template": "Template", "Template": "",
"Text Completion": "Text Completion", "Text Completion": "",
"Text-to-Speech Engine": "Text-to-Speech Engine", "Text-to-Speech Engine": "",
"Tfs Z": "Tfs Z", "Tfs Z": "",
"Theme": "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 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.", "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.", "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "",
"Title": "Title", "Title": "",
"Title Auto-Generation": "Title Auto-Generation", "Title Auto-Generation": "",
"Title Generation Prompt": "Title Generation Prompt", "Title Generation Prompt": "",
"to": "to", "to": "",
"To access the available model names for downloading,": "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 access the GGUF models available for downloading,": "",
"to chat input.": "to chat input.", "to chat input.": "",
"Toggle settings": "Toggle settings", "Toggle settings": "",
"Toggle sidebar": "Toggle sidebar", "Toggle sidebar": "",
"Top K": "Top K", "Top K": "",
"Top P": "Top P", "Top P": "",
"Trouble accessing Ollama?": "Trouble accessing Ollama?", "Trouble accessing Ollama?": "",
"TTS Settings": "TTS Settings", "TTS Settings": "",
"Type Hugging Face Resolve (Download) URL": "", "Type Hugging Face Resolve (Download) URL": "",
"Uh-oh! There was an issue connecting to {{provider}}.": "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", "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "",
"Update password": "Update password", "Update password": "",
"Upload a GGUF model": "Upload a GGUF model", "Upload a GGUF model": "",
"Upload files": "Upload files", "Upload files": "",
"Upload Progress": "Upload Progress", "Upload Progress": "",
"URL Mode": "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.", "Use '#' in the prompt input to load and select your documents.": "",
"Use Gravatar": "", "Use Gravatar": "",
"user": "user", "user": "",
"User Permissions": "User Permissions", "User Permissions": "",
"Users": "Users", "Users": "",
"Utilize": "Utilize", "Utilize": "",
"Valid time units:": "Valid time units:", "Valid time units:": "",
"variable": "variable", "variable": "",
"variable to have them replaced with clipboard content.": "variable to have them replaced with clipboard content.", "variable to have them replaced with clipboard content.": "",
"Version": "Version", "Version": "",
"Web": "Web", "Web": "",
"WebUI Add-ons": "WebUI Add-ons", "WebUI Add-ons": "",
"WebUI Settings": "WebUI Settings", "WebUI Settings": "",
"WebUI will make requests to": "WebUI will make requests to", "WebUI will make requests to": "",
"Whats New in": "Whats New in", "Whats 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.", "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)", "Whisper (Local)": "",
"Write a prompt suggestion (e.g. Who are you?)": "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].", "Write a summary in 50 words that summarizes [topic or keyword].": "",
"You": "You", "You": "",
"You're a helpful assistant.": "You're a helpful assistant.", "You're a helpful assistant.": "",
"You're now logged in.": "You're now logged in." "You're now logged in.": ""
} }

View file

@ -11,7 +11,7 @@
import '../tailwind.css'; import '../tailwind.css';
import 'tippy.js/dist/tippy.css'; import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants';
import i18n from '$lib/i18n'; import i18n, { initI18n } from '$lib/i18n';
setContext('i18n', i18n); setContext('i18n', i18n);
@ -25,6 +25,11 @@
if (backendConfig) { if (backendConfig) {
// Save Backend Status to Store // Save Backend Status to Store
await config.set(backendConfig); await config.set(backendConfig);
if ($config.default_locale) {
initI18n($config.default_locale);
} else {
initI18n();
}
await WEBUI_NAME.set(backendConfig.name); await WEBUI_NAME.set(backendConfig.name);
console.log(backendConfig); console.log(backendConfig);