Polish Swedish locale support
This commit is contained in:
parent
39aae25e81
commit
17832fef46
3 changed files with 10 additions and 3 deletions
|
|
@ -202,6 +202,7 @@ export async function POST(req: Request) {
|
|||
const priceHintPerNightEuros = body.priceHintPerNightEuros !== undefined && body.priceHintPerNightEuros !== null && body.priceHintPerNightEuros !== '' ? Math.round(Number(body.priceHintPerNightEuros)) : null;
|
||||
const calendarUrls = normalizeCalendarUrls(body.calendarUrls);
|
||||
const translationsInputRaw = Array.isArray(body.translations) ? body.translations : [];
|
||||
type TranslationInput = { locale: string; title: string; description: string; teaser: string | null; slug: string };
|
||||
const translationsInput =
|
||||
translationsInputRaw
|
||||
.map((item: any) => ({
|
||||
|
|
@ -332,7 +333,7 @@ export async function POST(req: Request) {
|
|||
published: status === ListingStatus.PUBLISHED,
|
||||
isSample,
|
||||
translations: {
|
||||
create: translationsInput.map((t) => ({
|
||||
create: translationsInput.map((t: TranslationInput) => ({
|
||||
locale: t.locale,
|
||||
slug: t.slug || slug,
|
||||
title: t.title,
|
||||
|
|
|
|||
|
|
@ -357,7 +357,13 @@ export default function NewListingPage() {
|
|||
</label>
|
||||
<label style={{ display: 'grid', gap: 6, marginTop: 8 }}>
|
||||
<span>{t('aiResponseLabel')}</span>
|
||||
<textarea value={aiResponse} onChange={(e) => setAiResponse(e.target.value)} rows={6} placeholder="{\"locales\":{\"fi\":{\"title\":\"...\"}}}" style={{ fontFamily: 'monospace' }} />
|
||||
<textarea
|
||||
value={aiResponse}
|
||||
onChange={(e) => setAiResponse(e.target.value)}
|
||||
rows={6}
|
||||
placeholder='{"locales":{"fi":{"title":"..."}}}'
|
||||
style={{ fontFamily: 'monospace' }}
|
||||
/>
|
||||
</label>
|
||||
<div style={{ display: 'flex', gap: 10, marginTop: 8, flexWrap: 'wrap' }}>
|
||||
<button type="button" className="button secondary" onClick={() => applyAiResponse()}>
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ const baseMessages = {
|
|||
},
|
||||
} as const;
|
||||
|
||||
const svMessages: typeof baseMessages.en = {
|
||||
const svMessages: Record<keyof typeof baseMessages.en, string> = {
|
||||
...baseMessages.en,
|
||||
navProfile: 'Profil',
|
||||
navMyListings: 'Mina annonser',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue