Skip to content

Commit

Permalink
feat: add translation on copy bottun
Browse files Browse the repository at this point in the history
  • Loading branch information
mame7777 committed Jan 9, 2025
1 parent bddc298 commit 7c2f959
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backend/chainlit/translations/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "ব্যর্থ",
"feedbackUpdated": "ফিডব্যাক আপডেট হয়েছে",
"updating": "আধুনিকীকরণ"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
"failed": "failed",
"feedbackUpdated": "Feedback updated",
"updating": "Updating"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/gu.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "નિષ્ફળ",
"feedbackUpdated": "પ્રતિસાદ સુધારેલ છે",
"updating": "સુધારી રહ્યા છીએ"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/he-IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "נכשל",
"feedbackUpdated": "משוב עודכן",
"updating": "מעדכן"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "असफल",
"feedbackUpdated": "प्रतिक्रिया अपडेट की गई",
"updating": "अद्यतन"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "ವಿಫಲವಾಗಿದೆ",
"feedbackUpdated": "ಪ್ರತಿಕ್ರಿಯೆ ನವೀಕರಿಸಲಾಗಿದೆ",
"updating": "ನವೀಕರಿಸಲಾಗುತ್ತಿದೆ"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "പരാജയപ്പെട്ടു",
"feedbackUpdated": "ഫീഡ്ബാക്ക് അപ് ഡേറ്റുചെയ് തു",
"updating": "അപ് ഡേറ്റ്"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/mr.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "अपयशी ठरले",
"feedbackUpdated": "अभिप्राय अद्ययावत",
"updating": "अद्ययावत करणे"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
"failed": "mislukt",
"feedbackUpdated": "Feedback bijgewerkt",
"updating": "Bijwerken"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "தோல்வியுற்றது",
"feedbackUpdated": "கருத்து புதுப்பிக்கப்பட்டது",
"updating": "புதுப்பிக்கிறது"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/te.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"failed": "విఫలమైంది",
"feedbackUpdated": "ఫీడ్ బ్యాక్ అప్ డేట్ చేయబడింది",
"updating": "అప్ డేట్ చేయడం"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 4 additions & 0 deletions backend/chainlit/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
"failed": "失败",
"feedbackUpdated": "反馈更新",
"updating": "正在更新"
},
"copyButton": {
"copyToClipboard": "Copy to clipboard",
"copied": "Copied!"
}
},
"dropScreen": {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
TooltipProvider,
TooltipTrigger
} from '@/components/ui/tooltip';
import { useTranslation } from '@/components/i18n/Translator';

interface Props {
content: unknown;
Expand All @@ -17,6 +18,7 @@ interface Props {

const CopyButton = ({ content, className }: Props) => {
const [copied, setCopied] = useState(false);
const { t } = useTranslation();

const copyToClipboard = async () => {
try {
Expand Down Expand Up @@ -55,7 +57,7 @@ const CopyButton = ({ content, className }: Props) => {
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{copied ? 'Copied!' : 'Copy to clipboard'}</p>
<p>{copied ? t('components.organisms.chat.Messages.copyButton.copied') : t('components.organisms.chat.Messages.copyButton.copyToClipboard')}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
Expand Down

0 comments on commit 7c2f959

Please sign in to comment.