Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
cd79afb4
Unverified
Commit
cd79afb4
authored
Apr 20, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Apr 20, 2024
Browse files
Merge pull request #1624 from que-nguyen/dev
Add i18n translation for feedback reasons
parents
21cc6ebc
b7959633
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
23 deletions
+46
-23
src/lib/components/chat/Messages/RateComment.svelte
src/lib/components/chat/Messages/RateComment.svelte
+30
-22
src/lib/i18n/locales/vi-VN/translation.json
src/lib/i18n/locales/vi-VN/translation.json
+16
-1
No files found.
src/lib/components/chat/Messages/RateComment.svelte
View file @
cd79afb4
<script lang="ts">
<script lang="ts">
import { toast } from 'svelte-sonner';
import { toast } from 'svelte-sonner';
import { createEventDispatcher, onMount } from 'svelte';
import { createEventDispatcher, onMount, getContext } from 'svelte';
const i18n = getContext('i18n');
const dispatch = createEventDispatcher();
const dispatch = createEventDispatcher();
export let show = false;
export let show = false;
export let message;
export let message;
const LIKE_REASONS = [
let LIKE_REASONS = [];
`Accurate information`,
let DISLIKE_REASONS = [];
`Followed instructions perfectly`,
`Showcased creativity`,
function loadReasons() {
`Positive attitude`,
LIKE_REASONS = [
`Attention to detail`,
$i18n.t('Accurate information'),
`Thorough explanation`,
$i18n.t('Followed instructions perfectly'),
`Other`
$i18n.t('Showcased creativity'),
];
$i18n.t('Positive attitude'),
$i18n.t('Attention to detail'),
const DISLIKE_REASONS = [
$i18n.t('Thorough explanation'),
`Don't like the style`,
$i18n.t('Other')
`Not factually correct`,
];
`Didn't fully follow instructions`,
`Refused when it shouldn't have`,
DISLIKE_REASONS = [
`Being Lazy`,
$i18n.t("Don't like the style"),
`Other`
$i18n.t('Not factually correct'),
];
$i18n.t("Didn't fully follow instructions"),
$i18n.t("Refused when it shouldn't have"),
$i18n.t('Being lazy'),
$i18n.t('Other')
];
}
let reasons = [];
let reasons = [];
let selectedReason = null;
let selectedReason = null;
...
@@ -40,6 +47,7 @@
...
@@ -40,6 +47,7 @@
onMount(() => {
onMount(() => {
selectedReason = message.annotation.reason;
selectedReason = message.annotation.reason;
comment = message.annotation.comment;
comment = message.annotation.comment;
loadReasons();
});
});
const submitHandler = () => {
const submitHandler = () => {
...
@@ -50,14 +58,14 @@
...
@@ -50,14 +58,14 @@
dispatch('submit');
dispatch('submit');
toast.success('Thanks for your feedback!');
toast.success(
$i18n.t(
'Thanks for your feedback!')
)
;
show = false;
show = false;
};
};
</script>
</script>
<div class=" my-2.5 rounded-xl px-4 py-3 border dark:border-gray-850">
<div class=" my-2.5 rounded-xl px-4 py-3 border dark:border-gray-850">
<div class="flex justify-between items-center">
<div class="flex justify-between items-center">
<div class=" text-sm">Tell us more:</div>
<div class=" text-sm">
{$i18n.t('
Tell us more:
')}
</div>
<button
<button
on:click={() => {
on:click={() => {
...
@@ -99,7 +107,7 @@
...
@@ -99,7 +107,7 @@
<textarea
<textarea
bind:value={comment}
bind:value={comment}
class="w-full text-sm px-1 py-2 bg-transparent outline-none resize-none rounded-xl"
class="w-full text-sm px-1 py-2 bg-transparent outline-none resize-none rounded-xl"
placeholder=
"
Feel free to add specific details
"
placeholder=
{$i18n.t('
Feel free to add specific details
')}
rows="2"
rows="2"
/>
/>
</div>
</div>
...
...
src/lib/i18n/locales/vi-VN/translation.json
View file @
cd79afb4
...
@@ -359,5 +359,20 @@
...
@@ -359,5 +359,20 @@
"Write a summary in 50 words that summarizes [topic or keyword]."
:
"Viết một tóm tắt trong vòng 50 từ cho [chủ đề hoặc từ khóa]."
,
"Write a summary in 50 words that summarizes [topic or keyword]."
:
"Viết một tóm tắt trong vòng 50 từ cho [chủ đề hoặc từ khóa]."
,
"You"
:
"Bạn"
,
"You"
:
"Bạn"
,
"You're a helpful assistant."
:
"Bạn là một trợ lý hữu ích."
,
"You're a helpful assistant."
:
"Bạn là một trợ lý hữu ích."
,
"You're now logged in."
:
"Bạn đã đăng nhập."
"You're now logged in."
:
"Bạn đã đăng nhập."
,
"Accurate information"
:
"Thông tin chính xác"
,
"Followed instructions perfectly"
:
"Tuân theo chỉ dẫn một cách hoàn hảo"
,
"Showcased creativity"
:
"Thể hiện sự sáng tạo"
,
"Positive attitude"
:
"Thể hiện thái độ tích cực"
,
"Attention to detail"
:
"Có sự chú ý đến chi tiết của vấn đề"
,
"Thorough explanation"
:
"Giải thích kỹ lưỡng"
,
"Don't like the style"
:
"Không thích phong cách trả lời"
,
"Not factually correct"
:
"Không chính xác so với thực tế"
,
"Didn't fully follow instructions"
:
"Không tuân theo chỉ dẫn một cách đầy đủ"
,
"Refused when it shouldn't have"
:
"Từ chối trả lời mà nhẽ không nên làm vậy"
,
"Being lazy"
:
"Lười biếng"
,
"Other"
:
"Khác"
,
"Thanks for your feedback!"
:
"Cám ơn bạn đã gửi phản hồi!"
,
"Tell us more:"
:
"Hãy cho chúng tôi hiểu thêm về chất lượng của câu trả lời:"
,
"Feel free to add specific details"
:
"Mô tả chi tiết về chất lượng của câu hỏi và phương án trả lời"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment