Add more content languages

This commit is contained in:
John Rallis 2026-06-30 14:17:30 +03:00
parent bfa018a4cd
commit eb0ec6fb24
4 changed files with 38 additions and 2 deletions

View file

@ -32,7 +32,7 @@ public function rules(): array
'text_color' => $hex,
'brand_font' => ['sometimes', 'string', Rule::in(BrandFont::values())],
'image_style' => ['sometimes', 'string', Rule::in(ImageStyle::values())],
'content_language' => ['nullable', 'string', 'in:en,pt-BR,es'],
'content_language' => ['nullable', 'string', 'in:en,pt-BR,es,fr,de,it,nl,pl,el,ja,ko,zh,ru,tr,ar'],
'logo_url' => ['nullable', 'url', 'max:1024'],
];
}

View file

@ -32,7 +32,7 @@ public function rules(): array
'text_color' => $hex,
'brand_font' => ['sometimes', 'required', 'string', Rule::in(BrandFont::values())],
'image_style' => ['sometimes', 'required', 'string', Rule::in(ImageStyle::values())],
'content_language' => ['sometimes', 'string', 'in:en,pt-BR,es'],
'content_language' => ['sometimes', 'string', 'in:en,pt-BR,es,fr,de,it,nl,pl,el,ja,ko,zh,ru,tr,ar'],
];
}

View file

@ -297,6 +297,18 @@ private function extractLanguage(Crawler $crawler): ?string
str_starts_with($lower, 'pt') => 'pt-BR',
str_starts_with($lower, 'es') => 'es',
str_starts_with($lower, 'en') => 'en',
str_starts_with($lower, 'fr') => 'fr',
str_starts_with($lower, 'de') => 'de',
str_starts_with($lower, 'it') => 'it',
str_starts_with($lower, 'nl') => 'nl',
str_starts_with($lower, 'pl') => 'pl',
str_starts_with($lower, 'el') => 'el',
str_starts_with($lower, 'ja') => 'ja',
str_starts_with($lower, 'ko') => 'ko',
str_starts_with($lower, 'zh') => 'zh',
str_starts_with($lower, 'ru') => 'ru',
str_starts_with($lower, 'tr') => 'tr',
str_starts_with($lower, 'ar') => 'ar',
default => null,
};
}

View file

@ -100,6 +100,18 @@ const languageLabel = computed(() => {
en: 'English',
'pt-BR': 'Português (Brasil)',
es: 'Español',
fr: 'Français',
de: 'Deutsch',
it: 'Italiano',
nl: 'Nederlandse',
pl: 'Polski',
el: 'Ελληνικά',
ja: '日本語',
ko: '한국어',
zh: '现代标准汉语',
ru: 'Русский',
tr: 'Türkçe',
ar: 'العربية',
};
return map[props.fields.content_language] ?? '';
});
@ -200,6 +212,18 @@ const runAutofill = async () => {
<SelectItem value="en">English</SelectItem>
<SelectItem value="pt-BR">Português (Brasil)</SelectItem>
<SelectItem value="es">Español</SelectItem>
<SelectItem value="fr">Français</SelectItem>
<SelectItem value="de">Deutsch</SelectItem>
<SelectItem value="it">Italiano</SelectItem>
<SelectItem value="nl">Nederlandse</SelectItem>
<SelectItem value="pl">Polski</SelectItem>
<SelectItem value="el">Ελληνικά</SelectItem>
<SelectItem value="ja">日本語</SelectItem>
<SelectItem value="ko">한국어</SelectItem>
<SelectItem value="zh">现代标准汉语</SelectItem>
<SelectItem value="ru">Русский</SelectItem>
<SelectItem value="tr">Türkçe</SelectItem>
<SelectItem value="ar">العربية</SelectItem>
</SelectContent>
</Select>
<p class="text-xs font-medium text-foreground/60">