mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Translate all the strings
This commit is contained in:
17 files changed
+569
-191
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useState, useRef, useEffect, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
@@ -67,6 +68,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
isBuildLoading: externalIsBuildLoading,
|
||||
isDeployLoading: externalIsDeployLoading
|
||||
}, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const [input, setInput] = useState('');
|
||||
const [systemPrompt, setSystemPrompt] = useState('');
|
||||
const [showScrollToBottom, setShowScrollToBottom] = useState(false);
|
||||
@@ -417,12 +419,12 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
<div className="text-center space-y-4 max-w-md mx-auto p-6">
|
||||
<div className="text-4xl mb-4">🤖</div>
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">AI Assistant Not Configured</h3>
|
||||
<h3 className="text-lg font-semibold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">{t('aiNotConfigured')}</h3>
|
||||
<p className="text-sm text-muted-foreground mb-4">
|
||||
Please configure your AI settings to start building with AI assistance.
|
||||
{t('configureAI')}
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Use the menu in the top bar to access AI Settings.
|
||||
{t('useMenuForAI')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -445,16 +447,16 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
<div className="text-6xl mb-6">🎭</div>
|
||||
<div>
|
||||
<h3 className="text-xl font-semibold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||
Welcome to Shakespeare
|
||||
{t('welcomeToShakespeare')}
|
||||
</h3>
|
||||
<p className="text-muted-foreground mb-6 leading-relaxed">
|
||||
Your AI-powered development assistant is ready to help you build, edit, and enhance your project.
|
||||
{t('aiAssistantReady')}
|
||||
</p>
|
||||
<div className="space-y-2 text-sm text-muted-foreground">
|
||||
<p>💡 Ask me to add new features</p>
|
||||
<p>📝 Request file edits and improvements</p>
|
||||
<p>🔧 Get help with debugging and optimization</p>
|
||||
<p>🚀 Build and deploy your project</p>
|
||||
<p>{t('askMeFeatures')}</p>
|
||||
<p>{t('requestEdits')}</p>
|
||||
<p>{t('getHelp')}</p>
|
||||
<p>{t('buildDeploy')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -512,7 +514,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
<div className="flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground">
|
||||
<Loader2 className="h-3 w-3 animate-spin flex-shrink-0" />
|
||||
<span className="font-medium">
|
||||
Running {streamingMessage.tool_calls?.[0]?.function?.name || 'tool'}...
|
||||
{t('running')} {streamingMessage.tool_calls?.[0]?.function?.name || 'tool'}...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -543,7 +545,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
onKeyDown={handleKeyDown}
|
||||
onPaste={handlePaste}
|
||||
onFocus={handleFirstInteraction}
|
||||
placeholder={providerModel.trim() ? "Ask me to add features, edit files, or build your project..." : "Please select a model to start chatting..."}
|
||||
placeholder={providerModel.trim() ? t('askToAddFeatures') : t('selectModelFirst')}
|
||||
className="flex-1 resize-none border-0 bg-transparent px-4 py-3 text-sm focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground"
|
||||
disabled={isLoading || !providerModel.trim()}
|
||||
rows={1}
|
||||
@@ -583,7 +585,11 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Context usage: {lastInputTokens.toLocaleString()} / {currentModel.contextLength.toLocaleString()} tokens ({contextUsagePercentage.toFixed(1)}%)</p>
|
||||
<p>{t('contextUsage', {
|
||||
tokens: lastInputTokens.toLocaleString(),
|
||||
total: currentModel.contextLength.toLocaleString(),
|
||||
percentage: contextUsagePercentage.toFixed(1)
|
||||
})}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
@@ -599,7 +605,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Total cost for this chat session</p>
|
||||
<p>{t('totalCostSession')}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
@@ -612,7 +618,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
onChange={setProviderModel}
|
||||
className="w-full"
|
||||
disabled={isLoading}
|
||||
placeholder="Choose a model..."
|
||||
placeholder={t('chooseModel')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
@@ -15,6 +16,7 @@ interface FileEditorProps {
|
||||
}
|
||||
|
||||
export function FileEditor({ filePath, content, onSave, isLoading, projectId }: FileEditorProps) {
|
||||
const { t } = useTranslation();
|
||||
const [editedContent, setEditedContent] = useState(content);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [hasChanges, setHasChanges] = useState(false);
|
||||
@@ -99,7 +101,7 @@ export function FileEditor({ filePath, content, onSave, isLoading, projectId }:
|
||||
<CardTitle className={cn("text-sm sm:text-base truncate flex-1 mr-2", gitStatusClasses)}>{filePath}</CardTitle>
|
||||
<div className="flex items-center space-x-1 sm:space-x-2">
|
||||
{hasChanges && (
|
||||
<span className="text-xs sm:text-sm text-muted-foreground hidden sm:inline">Unsaved changes</span>
|
||||
<span className="text-xs sm:text-sm text-muted-foreground hidden sm:inline">{t('unsavedChanges')}</span>
|
||||
)}
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
@@ -110,19 +112,19 @@ export function FileEditor({ filePath, content, onSave, isLoading, projectId }:
|
||||
{isSaving ? (
|
||||
<>
|
||||
<Loader2 className="mr-1 sm:mr-2 h-4 w-4 animate-spin" />
|
||||
<span className="hidden sm:inline">Saving...</span>
|
||||
<span className="hidden sm:inline">{t('saving')}</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Save className="sm:mr-2 h-4 w-4" />
|
||||
<span className="hidden sm:inline">Save</span>
|
||||
<span className="hidden sm:inline">{t('save')}</span>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground mt-1">
|
||||
Language: {getLanguageFromPath(filePath)}
|
||||
{t('languageLabel')}: {getLanguageFromPath(filePath)}
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useProjectsManager } from '@/hooks/useProjectsManager';
|
||||
import { useFS } from '@/hooks/useFS';
|
||||
import { useGitStatus } from '@/hooks/useGitStatus';
|
||||
@@ -22,6 +23,7 @@ interface FileNode {
|
||||
}
|
||||
|
||||
export function FileTree({ projectId, onFileSelect, selectedFile }: FileTreeProps) {
|
||||
const { t } = useTranslation();
|
||||
const [tree, setTree] = useState<FileNode[]>([]);
|
||||
const [filteredTree, setFilteredTree] = useState<FileNode[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
@@ -179,7 +181,7 @@ export function FileTree({ projectId, onFileSelect, selectedFile }: FileTreeProp
|
||||
for (const node of nodes) {
|
||||
if (node.type === 'file') {
|
||||
const fileNameMatch = node.name.toLowerCase().includes(searchTermLower);
|
||||
|
||||
|
||||
if (fileNameMatch) {
|
||||
results.push(node);
|
||||
}
|
||||
@@ -296,7 +298,7 @@ export function FileTree({ projectId, onFileSelect, selectedFile }: FileTreeProp
|
||||
<div className="relative">
|
||||
<Search className="absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="Search files..."
|
||||
placeholder={t('searchFiles')}
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
className="pl-8"
|
||||
@@ -313,7 +315,7 @@ export function FileTree({ projectId, onFileSelect, selectedFile }: FileTreeProp
|
||||
</div>
|
||||
) : filteredTree.length === 0 ? (
|
||||
<div className="text-center text-sm text-muted-foreground py-4">
|
||||
{searchTerm ? 'No files found matching your search' : 'No files found'}
|
||||
{searchTerm ? t('noFilesFoundSearch') : t('noFilesFound')}
|
||||
</div>
|
||||
) : (
|
||||
filteredTree.map(node => renderNode(node))
|
||||
|
||||
Reference in new issue
Block a user