-
- {#if backgroundPreview || info.meta.background_image_url}
+
+ {#if editingLocale}
+
+ {$i18n.t('Description ({{language}})', {
+ language: editingLocaleLabel || editingLocale
+ })}
+
+
+ setLocalizedField('description', info.meta.description ?? '')}
>
- {/if}
-
-
-
{
- const selected = backgroundInput.files?.[0];
- backgroundInput.value = '';
- if (!selected || loading) return;
- loading = true;
- const candidate = URL.createObjectURL(selected);
- try {
- if (
- !['image/png', 'image/jpeg', 'image/webp', 'image/gif'].includes(
- selected.type
- )
- ) {
- throw new Error(
- $i18n.t('Background image must be PNG, JPEG, WebP, or GIF.')
- );
- }
- if (selected.size > 5 * 1024 * 1024)
- throw new Error($i18n.t('Background image must be at most 5 MiB.'));
- const image = new Image();
- image.src = candidate;
- await image.decode();
- if (image.naturalWidth * image.naturalHeight > 25_000_000) {
- throw new Error(
- $i18n.t('Background image must be at most 25 megapixels.')
- );
- }
- clearBackgroundPreview();
- backgroundPreview = candidate;
- backgroundFile = selected;
- } catch (error) {
- URL.revokeObjectURL(candidate);
- toast.error(
- error instanceof Error
- ? error.message
- : $i18n.t('Invalid background image.')
- );
- } finally {
- loading = false;
- }
- }}
- />
- {#if backgroundPreview || info.meta.background_image_url}
-

- {/if}
-
- {$i18n.t('PNG, JPEG, WebP, or GIF. Up to 5 MiB and 25 megapixels.')}
-
-
-
-
- {editingLocale
- ? $i18n.t('Description ({{language}})', {
- language: editingLocaleLabel || editingLocale
- })
- : $i18n.t('Description')}
+ {$i18n.t('Copy default')}
+
+ {#if localizedField('description')}
+
+ {/if}
+
+ {:else}
+
+ {/if}
{#if editingLocale}
-
-
- {#if localizedField('description')}
-
- {/if}
-
- {:else}
-
+