Complete translation implementation for admin interface

- Fixed all hardcoded strings in admin components to use t() function
- Updated BrandingPage.tsx to use translations for watermark settings
- Updated EventsListPage.tsx to use translations for status labels
- Added missing translation keys to both en.json and de.json
- Fixed translations for:
  - System settings (general, storage, categories tabs)
  - Branding page (watermark settings, positions, opacity)
  - Email configuration and templates
  - Event list view (status labels, filters, actions)
  - Event detail view (all sections properly translated)
- Added comprehensive German translations for all new keys
- Ensured consistent translation usage across all admin pages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit is contained in:
2025-07-08 17:41:02 +02:00
co-authored by Claude
parent d594d00227
commit 1bc9b547c7
11 changed files with 491 additions and 356 deletions
+15 -15
View File
@@ -28,10 +28,10 @@ export const CMSPage: React.FC = () => {
cmsService.updatePage(slug, data),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['cms-pages'] });
toast.success('Page updated successfully');
toast.success(t('cms.pageUpdated'));
},
onError: () => {
toast.error('Failed to update page');
toast.error(t('toast.saveError'));
},
});
@@ -65,7 +65,7 @@ export const CMSPage: React.FC = () => {
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<Loading size="lg" text="Loading pages..." />
<Loading size="lg" text={t('cms.loadingPages')} />
</div>
);
}
@@ -75,15 +75,15 @@ export const CMSPage: React.FC = () => {
return (
<div>
<div className="mb-6">
<h1 className="text-2xl font-bold text-neutral-900">CMS Pages</h1>
<p className="text-neutral-600 mt-1">Manage legal and informational pages</p>
<h1 className="text-2xl font-bold text-neutral-900">{t('cms.title')}</h1>
<p className="text-neutral-600 mt-1">{t('cms.subtitle')}</p>
</div>
<div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
{/* Page Selection */}
<div className="lg:col-span-1">
<Card padding="md">
<h2 className="text-lg font-semibold text-neutral-900 mb-4">Pages</h2>
<h2 className="text-lg font-semibold text-neutral-900 mb-4">{t('cms.pages')}</h2>
<div className="space-y-2">
{pages?.map((page) => (
<button
@@ -106,7 +106,7 @@ export const CMSPage: React.FC = () => {
</Card>
<Card padding="md" className="mt-4">
<h3 className="text-sm font-semibold text-neutral-900 mb-3">Preview Links</h3>
<h3 className="text-sm font-semibold text-neutral-900 mb-3">{t('cms.previewLinks')}</h3>
<div className="space-y-2 text-sm">
<a
href={`${window.location.origin}/${selectedPage}?lang=en`}
@@ -115,7 +115,7 @@ export const CMSPage: React.FC = () => {
className="flex items-center gap-2 text-primary-600 hover:text-primary-700"
>
<Globe className="w-4 h-4" />
English Version
{t('cms.englishVersion')}
</a>
<a
href={`${window.location.origin}/${selectedPage}?lang=de`}
@@ -124,7 +124,7 @@ export const CMSPage: React.FC = () => {
className="flex items-center gap-2 text-primary-600 hover:text-primary-700"
>
<Globe className="w-4 h-4" />
German Version
{t('cms.germanVersion')}
</a>
</div>
</Card>
@@ -135,7 +135,7 @@ export const CMSPage: React.FC = () => {
<Card padding="md">
<div className="flex items-center justify-between mb-6">
<h2 className="text-lg font-semibold text-neutral-900">
Edit {t(`legal.${selectedPage}`)}
{t('cms.editPage', { page: t(`legal.${selectedPage}`) })}
</h2>
{/* Language Tabs */}
@@ -167,19 +167,19 @@ export const CMSPage: React.FC = () => {
{/* Title */}
<div>
<label className="block text-sm font-medium text-neutral-700 mb-1">
Page Title ({editingLang === 'en' ? 'English' : 'German'})
{t('cms.pageTitle')} ({editingLang === 'en' ? 'English' : 'German'})
</label>
<Input
value={editingLang === 'en' ? editForm.title_en || '' : editForm.title_de || ''}
onChange={(e) => handleTitleChange(e.target.value)}
placeholder="Enter page title..."
placeholder={t('cms.pageTitlePlaceholder')}
/>
</div>
{/* Content */}
<div>
<label className="block text-sm font-medium text-neutral-700 mb-1">
Page Content ({editingLang === 'en' ? 'English' : 'German'})
{t('cms.pageContent')} ({editingLang === 'en' ? 'English' : 'German'})
</label>
<CMSEditor
content={editingLang === 'en' ? editForm.content_en || '' : editForm.content_de || ''}
@@ -195,13 +195,13 @@ export const CMSPage: React.FC = () => {
isLoading={updateMutation.isPending}
leftIcon={<Save className="w-4 h-4" />}
>
Save Changes
{t('cms.saveChanges')}
</Button>
</div>
{currentPage?.updated_at && (
<p className="text-xs text-neutral-500 mt-4">
Last updated: {new Date(currentPage.updated_at).toLocaleString()}
{t('cms.lastUpdated')} {new Date(currentPage.updated_at).toLocaleString()}
</p>
)}
</Card>