From e1f69e2a9d91d131e48bd72c1418d2b794799b7e Mon Sep 17 00:00:00 2001 From: Alex Netsch Date: Fri, 14 Nov 2025 17:24:23 +0000 Subject: [PATCH] Fix create PR gh helper i18n (vibe-kanban) (#1290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Perfect! I've successfully fixed all i18n issues for the Create PR GitHub helper. Here's a summary of what was completed: ## Summary All i18n issues have been resolved! The `check-i18n.sh` script now passes with flying colors. ### Changes Made: 1. **Added translation keys to tasks.json** (all 4 languages: en, ja, ko, es): - `createPrDialog.title`: "Create GitHub Pull Request" - `createPrDialog.description`: Dialog description - `createPrDialog.titleLabel`, `titlePlaceholder`: PR title field - `createPrDialog.descriptionLabel`, `descriptionPlaceholder`: PR description field - `createPrDialog.baseBranchLabel`: Base branch selector - `createPrDialog.loadingBranches`, `selectBaseBranch`: Branch loading states - `createPrDialog.creating`, `createButton`: Submit button states - `createPrDialog.errors.*`: All error messages (insufficientPermissions, repoNotFoundOrNoAccess, failedToCreate) 2. **Updated CreatePRDialog.tsx**: - Changed `useTranslation()` to `useTranslation('tasks')` to specify namespace - Replaced all 14 hardcoded strings with `t('createPrDialog.*')` translation calls - Used `t('common:buttons.cancel')` for the cancel button 3. **Added integrations.github.cliSetup keys to settings.json** (all 4 languages): - Created new `integrations` namespace at root level - Added all GitHub CLI setup keys that were previously only in `settings.general.github` - This ensures the keys exist at both paths for backward compatibility ### Test Results: ✅ **No new literal strings introduced** - Actually removed 6 hardcoded strings! ✅ **No duplicate JSON keys found** ✅ **Translation keys are consistent across all locales** (en, ja, ko, es) The implementation properly handles all error cases, dialog fields, and button states with proper i18n support across all 4 supported languages. * Cleanup script changes for task attempt 30cf60d2-f2bc-443a-9c72-28b94962f155 --- .../dialogs/tasks/CreatePRDialog.tsx | 44 ++++++++++--------- frontend/src/i18n/locales/en/settings.json | 35 +++++++++++++++ frontend/src/i18n/locales/en/tasks.json | 16 +++++++ frontend/src/i18n/locales/es/settings.json | 35 +++++++++++++++ frontend/src/i18n/locales/es/tasks.json | 16 +++++++ frontend/src/i18n/locales/ja/settings.json | 35 +++++++++++++++ frontend/src/i18n/locales/ja/tasks.json | 16 +++++++ frontend/src/i18n/locales/ko/settings.json | 35 +++++++++++++++ frontend/src/i18n/locales/ko/tasks.json | 16 +++++++ 9 files changed, 227 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/dialogs/tasks/CreatePRDialog.tsx b/frontend/src/components/dialogs/tasks/CreatePRDialog.tsx index 6c80b8bc..c0f6316f 100644 --- a/frontend/src/components/dialogs/tasks/CreatePRDialog.tsx +++ b/frontend/src/components/dialogs/tasks/CreatePRDialog.tsx @@ -39,7 +39,7 @@ import type { GhCliSetupError } from 'shared/types'; import { useUserSystem } from '@/components/config-provider'; const CreatePrDialog = NiceModal.create(() => { const modal = useModal(); - const { t } = useTranslation(); + const { t } = useTranslation('tasks'); const { isLoaded } = useAuth(); const { environment } = useUserSystem(); const data = modal.args as @@ -188,19 +188,15 @@ const CreatePrDialog = NiceModal.create(() => { return; } case GitHubServiceError.INSUFFICIENT_PERMISSIONS: - setError( - 'Insufficient permissions. Please ensure the GitHub CLI has the necessary permissions.' - ); + setError(t('createPrDialog.errors.insufficientPermissions')); setGhCliHelp(null); return; case GitHubServiceError.REPO_NOT_FOUND_OR_NO_ACCESS: - setError( - 'Repository not found or no access. Please check your repository access and ensure you are authenticated.' - ); + setError(t('createPrDialog.errors.repoNotFoundOrNoAccess')); setGhCliHelp(null); return; default: - setError(result.message || 'Failed to create GitHub PR'); + setError(result.message || t('createPrDialog.errors.failedToCreate')); setGhCliHelp(null); return; } @@ -210,7 +206,7 @@ const CreatePrDialog = NiceModal.create(() => { setError(result.message); setGhCliHelp(null); } else { - setError('Failed to create GitHub PR'); + setError(t('createPrDialog.errors.failedToCreate')); setGhCliHelp(null); } }, [data, prBaseBranch, prBody, prTitle, modal, isMacEnvironment]); @@ -231,9 +227,9 @@ const CreatePrDialog = NiceModal.create(() => { handleCancelCreatePR()}> - Create GitHub Pull Request + {t('createPrDialog.title')} - Create a pull request for this task attempt on GitHub. + {t('createPrDialog.description')} {!isLoaded ? ( @@ -243,34 +239,40 @@ const CreatePrDialog = NiceModal.create(() => { ) : (
- + setPrTitle(e.target.value)} - placeholder="Enter PR title" + placeholder={t('createPrDialog.titlePlaceholder')} />
- +