fix(i18n): add missing marketplace.accessDenied and translate calendar form
- Add marketplace.accessDenied to de.json and en.json - Add 12 calendar form field/action keys to widgets.calendar in both locales - Replace all hardcoded English strings in calendar-source-form.tsx with t() calls - Remove locale-detection hack on Cancel button (was comparing t() result to English string) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,16 +83,16 @@ export function CalendarSourceForm({
|
||||
try {
|
||||
const parsed = new URL(value);
|
||||
if (parsed.protocol !== 'https:') {
|
||||
setUrlError('URL must use HTTPS protocol');
|
||||
setUrlError(t('calendar.formUrlErrorHttps'));
|
||||
return false;
|
||||
}
|
||||
setUrlError('');
|
||||
return true;
|
||||
} catch {
|
||||
setUrlError('Invalid URL format');
|
||||
setUrlError(t('calendar.formUrlErrorInvalid'));
|
||||
return false;
|
||||
}
|
||||
}, []);
|
||||
}, [t]);
|
||||
|
||||
// Form is valid when name, type, and url are filled and url is https
|
||||
const isFormValid =
|
||||
@@ -136,7 +136,7 @@ export function CalendarSourceForm({
|
||||
{/* Name */}
|
||||
<div>
|
||||
<label htmlFor="source-name" className="mb-1 block text-sm text-foreground">
|
||||
Name *
|
||||
{t('calendar.formFieldName')} *
|
||||
</label>
|
||||
<input
|
||||
id="source-name"
|
||||
@@ -151,7 +151,7 @@ export function CalendarSourceForm({
|
||||
{/* Type */}
|
||||
<div>
|
||||
<label htmlFor="source-type" className="mb-1 block text-sm text-foreground">
|
||||
Type *
|
||||
{t('calendar.formFieldType')} *
|
||||
</label>
|
||||
<select
|
||||
id="source-type"
|
||||
@@ -176,7 +176,7 @@ export function CalendarSourceForm({
|
||||
htmlFor="exchange-mode"
|
||||
className="mb-1 block text-sm text-foreground"
|
||||
>
|
||||
Exchange Mode
|
||||
{t('calendar.formFieldExchangeMode')}
|
||||
</label>
|
||||
<select
|
||||
id="exchange-mode"
|
||||
@@ -196,7 +196,7 @@ export function CalendarSourceForm({
|
||||
{/* URL */}
|
||||
<div>
|
||||
<label htmlFor="source-url" className="mb-1 block text-sm text-foreground">
|
||||
URL *
|
||||
{t('calendar.formFieldUrl')} *
|
||||
</label>
|
||||
<input
|
||||
id="source-url"
|
||||
@@ -228,7 +228,7 @@ export function CalendarSourceForm({
|
||||
htmlFor="source-username"
|
||||
className="mb-1 block text-sm text-foreground"
|
||||
>
|
||||
Username
|
||||
{t('calendar.formFieldUsername')}
|
||||
</label>
|
||||
<input
|
||||
id="source-username"
|
||||
@@ -247,7 +247,7 @@ export function CalendarSourceForm({
|
||||
htmlFor="source-password"
|
||||
className="mb-1 block text-sm text-foreground"
|
||||
>
|
||||
Password
|
||||
{t('calendar.formFieldPassword')}
|
||||
</label>
|
||||
<input
|
||||
id="source-password"
|
||||
@@ -261,7 +261,7 @@ export function CalendarSourceForm({
|
||||
|
||||
{/* Color */}
|
||||
<div>
|
||||
<label className="mb-1 block text-sm text-foreground">Color</label>
|
||||
<label className="mb-1 block text-sm text-foreground">{t('calendar.formFieldColor')}</label>
|
||||
<div className="flex gap-2">
|
||||
{SOURCE_COLOR_PALETTE.map((c) => (
|
||||
<button
|
||||
@@ -288,14 +288,14 @@ export function CalendarSourceForm({
|
||||
disabled={!isFormValid || isSaving}
|
||||
className="rounded bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
{isSaving ? 'Saving...' : 'Save'}
|
||||
{isSaving ? t('calendar.formSaving') : t('calendar.formSave')}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onCancel}
|
||||
className="rounded border border-border px-4 py-2 text-sm text-foreground transition-colors hover:bg-muted"
|
||||
>
|
||||
{t('calendar.addSource') === 'Add source' ? 'Cancel' : 'Abbrechen'}
|
||||
{t('calendar.formCancel')}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user