Skip to content

Commit 0e78bbb

Browse files
committed
refactor: replace t with translate in i18n hook usage across components
1 parent e83f497 commit 0e78bbb

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/components/LoginForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const LoginForm = () => {
1717
setError('');
1818

1919
if (!username || !password) {
20-
setError(t('loginForm.errorBothRequired'));
20+
setError(translate('loginForm.errorBothRequired'));
2121
return;
2222
}
2323

src/components/MobileNav.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTranslation } from '../i18n';
55

66
function MobileNav({ activeTab, setActiveTab, isInputFocused }) {
77
const { tasksEnabled } = useTasksSettings();
8-
const { t } = useTranslation();
8+
const { translate } = useTranslation();
99
const navItems = [
1010
{
1111
id: 'chat',

src/components/Onboarding.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ const Onboarding = ({ onComplete }) => {
162162
// Step 0: Git config validation and submission
163163
if (currentStep === 0) {
164164
if (!gitName.trim() || !gitEmail.trim()) {
165-
setError(t('onboarding.errors.nameEmailRequired'));
165+
setError(translate('onboarding.errors.nameEmailRequired'));
166166
return;
167167
}
168168

169169
// Validate email format
170170
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
171171
if (!emailRegex.test(gitEmail)) {
172-
setError(t('onboarding.errors.invalidEmail'));
172+
setError(translate('onboarding.errors.invalidEmail'));
173173
return;
174174
}
175175

src/components/ProjectCreationWizard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ const ProjectCreationWizard = ({ onClose, onProjectCreated }) => {
9191

9292
if (step === 1) {
9393
if (!workspaceType) {
94-
setError(t('projectWizard.selectTypeError'));
94+
setError(translate('projectWizard.selectTypeError'));
9595
return;
9696
}
9797
setStep(2);
9898
} else if (step === 2) {
9999
if (!workspacePath.trim()) {
100-
setError(t('projectWizard.pathRequiredError'));
100+
setError(translate('projectWizard.pathRequiredError'));
101101
return;
102102
}
103103

src/components/Settings.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function Settings({ isOpen, onClose, projects = [], initialTab = 'tools' }) {
632632
};
633633

634634
const handleMcpDelete = async (serverId, scope) => {
635-
if (confirm(t('common.deleteConfirm'))) {
635+
if (confirm(translate('common.deleteConfirm'))) {
636636
try {
637637
await deleteMcpServer(serverId, scope);
638638
setSaveStatus('success');

src/components/SetupForm.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ const SetupForm = () => {
1818
setError('');
1919

2020
if (password !== confirmPassword) {
21-
setError(t('setupForm.errorPasswordMismatch'));
21+
setError(translate('setupForm.errorPasswordMismatch'));
2222
return;
2323
}
2424

2525
if (username.length < 3) {
26-
setError(t('setupForm.errorUsernameLength'));
26+
setError(translate('setupForm.errorUsernameLength'));
2727
return;
2828
}
2929

3030
if (password.length < 6) {
31-
setError(t('setupForm.errorPasswordLength'));
31+
setError(translate('setupForm.errorPasswordLength'));
3232
return;
3333
}
3434

0 commit comments

Comments
 (0)