mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #926] [MERGED] Add i18n #20534
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/926
Author: @asedmammad
Created: 2/26/2024
Status: ✅ Merged
Merged: 3/16/2024
Merged by: @tjbck
Base:
dev← Head:feat/add-i18n📝 Commits (10+)
fab89a7feat: WIP: Initial setup for i18next7a77f3cfeat: Change translation keys to fallback strings3c471eefeat: Migrate hardcoded strings to i18n calls511b52ffeat: Add translation file for englishfbed07ffix: Merge similar string literals45f6908fix: Minor fixes in english translation fileda02028feat: add farsi translation file v16d2f462fix: add missed translations670b65cfix: add missed imports893b738german translations + new vars📊 Changes
68 files changed (+6909 additions, -808 deletions)
View changed files
📝
CHANGELOG.md(+10 -0)📝
docs/CONTRIBUTING.md(+12 -0)➕
i18next-parser.config.ts(+38 -0)📝
package-lock.json(+3215 -82)📝
package.json(+6 -1)📝
src/lib/components/AddFilesPlaceholder.svelte(+7 -2)📝
src/lib/components/ChangelogModal.svelte(+7 -4)📝
src/lib/components/admin/EditUserModal.svelte(+9 -7)📝
src/lib/components/admin/Settings/Database.svelte(+6 -4)📝
src/lib/components/admin/Settings/General.svelte(+17 -14)📝
src/lib/components/admin/Settings/Users.svelte(+15 -11)📝
src/lib/components/admin/SettingsModal.svelte(+7 -4)📝
src/lib/components/chat/MessageInput.svelte(+23 -15)📝
src/lib/components/chat/MessageInput/Documents.svelte(+8 -4)📝
src/lib/components/chat/MessageInput/Models.svelte(+7 -3)📝
src/lib/components/chat/MessageInput/PromptCommands.svelte(+7 -4)📝
src/lib/components/chat/Messages.svelte(+4 -2)📝
src/lib/components/chat/Messages/Placeholder.svelte(+5 -3)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+6 -4)📝
src/lib/components/chat/Messages/UserMessage.svelte(+11 -8)...and 48 more files
📄 Description
Pull Request Checklist
Description
i18next, and could be used in svelte files like this:translation keyto be present in translation files located atsrc/lib/i18n/localesfor each language. Translation are specified in JSON format. Adding newtranslation keys to these translation files can be done either manually or by issuing the following command in the root directory of the project:This scans
js/sveltefiles in thesrcdirectory for translation keys and adds missing keys for available languages. Available languages are specified insrc/lib/i18n/locales/languages.json.Also we utilize
i18next-browser-languagedetectorto detect current user's language and set it in a svelte store which will update the UI with the detected language. Detection is done in this order:querystring(e.glang=en)localStoragenavigatorChangelog Entry
Added
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.