Make the detail column useful for places no encyclopaedia describes

A restaurant got nothing: no wiki article, and a coordinate search around it
returns whatever was photographed nearby rather than the place itself. Three
changes, all on free sources:

OpenStreetMap facts. A tagged restaurant carries its cuisine, its opening hours,
a link to its menu, outdoor seating, step-free access and diet tags. Those
arrive with the details lookup the dialog already makes, so showing them as
chips costs nothing and is the single biggest gain for exactly the places that
were empty before. Only positive facts are listed - "no outdoor seating" is
noise.

Commons categories. Where a place has a wikimedia_commons tag, its category is
pictures OF it; geosearch falls back in when the category is empty.

Wikivoyage before Wikipedia. Same API, same licence, but it describes a place
for someone about to visit rather than opening with area in square kilometres.
Two sentences instead of three, because this sits beside a form.

The column also follows the section-heading idiom Vacay and the dashboard share
(uppercase overline, wide tracking), its header matches the Saved places panel
beside it, and a lead picture with a row underneath replaces the two-column
grid that left a hole on every odd count. Credits wrap over two lines instead
of truncating - a cut-off name credits nobody.

Saved places stops after ten with a Show more button; search and filters still
run over everything, not just the visible page.

Form spacing is one rhythm (12px between groups, 8px inside, 4px label to
field) and Notes matches Description in height. The OSM notice fits on one line
and no longer claims there are no photos, which stopped being true when the
column started fetching them from Wikimedia. The clipboard hint is gone; paste
still works.
This commit is contained in:
Maurice
2026-08-09 23:37:02 +02:00
committed by Maurice
parent fc9ac64496
commit d98d597581
61 changed files with 1120 additions and 232 deletions
@@ -53,6 +53,50 @@ describe('CollectionPicker', () => {
vi.restoreAllMocks()
})
it('FE-COMP-COLPICKER-017: shows the first ten and offers the rest behind a button', async () => {
// Saved places accumulate across every list, so the panel used to scroll
// without end.
const many = Array.from({ length: 23 }, (_, i) =>
place({ id: 100 + i, collection_id: 1, name: `Place ${String(i).padStart(2, '0')}` }),
)
vi.spyOn(collectionsApi, 'get').mockImplementation(async (id: number) =>
id === 1 ? detail(listA, many) : detail(listB, []),
)
setup()
expect(await screen.findByText('Place 00')).toBeInTheDocument()
expect(screen.getByText('Place 09')).toBeInTheDocument()
expect(screen.queryByText('Place 10')).not.toBeInTheDocument()
const more = () => screen.getByRole('button', { name: /show .* more/i })
fireEvent.click(more())
expect(screen.getByText('Place 19')).toBeInTheDocument()
expect(screen.queryByText('Place 20')).not.toBeInTheDocument()
fireEvent.click(more())
expect(screen.getByText('Place 22')).toBeInTheDocument()
// Nothing left to ask for.
expect(screen.queryByRole('button', { name: /more/i })).not.toBeInTheDocument()
})
it('FE-COMP-COLPICKER-018: searching resets the page and looks at every place, not just the visible ten', async () => {
const many = Array.from({ length: 23 }, (_, i) =>
place({ id: 100 + i, collection_id: 1, name: `Place ${String(i).padStart(2, '0')}` }),
)
vi.spyOn(collectionsApi, 'get').mockImplementation(async (id: number) =>
id === 1 ? detail(listA, many) : detail(listB, []),
)
setup()
await screen.findByText('Place 00')
// "Place 22" is well past the first page; the filter has to reach it.
fireEvent.change(screen.getByPlaceholderText(/search/i), { target: { value: 'Place 22' } })
expect(screen.getByText('Place 22')).toBeInTheDocument()
expect(screen.queryByText('Place 00')).not.toBeInTheDocument()
expect(screen.queryByRole('button', { name: /more/i })).not.toBeInTheDocument()
})
it('FE-COMP-COLPICKER-001: shows a spinner until the lists have loaded', async () => {
const { container } = setup()
expect(container.querySelector('.animate-spin')).toBeTruthy()
@@ -130,6 +130,11 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker
[bias],
)
// The list is every saved place across every collection, which grows without
// bound. Show a first page and let the rest be asked for.
const PAGE = 10
const [shown, setShown] = useState(PAGE)
const visible = useMemo(() => {
const q = search.trim().toLowerCase()
const list = places.filter(p => {
@@ -143,6 +148,13 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker
return list
}, [places, search, center, listFilter, statusFilter])
// Searching or filtering starts a new list; keeping the old offset would drop
// the user somewhere in the middle of it.
useEffect(() => { setShown(PAGE) }, [search, listFilter, statusFilter])
const page = visible.slice(0, shown)
const remaining = visible.length - page.length
const listOpts: Opt[] = [
{ key: 'all', label: t('collections.picker.allLists'), icon: <Layers size={13} />, count: places.length },
...lists.map(l => ({
@@ -192,7 +204,7 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker
<p className="text-center text-[12px] text-content-faint py-10 px-3">{t('collections.picker.empty')}</p>
) : (
<div className="flex flex-col gap-1">
{visible.map(place => (
{page.map(place => (
<button
key={place.id}
type="button"
@@ -207,6 +219,17 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker
</span>
</button>
))}
{remaining > 0 && (
<div className="pt-1 mt-1 border-t border-edge">
<button
type="button"
onClick={() => setShown(n => n + PAGE)}
className="w-full px-2 py-1.5 rounded-lg text-[12px] font-medium text-content-secondary hover:bg-surface-hover transition-colors"
>
{t('collections.picker.showMore', { count: remaining })}
</button>
</div>
)}
</div>
)}
</div>
@@ -41,6 +41,7 @@ const GOOGLE_PHOTO = {
const RESULT: MapsPlaceEnrichmentResult = {
photos: [COMMONS_PHOTO],
facts: [],
description: {
text: 'Ein Museum in Köln.',
source: 'wikipedia',
@@ -120,7 +121,7 @@ describe('PlaceDetailsColumn', () => {
})
it('FE-PDC-005: names the source when a picture has no author, instead of inventing one', async () => {
placeEnrichment.mockResolvedValue({ photos: [GOOGLE_PHOTO], description: null })
placeEnrichment.mockResolvedValue({ photos: [GOOGLE_PHOTO], description: null, facts: [] })
renderColumn()
expect(await screen.findByText('Google')).toBeInTheDocument()
@@ -169,17 +170,69 @@ describe('PlaceDetailsColumn', () => {
})
it('FE-PDC-011: says so when the admin switched enrichment off', async () => {
placeEnrichment.mockResolvedValue({ photos: [], description: null, disabled: true })
placeEnrichment.mockResolvedValue({ photos: [], description: null, facts: [], disabled: true })
renderColumn()
expect(await screen.findByText('places.details.disabled')).toBeInTheDocument()
})
it('FE-PDC-012: says so when a place has no pictures', async () => {
placeEnrichment.mockResolvedValue({ photos: [], description: null })
it('FE-PDC-012: says so when a place yields nothing at all', async () => {
placeEnrichment.mockResolvedValue({ photos: [], description: null, facts: [] })
renderColumn()
expect(await screen.findByText('places.details.noPhotos')).toBeInTheDocument()
expect(await screen.findByText('places.details.nothing')).toBeInTheDocument()
})
it('FE-PDC-016: shows the OpenStreetMap facts, which is all a restaurant gets', async () => {
placeEnrichment.mockResolvedValue({
photos: [],
description: null,
facts: [
{ kind: 'cuisine', value: 'regional', url: null },
{ kind: 'openingHours', value: 'Mo-Sa 17:30+', url: null },
{ kind: 'menu', value: null, url: 'https://example.org/menu' },
{ kind: 'outdoorSeating', value: null, url: null },
],
})
renderColumn()
// A value is shown verbatim; a plain yes falls back to the translated label.
expect(await screen.findByText('regional')).toBeInTheDocument()
expect(screen.getByText('Mo-Sa 17:30+')).toBeInTheDocument()
expect(screen.getByText('places.details.fact.outdoorSeating')).toBeInTheDocument()
expect(screen.getByRole('link', { name: /places.details.fact.menu/ })).toHaveAttribute(
'href',
'https://example.org/menu',
)
})
it('FE-PDC-017: renders facts even when there is neither a picture nor a description', async () => {
placeEnrichment.mockResolvedValue({
photos: [],
description: null,
facts: [{ kind: 'cuisine', value: 'pizza', url: null }],
})
renderColumn()
expect(await screen.findByText('pizza')).toBeInTheDocument()
expect(screen.queryByText('places.details.nothing')).not.toBeInTheDocument()
})
it('FE-PDC-018: names Wikivoyage as the source when the text came from there', async () => {
placeEnrichment.mockResolvedValue({
photos: [],
facts: [],
description: {
text: 'Berlin ist das politische Zentrum Deutschlands.',
source: 'wikivoyage',
sourceUrl: 'https://de.wikivoyage.org/wiki/Berlin',
license: 'CC BY-SA 4.0',
},
})
renderColumn()
const link = await screen.findByRole('link', { name: /Wikivoyage/ })
expect(link).toHaveAttribute('href', 'https://de.wikivoyage.org/wiki/Berlin')
})
it('FE-PDC-013: shows an error state when the request fails', async () => {
@@ -1,6 +1,22 @@
import React, { useEffect, useRef, useState } from 'react'
import { Check, ImageOff, Loader2, ExternalLink } from 'lucide-react'
import type { MapsPlaceEnrichmentResult, PlacePhotoCandidate } from '@trek/shared'
import {
Accessibility,
Bike,
Check,
ChefHat,
Clock,
ExternalLink,
ImageOff,
Landmark,
Leaf,
Loader2,
ScrollText,
ShoppingBag,
Sprout,
Sun,
Wifi,
} from 'lucide-react'
import type { MapsPlaceEnrichmentResult, PlaceFact, PlacePhotoCandidate } from '@trek/shared'
import { mapsApi } from '../../api/client'
import type { TranslationFn } from '../../types'
@@ -60,6 +76,16 @@ function cacheKeyFor(selection: PlaceDetailsSelection, language: string): string
type LoadState = 'idle' | 'loading' | 'ready' | 'error'
/**
* Overline label, the section heading Vacay and the dashboard widgets share.
* Uppercase with wide tracking, muted, no rule underneath.
*/
function Overline({ children }: { children: React.ReactNode }): React.ReactElement {
return (
<p className="text-caption font-semibold uppercase tracking-[0.14em] text-content-faint">{children}</p>
)
}
export default function PlaceDetailsColumn({
selection,
selectedImageUrl,
@@ -127,10 +153,14 @@ export default function PlaceDetailsColumn({
useEffect(() => () => abortRef.current?.abort(), [])
const isEmpty =
state === 'ready' && !data?.disabled && !data?.photos.length && !data?.description && !data?.facts.length
return (
<aside className="w-full sm:w-72 shrink-0 flex flex-col rounded-xl border border-edge bg-surface-secondary overflow-hidden self-stretch">
<div className="px-3 py-2 border-b border-edge">
<p className="text-caption font-medium text-content">{t('places.details.title')}</p>
<div className="flex items-center gap-2 px-3 py-2.5 border-b border-edge shrink-0">
<Landmark size={15} className="text-accent" />
<span className="text-[13px] font-semibold text-content">{t('places.details.title')}</span>
</div>
<div className="flex-1 min-h-0 overflow-y-auto p-3 space-y-4">
@@ -149,14 +179,17 @@ export default function PlaceDetailsColumn({
<p className="text-caption text-content-muted">{t('places.details.disabled')}</p>
)}
{selection && state === 'ready' && !data?.disabled && (
{isEmpty && (
<div className="flex items-center gap-2 text-caption text-content-muted">
<ImageOff className="w-4 h-4 shrink-0" />
{t('places.details.nothing')}
</div>
)}
{selection && state === 'ready' && !data?.disabled && !isEmpty && (
<>
<PhotoStrip
photos={data?.photos ?? []}
selectedImageUrl={selectedImageUrl}
onPickImage={onPickImage}
t={t}
/>
<PhotoStrip photos={data?.photos ?? []} selectedImageUrl={selectedImageUrl} onPickImage={onPickImage} t={t} />
<FactList facts={data?.facts ?? []} t={t} />
<DescriptionBlock
description={data?.description ?? null}
hasDescription={hasDescription}
@@ -170,6 +203,13 @@ export default function PlaceDetailsColumn({
)
}
/**
* The picture strip: the first candidate wide, the rest as a row underneath.
*
* A plain two-column grid left a hole whenever an odd number of pictures came
* back, which is most of the time. A lead image also gives the column something
* to look at instead of a page of equal squares.
*/
function PhotoStrip({
photos,
selectedImageUrl,
@@ -180,45 +220,69 @@ function PhotoStrip({
selectedImageUrl?: string
onPickImage: (url: string | null) => void
t: TranslationFn
}): React.ReactElement {
if (photos.length === 0) {
return (
<div className="flex items-center gap-2 text-caption text-content-muted">
<ImageOff className="w-4 h-4" />
{t('places.details.noPhotos')}
</div>
)
}
}): React.ReactElement | null {
if (photos.length === 0) return null
const [lead, ...rest] = photos
return (
<div className="space-y-2">
<p className="text-caption text-content-muted">{t('places.details.pickImage')}</p>
<div className="grid grid-cols-2 gap-2">
{photos.map((photo) => {
const picked = selectedImageUrl === photo.url
return (
<div key={photo.key} className="space-y-1">
<button
type="button"
onClick={() => onPickImage(picked ? null : photo.url)}
aria-pressed={picked}
aria-label={photo.attribution ? `${t('places.details.pickImage')} — ${photo.attribution}` : t('places.details.pickImage')}
className={`relative block w-full aspect-square rounded-lg overflow-hidden border-2 transition-colors ${
picked ? 'border-accent' : 'border-edge hover:border-content-muted'
}`}
>
<img src={photo.url} alt="" loading="lazy" className="w-full h-full object-cover" />
{picked && (
<span className="absolute top-1 right-1 rounded-full bg-accent p-0.5">
<Check className="w-3 h-3 text-white" />
</span>
)}
</button>
<PhotoCredit photo={photo} />
</div>
)
})}
</div>
<Overline>{t('places.details.pickImage')}</Overline>
<PhotoTile photo={lead} wide selected={selectedImageUrl === lead.url} onPick={onPickImage} t={t} />
{rest.length > 0 && (
<div className="grid grid-cols-3 gap-2">
{rest.map((photo) => (
<PhotoTile
key={photo.key}
photo={photo}
selected={selectedImageUrl === photo.url}
onPick={onPickImage}
t={t}
/>
))}
</div>
)}
</div>
)
}
function PhotoTile({
photo,
wide = false,
selected,
onPick,
t,
}: {
photo: PlacePhotoCandidate
wide?: boolean
selected: boolean
onPick: (url: string | null) => void
t: TranslationFn
}): React.ReactElement {
return (
<div className="space-y-1">
<button
type="button"
onClick={() => onPick(selected ? null : photo.url)}
aria-pressed={selected}
aria-label={photo.attribution ? `${t('places.details.pickImage')} — ${photo.attribution}` : t('places.details.pickImage')}
className={`group relative block w-full overflow-hidden rounded-lg transition-shadow ${
wide ? 'aspect-[16/10]' : 'aspect-square'
} ${selected ? 'ring-2 ring-accent ring-offset-2 ring-offset-surface-secondary' : 'ring-1 ring-edge hover:ring-content-muted'}`}
>
<img
src={photo.url}
alt=""
loading="lazy"
className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-[1.04]"
/>
{selected && (
<span className="absolute top-1.5 right-1.5 rounded-full bg-accent p-1 shadow-card">
<Check className="w-3 h-3 text-accent-on" />
</span>
)}
</button>
<PhotoCredit photo={photo} />
</div>
)
}
@@ -227,16 +291,18 @@ function PhotoStrip({
* Author and licence under every thumbnail.
*
* Not decoration: Commons images are largely CC BY / CC BY-SA, and reusing one
* without naming its author and licence does not satisfy those terms. When a
* source hands us no author (Google), we say where it came from rather than
* inventing a credit.
* without naming its author does not satisfy those terms. Wrapped over two
* lines rather than truncated to one, because a cut-off name credits nobody.
* When a source hands us no author (Google), we say where it came from rather
* than inventing a credit.
*/
function PhotoCredit({ photo }: { photo: PlacePhotoCandidate }): React.ReactElement {
const sourceLabel = photo.source === 'google' ? 'Google' : photo.source === 'wikipedia' ? 'Wikipedia' : 'Wikimedia Commons'
const credit = photo.attribution || sourceLabel
const full = `${credit}${photo.license ? ` · ${photo.license}` : ''}`
return (
<p className="text-caption leading-tight text-content-muted truncate" title={`${credit}${photo.license ? ` · ${photo.license}` : ''}`}>
<p className="text-caption leading-tight text-content-faint line-clamp-2" title={full}>
{photo.sourceUrl ? (
<a href={photo.sourceUrl} target="_blank" rel="noopener noreferrer" className="hover:underline">
{credit}
@@ -260,6 +326,67 @@ function PhotoCredit({ photo }: { photo: PlacePhotoCandidate }): React.ReactElem
)
}
const FACT_ICONS: Record<PlaceFact['kind'], typeof ChefHat> = {
cuisine: ChefHat,
openingHours: Clock,
menu: ScrollText,
outdoorSeating: Sun,
takeaway: ShoppingBag,
delivery: Bike,
wheelchair: Accessibility,
vegetarian: Leaf,
vegan: Sprout,
internetAccess: Wifi,
}
/**
* The OpenStreetMap facts, as chips.
*
* For a restaurant this is the whole point of the column: nothing will ever
* write an encyclopaedia entry about it, but its cuisine, its hours and a link
* to its menu are in the map data, and they came along with a lookup that had
* already happened.
*/
function FactList({ facts, t }: { facts: PlaceFact[]; t: TranslationFn }): React.ReactElement | null {
if (facts.length === 0) return null
return (
<div className="space-y-2">
<Overline>{t('places.details.facts')}</Overline>
<div className="flex flex-wrap gap-1.5">
{facts.map((fact) => {
const Icon = FACT_ICONS[fact.kind]
const label = fact.value || t(`places.details.fact.${fact.kind}`)
const body = (
<>
<Icon className="w-3 h-3 shrink-0" />
<span className="truncate">{label}</span>
</>
)
const shared = 'inline-flex items-center gap-1.5 max-w-full rounded-full border border-edge bg-surface px-2 py-1 text-caption text-content-secondary'
return fact.url ? (
<a
key={fact.kind}
href={fact.url}
target="_blank"
rel="noopener noreferrer"
title={label}
className={`${shared} hover:border-accent hover:text-content transition-colors`}
>
{body}
</a>
) : (
<span key={fact.kind} title={label} className={shared}>
{body}
</span>
)
})}
</div>
</div>
)
}
function DescriptionBlock({
description,
hasDescription,
@@ -274,32 +401,40 @@ function DescriptionBlock({
if (!description) return null
const sourceLabel =
description.source === 'google' ? 'Google' : description.source === 'osm' ? 'OpenStreetMap' : 'Wikipedia'
description.source === 'google'
? 'Google'
: description.source === 'osm'
? 'OpenStreetMap'
: description.source === 'wikivoyage'
? 'Wikivoyage'
: 'Wikipedia'
return (
<div className="space-y-2">
<p className="text-caption text-content-muted">{t('places.details.description')}</p>
<p className="text-caption text-content whitespace-pre-line">{description.text}</p>
<p className="text-caption leading-tight text-content-muted">
{description.sourceUrl ? (
<a
href={description.sourceUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-0.5 hover:underline"
>
{sourceLabel}
<ExternalLink className="w-2.5 h-2.5" />
</a>
) : (
sourceLabel
)}
{description.license && ` · ${description.license}`}
</p>
<Overline>{t('places.details.description')}</Overline>
<div className="rounded-lg border border-edge bg-surface p-2.5 space-y-2">
<p className="text-caption leading-relaxed text-content whitespace-pre-line">{description.text}</p>
<p className="text-caption leading-tight text-content-faint">
{description.sourceUrl ? (
<a
href={description.sourceUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-0.5 hover:underline"
>
{sourceLabel}
<ExternalLink className="w-2.5 h-2.5" />
</a>
) : (
sourceLabel
)}
{description.license && ` · ${description.license}`}
</p>
</div>
<button
type="button"
onClick={() => onAdoptDescription(description.text)}
className="text-caption px-2 py-1 rounded-lg border border-edge text-content hover:bg-surface disabled:opacity-50"
className="w-full text-caption px-2 py-1.5 rounded-lg border border-edge text-content hover:bg-surface-hover disabled:opacity-50 disabled:hover:bg-transparent transition-colors"
disabled={hasDescription}
title={hasDescription ? t('places.details.adoptBlocked') : undefined}
>
@@ -1018,7 +1018,14 @@ describe('PlaceFormModal', () => {
render(<PlaceFormModal {...defaultProps} />);
const form = document.querySelector('form') as HTMLFormElement;
pasteItems(form, [{ type: 'text/plain', file: null }]);
expect(screen.getByText(/paste images from clipboard/i)).toBeInTheDocument();
// The list only renders once something is attached, so its absence is the
// assertion (this used to lean on the clipboard hint, which is gone).
expect(screen.queryByTestId('pending-files')).not.toBeInTheDocument();
// Counter-check, so the assertion above cannot pass on a missing testid:
// a real file does show up in that list.
pasteItems(form, [{ type: 'image/png', file: new File(['x'], 'shot.png', { type: 'image/png' }) }]);
expect(screen.getByTestId('pending-files')).toBeInTheDocument();
});
it('FE-PLANNER-PLACEFORM-056: paste is ignored entirely without upload permission', () => {
@@ -603,7 +603,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
t={t}
/>
)}
<form onSubmit={handleSubmit} className={twoColumn || showDetails ? 'flex-1 min-w-0 space-y-4' : 'space-y-4'} onPaste={handlePaste}>
<form onSubmit={handleSubmit} className={twoColumn || showDetails ? 'flex-1 min-w-0 space-y-3' : 'space-y-3'} onPaste={handlePaste}>
{/* Place Search */}
<div className="bg-slate-50 rounded-xl p-3 border border-slate-200">
{!hasMapsKey && (
@@ -717,7 +717,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
<textarea
value={form.notes}
onChange={e => handleChange('notes', e.target.value)}
rows={3}
rows={2}
maxLength={2000}
placeholder={t('places.formNotesPlaceholder')}
className="form-input" style={{ resize: 'vertical' }}
@@ -851,7 +851,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
</div>
<input ref={fileRef} type="file" multiple style={{ display: 'none' }} onChange={handleFileAdd} />
{pendingFiles.length > 0 && (
<div className="space-y-1">
<div className="space-y-1" data-testid="pending-files">
{pendingFiles.map((file, idx) => (
<div key={idx} className="flex items-center gap-2 px-2 py-1.5 rounded-lg bg-slate-50 text-xs">
<Paperclip size={10} className="text-slate-400 shrink-0" />
@@ -863,9 +863,6 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
))}
</div>
)}
{pendingFiles.length === 0 && (
<p className="text-xs text-slate-400">{t('files.pasteHint')}</p>
)}
</div>
)}
+15
View File
@@ -338,6 +338,21 @@ export function buildOsmDetails(tags: Record<string, string>, osmType: string, o
// the name is ambiguous ("Bahnhofstraße", "Rathaus", any chain restaurant).
wikipedia: tags.wikipedia || null,
wikidata: tags.wikidata || null,
// A Commons category is pictures OF this place, where a coordinate search
// only finds whatever was photographed near it.
wikimedia_commons: tags.wikimedia_commons || null,
// The tags that make the difference for a restaurant or a shop: no
// encyclopaedia will ever describe one, but its cuisine, its hours and a
// link to its menu are usually right here.
cuisine: tags.cuisine || null,
menu_url: tags['website:menu'] || tags.menu || null,
outdoor_seating: tags.outdoor_seating || null,
takeaway: tags.takeaway || null,
delivery: tags.delivery || null,
wheelchair: tags.wheelchair || null,
diet_vegetarian: tags['diet:vegetarian'] || null,
diet_vegan: tags['diet:vegan'] || null,
internet_access: tags.internet_access || null,
source: 'openstreetmap' as const,
};
}
+96 -44
View File
@@ -637,47 +637,57 @@ export class MapsService {
});
if (!res.ok) return [];
const data = (await res.json()) as { query?: { pages?: Record<string, WikiCommonsPage> } };
const pages = data.query?.pages;
if (!pages) return [];
const out: CommonsCandidate[] = [];
for (const page of Object.values(pages)) {
const info = page.imageinfo?.[0];
// Only use actual photos (JPEG/PNG), skip SVGs and PDFs
const mime = info?.mime || '';
if (!info?.url || !(mime.startsWith('image/jpeg') || mime.startsWith('image/png'))) continue;
const meta = info.extmetadata;
out.push({
// iiurlwidth=400 makes Commons also return a scaled thumburl. Prefer it —
// info.url is the full-resolution original (multi-megapixel camera exports).
photoUrl: info.thumburl ?? info.url,
attribution: stripWikiMarkup(meta?.Artist?.value),
license: stripWikiMarkup(meta?.LicenseShortName?.value) ?? stripWikiMarkup(meta?.UsageTerms?.value),
licenseUrl: meta?.LicenseUrl?.value?.trim() || null,
sourceUrl: info.descriptionurl || null,
});
if (out.length >= limit) break;
}
return out;
return this.toCommonsCandidates(data.query?.pages, limit);
} catch {
return [];
}
}
/** Shared shaping for both Commons queries (by coordinate and by category). */
private toCommonsCandidates(
pages: Record<string, WikiCommonsPage> | undefined,
limit: number,
): CommonsCandidate[] {
if (!pages) return [];
const out: CommonsCandidate[] = [];
for (const page of Object.values(pages)) {
const info = page.imageinfo?.[0];
// Only use actual photos (JPEG/PNG), skip SVGs and PDFs
const mime = info?.mime || '';
if (!info?.url || !(mime.startsWith('image/jpeg') || mime.startsWith('image/png'))) continue;
const meta = info.extmetadata;
out.push({
// iiurlwidth=400 makes Commons also return a scaled thumburl. Prefer it —
// info.url is the full-resolution original (multi-megapixel camera exports).
photoUrl: info.thumburl ?? info.url,
attribution: stripWikiMarkup(meta?.Artist?.value),
license: stripWikiMarkup(meta?.LicenseShortName?.value) ?? stripWikiMarkup(meta?.UsageTerms?.value),
licenseUrl: meta?.LicenseUrl?.value?.trim() || null,
sourceUrl: info.descriptionurl || null,
});
if (out.length >= limit) break;
}
return out;
}
/**
* Lead paragraph of a Wikipedia article.
* Lead paragraph of a wiki article, from Wikivoyage first and Wikipedia after.
*
* Resolved from the place's OSM `wikipedia` tag when it has one, because
* guessing the article from the place name lands on the wrong article for
* every ambiguous name. Without a tag there is no reliable article, so this
* returns null rather than a plausible-looking description of somewhere else.
* Wikivoyage is the travel sibling: same MediaWiki API, same CC BY-SA, but it
* describes a place for someone about to go there, where Wikipedia opens with
* area in square kilometres and pronunciation. Both are resolved from the OSM
* `wikipedia` tag — guessing the article from the place name lands on the
* wrong one for every ambiguous name, so no tag means no description rather
* than a confident description of somewhere else.
*/
async fetchWikipediaExtract(
async fetchWikiExtract(
wikipediaTag: string | null | undefined,
): Promise<{ text: string; sourceUrl: string } | null> {
): Promise<{ text: string; sourceUrl: string; source: 'wikivoyage' | 'wikipedia' } | null> {
const parsed = parseWikipediaTag(wikipediaTag);
if (!parsed) return null;
// Two sentences, not three: this sits next to a form, and a fourth line of
// prose pushes the pictures out of view.
const params = new URLSearchParams({
action: 'query',
format: 'json',
@@ -685,28 +695,70 @@ export class MapsService {
prop: 'extracts',
exintro: '1',
explaintext: '1',
exsentences: '3',
exsentences: '2',
redirects: '1',
});
for (const host of ['wikivoyage', 'wikipedia'] as const) {
try {
const res = await fetch(`https://${parsed.lang}.${host}.org/w/api.php?${params}`, {
headers: { 'User-Agent': UA },
signal: AbortSignal.timeout(WIKI_TIMEOUT_MS),
});
if (!res.ok) continue;
const data = (await res.json()) as {
query?: { pages?: Record<string, { title?: string; extract?: string }> };
};
const pages = data.query?.pages;
if (!pages) continue;
for (const page of Object.values(pages)) {
const text = page.extract?.trim();
// A missing article comes back as a page with no extract, not a 404.
if (!text) continue;
const title = page.title ?? parsed.title;
return {
text,
sourceUrl: `https://${parsed.lang}.${host}.org/wiki/${encodeURIComponent(title)}`,
source: host,
};
}
} catch {
/* try the next wiki */
}
}
return null;
}
/**
* Commons images from a category, which is the set of pictures OF a place.
*
* Preferred over the coordinate search wherever a place carries a
* `wikimedia_commons` tag: geosearch around a city centre returns statues and
* passers-by, while the category of a restaurant returns the restaurant.
*/
async fetchCommonsCategoryCandidates(category: string, limit = 5): Promise<CommonsCandidate[]> {
const title = category.startsWith('Category:') ? category : `Category:${category}`;
const params = new URLSearchParams({
action: 'query',
format: 'json',
generator: 'categorymembers',
gcmtitle: title,
gcmtype: 'file',
gcmlimit: String(Math.max(1, Math.min(limit * 2, 20))),
prop: 'imageinfo',
iiprop: 'url|extmetadata|mime',
iiurlwidth: '400',
});
try {
const res = await fetch(`https://${parsed.lang}.wikipedia.org/w/api.php?${params}`, {
const res = await fetch(`https://commons.wikimedia.org/w/api.php?${params}`, {
headers: { 'User-Agent': UA },
signal: AbortSignal.timeout(WIKI_TIMEOUT_MS),
});
if (!res.ok) return null;
const data = (await res.json()) as { query?: { pages?: Record<string, { title?: string; extract?: string }> } };
const pages = data.query?.pages;
if (!pages) return null;
for (const page of Object.values(pages)) {
const text = page.extract?.trim();
// A missing article comes back as a page with no extract, not as a 404.
if (!text) continue;
const title = page.title ?? parsed.title;
return { text, sourceUrl: `https://${parsed.lang}.wikipedia.org/wiki/${encodeURIComponent(title)}` };
}
return null;
if (!res.ok) return [];
const data = (await res.json()) as { query?: { pages?: Record<string, WikiCommonsPage> } };
return this.toCommonsCandidates(data.query?.pages, limit);
} catch {
return null;
return [];
}
}
@@ -51,7 +51,7 @@ export class PlaceEnrichmentController {
// A provider being unreachable must not break adding a place — the column
// is an aid, not a step. Log it and answer with an empty result.
console.error('Place enrichment error:', err);
return { photos: [], description: null };
return { photos: [], description: null, facts: [] };
}
}
@@ -3,6 +3,7 @@ import type {
MapsPlaceEnrichmentRequest,
MapsPlaceEnrichmentResult,
PlaceDescription,
PlaceFact,
PlacePhotoCandidate,
} from '@trek/shared';
import { safeFetchFollow } from '../../utils/ssrfGuard';
@@ -52,6 +53,56 @@ export function creditLine(attribution: string | null, license: string | null):
interface CachedEnrichment {
photos: PlacePhotoCandidate[];
description: PlaceDescription | null;
facts: PlaceFact[];
}
/** OSM yes/no tags; anything else (limited, only, designated) is shown verbatim. */
function yesNo(value: unknown): 'yes' | 'no' | string | null {
return typeof value === 'string' && value.trim() ? value.trim().toLowerCase() : null;
}
/**
* Turns the place's OpenStreetMap tags into the short facts the column shows.
*
* This is the part that makes the column useful for a restaurant. No wiki will
* ever describe one and Commons rarely has a picture of it, but its cuisine,
* its opening hours and a link to its menu are usually right there in the tags
* — and they arrive with a lookup that has already happened, so they are free.
*
* Only positive facts are listed. "No outdoor seating" is noise; a missing tag
* and a deliberate `no` are indistinguishable to a reader either way.
*/
export function collectFacts(details: Record<string, unknown> | null): PlaceFact[] {
if (!details || details.source !== 'openstreetmap') return [];
const facts: PlaceFact[] = [];
const push = (kind: PlaceFact['kind'], value: string | null, url: string | null = null) =>
facts.push({ kind, value, url });
const cuisine = typeof details.cuisine === 'string' ? details.cuisine : null;
// OSM writes several cuisines semicolon-separated and underscored.
if (cuisine) push('cuisine', cuisine.split(';').map((c) => c.replace(/_/g, ' ').trim()).filter(Boolean).join(', '));
const hours = Array.isArray(details.opening_hours) ? (details.opening_hours as string[]) : null;
if (hours?.length) push('openingHours', hours.join(' · '));
const menu = typeof details.menu_url === 'string' ? details.menu_url : null;
if (menu) push('menu', null, menu);
if (yesNo(details.outdoor_seating) === 'yes') push('outdoorSeating', null);
if (yesNo(details.takeaway) === 'yes') push('takeaway', null);
if (yesNo(details.delivery) === 'yes') push('delivery', null);
const wheelchair = yesNo(details.wheelchair);
if (wheelchair === 'yes' || wheelchair === 'limited') push('wheelchair', wheelchair);
if (yesNo(details.diet_vegetarian) === 'yes' || yesNo(details.diet_vegetarian) === 'only') push('vegetarian', null);
if (yesNo(details.diet_vegan) === 'yes' || yesNo(details.diet_vegan) === 'only') push('vegan', null);
const internet = yesNo(details.internet_access);
if (internet && internet !== 'no') push('internetAccess', null);
return facts;
}
/**
@@ -85,7 +136,7 @@ export class PlaceEnrichmentService {
}
async enrich(userId: number, req: MapsPlaceEnrichmentRequest): Promise<MapsPlaceEnrichmentResult> {
if (this.enrichDisabled()) return { photos: [], description: null, disabled: true };
if (this.enrichDisabled()) return { photos: [], description: null, facts: [], disabled: true };
const placeId = req.placeId?.trim() || `coords:${req.lat}:${req.lng}`;
const lang = req.lang;
@@ -93,14 +144,18 @@ export class PlaceEnrichmentService {
const cached = this.readCache(placeId, lang);
if (cached) return cached;
// Both halves are independent provider fan-outs; running them in sequence
// would make the column wait for the slower one twice over.
// One details lookup feeds all three halves: the pictures need its Commons
// category, the description needs its wiki tag, and the facts are its tags.
// It is row-cached and the dialog just made the same call, so in practice
// this is a cache read.
const details = await this.readDetails(userId, placeId, lang);
const [photos, description] = await Promise.all([
this.collectPhotos(userId, placeId, req),
this.collectDescription(userId, placeId, req),
this.collectPhotos(userId, placeId, req, details),
this.collectDescription(userId, placeId, req, details),
]);
const result: CachedEnrichment = { photos, description };
const result: CachedEnrichment = { photos, description, facts: collectFacts(details) };
this.writeCache(placeId, lang, result);
return result;
}
@@ -122,15 +177,24 @@ export class PlaceEnrichmentService {
userId: number,
placeId: string,
req: MapsPlaceEnrichmentRequest,
details: Record<string, unknown> | null,
): Promise<PlacePhotoCandidate[]> {
const apiKey = this.maps.getMapsKey(userId);
const wantsGoogle = !!apiKey && !this.maps.photosDisabled() && isGooglePlaceId(placeId);
// Ask both providers at once — one listing call each, and they know nothing
// about one another.
// A Commons category is pictures OF the place; the coordinate search is
// pictures NEAR it, which around a city centre means statues and passers-by.
// Prefer the category whenever the place carries one.
const category = typeof details?.wikimedia_commons === 'string' ? details.wikimedia_commons : null;
const [googleRefs, commons] = await Promise.all([
wantsGoogle ? this.maps.fetchGooglePhotoRefs(placeId, apiKey!, GOOGLE_CAP) : Promise.resolve([]),
this.maps.fetchCommonsCandidates(req.lat, req.lng, COMMONS_CAP),
category
? this.maps
.fetchCommonsCategoryCandidates(category, COMMONS_CAP)
.then((hits) => (hits.length ? hits : this.maps.fetchCommonsCandidates(req.lat, req.lng, COMMONS_CAP)))
: this.maps.fetchCommonsCandidates(req.lat, req.lng, COMMONS_CAP),
]);
// Google first — its pictures are of the place itself, while Commons
@@ -227,9 +291,8 @@ export class PlaceEnrichmentService {
userId: number,
placeId: string,
req: MapsPlaceEnrichmentRequest,
details: Record<string, unknown> | null,
): Promise<PlaceDescription | null> {
const details = await this.readDetails(userId, placeId, req.lang);
// OpenStreetMap first: it costs nothing, it is already fetched, and a
// description someone wrote into the map data beats a generated blurb.
const osmSummary = typeof details?.summary === 'string' ? details.summary.trim() : '';
@@ -259,9 +322,9 @@ export class PlaceEnrichmentService {
// article up by name lands on the wrong one for anything ambiguous, and a
// confident description of somewhere else is worse than none.
const wikipediaTag = typeof details?.wikipedia === 'string' ? details.wikipedia : null;
const extract = await this.maps.fetchWikipediaExtract(wikipediaTag);
const extract = await this.maps.fetchWikiExtract(wikipediaTag);
if (extract) {
return { text: extract.text, source: 'wikipedia', sourceUrl: extract.sourceUrl, license: 'CC BY-SA 4.0' };
return { text: extract.text, source: extract.source, sourceUrl: extract.sourceUrl, license: 'CC BY-SA 4.0' };
}
return null;
@@ -307,7 +370,7 @@ export class PlaceEnrichmentService {
// of the week for a place that has pictures perfectly available.
const photos = parsed.photos.filter((photo) => this.photoCache.get(photo.key));
if (photos.length !== parsed.photos.length) return null;
return { photos, description: parsed.description ?? null };
return { photos, description: parsed.description ?? null, facts: parsed.facts ?? [] };
} catch {
return null;
}
@@ -82,7 +82,8 @@ describe('Place enrichment e2e (real auth guard + real validation pipe)', () =>
// spyOn hands back the same spy on a second call, so the call counts carry
// over between tests unless they are cleared explicitly.
vi.spyOn(maps, 'fetchCommonsCandidates').mockClear().mockResolvedValue([]);
vi.spyOn(maps, 'fetchWikipediaExtract').mockClear().mockResolvedValue(null);
vi.spyOn(maps, 'fetchWikiExtract').mockClear().mockResolvedValue(null);
vi.spyOn(maps, 'fetchCommonsCategoryCandidates').mockClear().mockResolvedValue([]);
vi.spyOn(maps, 'details').mockClear().mockResolvedValue({ place: null });
});
@@ -111,7 +112,7 @@ describe('Place enrichment e2e (real auth guard + real validation pipe)', () =>
it('200 with an empty result when no provider has anything (POST stays 200)', async () => {
const res = await request(server).post('/api/maps/enrichment').set('Cookie', sessionCookie(1)).send(BODY);
expect(res.status).toBe(200);
expect(res.body).toEqual({ photos: [], description: null });
expect(res.body).toEqual({ photos: [], description: null, facts: [] });
});
it('200 with a Commons candidate carrying its licence', async () => {
@@ -146,7 +147,7 @@ describe('Place enrichment e2e (real auth guard + real validation pipe)', () =>
const res = await request(server).post('/api/maps/enrichment').set('Cookie', sessionCookie(1)).send(BODY);
expect(res.status).toBe(200);
expect(res.body).toEqual({ photos: [], description: null, disabled: true });
expect(res.body).toEqual({ photos: [], description: null, facts: [], disabled: true });
expect(maps.fetchCommonsCandidates).not.toHaveBeenCalled();
});
+104 -34
View File
@@ -2426,61 +2426,131 @@ describe('fetchCommonsCandidates (fetch stubbed)', () => {
});
});
describe('fetchWikipediaExtract (fetch stubbed)', () => {
it('MAPS-122: reads the lead paragraph from the wiki the tag names', async () => {
const fetchMock = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({
query: { pages: { '123': { title: 'Museum Ludwig', extract: ' Das Museum Ludwig ist ein Museum. ' } } },
}),
});
describe('fetchWikiExtract (fetch stubbed)', () => {
const page = (title: string, extract: string) => ({
ok: true,
json: async () => ({ query: { pages: { '1': { title, extract } } } }),
});
const noArticle = { ok: true, json: async () => ({ query: { pages: { '-1': { title: 'X' } } } }) };
it('MAPS-122: asks Wikivoyage first, because it writes for travellers', async () => {
const fetchMock = vi.fn().mockResolvedValue(page('Museum Ludwig', ' Ein Museum in Köln. '));
vi.stubGlobal('fetch', fetchMock);
const out = await svc.fetchWikipediaExtract('de:Museum Ludwig');
const out = await svc.fetchWikiExtract('de:Museum Ludwig');
expect(out).toEqual({
text: 'Das Museum Ludwig ist ein Museum.',
sourceUrl: 'https://de.wikipedia.org/wiki/Museum%20Ludwig',
text: 'Ein Museum in Köln.',
sourceUrl: 'https://de.wikivoyage.org/wiki/Museum%20Ludwig',
source: 'wikivoyage',
});
// The host follows the tag, not a hard-coded 'en'.
expect(String(fetchMock.mock.calls[0][0])).toContain('https://de.wikipedia.org/w/api.php');
// Host follows the tag, and Wikipedia is never asked once Wikivoyage answered.
expect(String(fetchMock.mock.calls[0][0])).toContain('https://de.wikivoyage.org/w/api.php');
expect(fetchMock).toHaveBeenCalledTimes(1);
});
it('MAPS-122b: falls through to Wikipedia when Wikivoyage has no article', async () => {
const fetchMock = vi
.fn()
.mockResolvedValueOnce(noArticle)
.mockResolvedValueOnce(page('Museum Ludwig', 'Das Museum Ludwig ist ein Museum.'));
vi.stubGlobal('fetch', fetchMock);
const out = await svc.fetchWikiExtract('de:Museum Ludwig');
expect(out).toMatchObject({ source: 'wikipedia' });
expect(String(fetchMock.mock.calls[1][0])).toContain('https://de.wikipedia.org/w/api.php');
});
it('MAPS-122c: asks for two sentences, not a whole lead section', async () => {
const fetchMock = vi.fn().mockResolvedValue(page('X', 'Kurz.'));
vi.stubGlobal('fetch', fetchMock);
await svc.fetchWikiExtract('de:X');
expect(String(fetchMock.mock.calls[0][0])).toContain('exsentences=2');
});
it('MAPS-123: prefers the resolved title so a redirect links to where it landed', async () => {
vi.stubGlobal(
'fetch',
vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ query: { pages: { '9': { title: 'Eiffel Tower', extract: 'A tower.' } } } }),
}),
);
const out = await svc.fetchWikipediaExtract('en:Eiffelturm');
expect(out!.sourceUrl).toBe('https://en.wikipedia.org/wiki/Eiffel%20Tower');
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(page('Eiffel Tower', 'A tower.')));
const out = await svc.fetchWikiExtract('en:Eiffelturm');
expect(out!.sourceUrl).toBe('https://en.wikivoyage.org/wiki/Eiffel%20Tower');
});
it('MAPS-124: returns null without calling out when the tag has no language', async () => {
const fetchMock = vi.fn();
vi.stubGlobal('fetch', fetchMock);
expect(await svc.fetchWikipediaExtract('Museum Ludwig')).toBeNull();
expect(await svc.fetchWikipediaExtract(null)).toBeNull();
expect(await svc.fetchWikiExtract('Museum Ludwig')).toBeNull();
expect(await svc.fetchWikiExtract(null)).toBeNull();
expect(fetchMock).not.toHaveBeenCalled();
});
it('MAPS-125: treats a missing article, a bad response and a throw as no description', async () => {
// A missing article comes back as a page with no extract, not as a 404.
vi.stubGlobal(
'fetch',
vi.fn().mockResolvedValue({ ok: true, json: async () => ({ query: { pages: { '-1': { title: 'X' } } } }) }),
);
expect(await svc.fetchWikipediaExtract('de:X')).toBeNull();
it('MAPS-125: treats a miss on both wikis as no description', async () => {
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(noArticle));
expect(await svc.fetchWikiExtract('de:X')).toBeNull();
vi.stubGlobal('fetch', vi.fn().mockResolvedValue({ ok: true, json: async () => ({}) }));
expect(await svc.fetchWikipediaExtract('de:X')).toBeNull();
expect(await svc.fetchWikiExtract('de:X')).toBeNull();
vi.stubGlobal('fetch', vi.fn().mockResolvedValue({ ok: false, json: async () => ({}) }));
expect(await svc.fetchWikipediaExtract('de:X')).toBeNull();
expect(await svc.fetchWikiExtract('de:X')).toBeNull();
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('network')));
expect(await svc.fetchWikipediaExtract('de:X')).toBeNull();
expect(await svc.fetchWikiExtract('de:X')).toBeNull();
});
it('MAPS-125b: still tries Wikipedia after Wikivoyage threw', async () => {
const fetchMock = vi
.fn()
.mockRejectedValueOnce(new Error('network'))
.mockResolvedValueOnce(page('X', 'Ein Ort.'));
vi.stubGlobal('fetch', fetchMock);
expect(await svc.fetchWikiExtract('de:X')).toMatchObject({ source: 'wikipedia' });
});
});
describe('fetchCommonsCategoryCandidates (fetch stubbed)', () => {
it('MAPS-125c: reads a category, which is pictures OF a place rather than near it', async () => {
const fetchMock = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({
query: {
pages: {
'1': {
imageinfo: [
{
url: 'https://commons.org/o.jpg',
thumburl: 'https://commons.org/t.jpg',
mime: 'image/jpeg',
descriptionurl: 'https://commons.wikimedia.org/wiki/File:T.jpg',
extmetadata: { Artist: { value: 'Alice' }, LicenseShortName: { value: 'CC BY 4.0' } },
},
],
},
},
},
}),
});
vi.stubGlobal('fetch', fetchMock);
const out = await svc.fetchCommonsCategoryCandidates('Category:Museum Ludwig', 3);
expect(out).toHaveLength(1);
expect(out[0]).toMatchObject({ photoUrl: 'https://commons.org/t.jpg', attribution: 'Alice', license: 'CC BY 4.0' });
expect(String(fetchMock.mock.calls[0][0])).toContain('gcmtitle=Category%3AMuseum+Ludwig');
});
it('MAPS-125d: adds the Category prefix when the tag omits it', async () => {
const fetchMock = vi.fn().mockResolvedValue({ ok: true, json: async () => ({ query: { pages: {} } }) });
vi.stubGlobal('fetch', fetchMock);
await svc.fetchCommonsCategoryCandidates('Museum Ludwig');
expect(String(fetchMock.mock.calls[0][0])).toContain('gcmtitle=Category%3AMuseum+Ludwig');
});
it('MAPS-125e: yields nothing on an error response or a throw', async () => {
vi.stubGlobal('fetch', vi.fn().mockResolvedValue({ ok: false, json: async () => ({}) }));
expect(await svc.fetchCommonsCategoryCandidates('Category:X')).toEqual([]);
vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('network')));
expect(await svc.fetchCommonsCategoryCandidates('Category:X')).toEqual([]);
});
});
@@ -14,7 +14,7 @@ import type { User } from '../../../src/types';
const USER = { id: 7 } as User;
const REQ = {} as Request;
const BODY = { lat: 50.9, lng: 6.96, name: 'Museum Ludwig', placeId: 'ChIJmuseum' };
const RESULT = { photos: [], description: null };
const RESULT = { photos: [], description: null, facts: [] };
function make(over: Partial<PlaceEnrichmentService> = {}, rl = new RateLimitService()) {
const service = { enrich: vi.fn(async () => RESULT), ...over } as unknown as PlaceEnrichmentService;
@@ -62,13 +62,13 @@ describe('PlaceEnrichmentController', () => {
const { controller } = make({ enrich: vi.fn(async () => { throw new Error('commons down'); }) });
const err = vi.spyOn(console, 'error').mockImplementation(() => {});
await expect(controller.enrich(USER, REQ, BODY)).resolves.toEqual({ photos: [], description: null });
await expect(controller.enrich(USER, REQ, BODY)).resolves.toEqual({ photos: [], description: null, facts: [] });
expect(err).toHaveBeenCalled();
err.mockRestore();
});
it('ENRICH-045: passes the disabled envelope through untouched', async () => {
const disabled = { photos: [], description: null, disabled: true };
const disabled = { photos: [], description: null, facts: [], disabled: true };
const { controller } = make({ enrich: vi.fn(async () => disabled) });
await expect(controller.enrich(USER, REQ, BODY)).resolves.toEqual(disabled);
@@ -36,7 +36,7 @@ vi.mock('../../../src/config', () => ({ JWT_SECRET: 'test-secret', ENCRYPTION_KE
import { db } from '../../../src/db/database';
import { DatabaseService } from '../../../src/nest/database/database.service';
import { PlaceEnrichmentService, creditLine } from '../../../src/nest/place-enrichment/place-enrichment.service';
import { PlaceEnrichmentService, creditLine, collectFacts } from '../../../src/nest/place-enrichment/place-enrichment.service';
import type { MapsService } from '../../../src/nest/maps/maps.service';
import type { PlacePhotoCacheService } from '../../../src/nest/place-photos/place-photo-cache.service';
@@ -53,7 +53,8 @@ function mapsStub(over: Partial<Record<keyof MapsService, unknown>> = {}) {
fetchGooglePhotoBytes: vi.fn(async () => null as Buffer | null),
fetchCommonsCandidates: vi.fn(async () => [] as any[]),
fetchEditorialSummary: vi.fn(async () => null as string | null),
fetchWikipediaExtract: vi.fn(async () => null as { text: string; sourceUrl: string } | null),
fetchWikiExtract: vi.fn(async () => null as { text: string; sourceUrl: string; source: 'wikivoyage' | 'wikipedia' } | null),
fetchCommonsCategoryCandidates: vi.fn(async () => [] as any[]),
details: vi.fn(async () => ({ place: null })),
...over,
} as unknown as MapsService;
@@ -114,7 +115,7 @@ describe('enrichDisabled', () => {
const out = await make(maps, cacheStub()).enrich(1, REQ);
expect(out).toEqual({ photos: [], description: null, disabled: true });
expect(out).toEqual({ photos: [], description: null, facts: [], disabled: true });
expect(maps.fetchCommonsCandidates).not.toHaveBeenCalled();
expect(maps.details).not.toHaveBeenCalled();
});
@@ -353,7 +354,17 @@ describe('collectDescription', () => {
license: 'ODbL 1.0',
});
expect(maps.fetchEditorialSummary).not.toHaveBeenCalled();
expect(maps.fetchWikipediaExtract).not.toHaveBeenCalled();
expect(maps.fetchWikiExtract).not.toHaveBeenCalled();
});
it('ENRICH-014b: leaves the OSM link empty when the details carry no osm_url', async () => {
const maps = mapsStub({
details: vi.fn(async () => ({ place: { summary: 'Ein Museum.', source: 'openstreetmap' } })),
});
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(out.description).toEqual({ text: 'Ein Museum.', source: 'osm', sourceUrl: null, license: 'ODbL 1.0' });
});
it('ENRICH-015: ignores a summary that came from Google on the OSM branch', async () => {
@@ -404,7 +415,7 @@ describe('collectDescription', () => {
await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(maps.fetchWikipediaExtract).toHaveBeenCalledWith(null);
expect(maps.fetchWikiExtract).toHaveBeenCalledWith(null);
});
it('ENRICH-017: honours the details kill switch and the missing key', async () => {
@@ -420,15 +431,16 @@ describe('collectDescription', () => {
it('ENRICH-018: falls back to Wikipedia, resolved from the wiki tag', async () => {
const maps = mapsStub({
details: vi.fn(async () => ({ place: { wikipedia: 'de:Museum Ludwig' } })),
fetchWikipediaExtract: vi.fn(async () => ({
fetchWikiExtract: vi.fn(async () => ({
text: 'Das Museum Ludwig ist ein Museum.',
sourceUrl: 'https://de.wikipedia.org/wiki/Museum%20Ludwig',
source: 'wikipedia' as const,
})),
});
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(maps.fetchWikipediaExtract).toHaveBeenCalledWith('de:Museum Ludwig');
expect(maps.fetchWikiExtract).toHaveBeenCalledWith('de:Museum Ludwig');
expect(out.description).toEqual({
text: 'Das Museum Ludwig ist ein Museum.',
source: 'wikipedia',
@@ -442,7 +454,7 @@ describe('collectDescription', () => {
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(maps.fetchWikipediaExtract).toHaveBeenCalledWith(null);
expect(maps.fetchWikiExtract).toHaveBeenCalledWith(null);
expect(out.description).toBeNull();
});
@@ -600,3 +612,105 @@ describe('creditLine', () => {
expect(svc.credit('unknown')).toEqual({ credit: null });
});
});
// ── OpenStreetMap facts (ENRICH-050..) ───────────────────────────────────────
describe('collectFacts', () => {
const osm = (tags: Record<string, unknown>) => ({ source: 'openstreetmap', ...tags });
it('ENRICH-050: turns the tags a restaurant actually carries into chips', () => {
const facts = collectFacts(
osm({
cuisine: 'regional;german',
opening_hours: ['Mo-Sa 17:30+'],
menu_url: 'https://example.org/menu',
outdoor_seating: 'yes',
wheelchair: 'limited',
}),
);
expect(facts).toEqual([
// Semicolons and underscores are OSM syntax, not something to show a reader.
{ kind: 'cuisine', value: 'regional, german', url: null },
{ kind: 'openingHours', value: 'Mo-Sa 17:30+', url: null },
{ kind: 'menu', value: null, url: 'https://example.org/menu' },
{ kind: 'outdoorSeating', value: null, url: null },
{ kind: 'wheelchair', value: 'limited', url: null },
]);
});
it('ENRICH-051: lists only positive facts', () => {
// "No outdoor seating" is noise, and a missing tag reads the same to a user.
const facts = collectFacts(
osm({ outdoor_seating: 'no', takeaway: 'no', wheelchair: 'no', internet_access: 'no', diet_vegan: 'no' }),
);
expect(facts).toEqual([]);
});
it('ENRICH-052: accepts the "only" spelling for diets', () => {
const kinds = collectFacts(osm({ diet_vegetarian: 'only', diet_vegan: 'yes' })).map((f) => f.kind);
expect(kinds).toEqual(['vegetarian', 'vegan']);
});
it('ENRICH-052b: covers the remaining yes-tags and a non-string osm_url', () => {
const facts = collectFacts(osm({ takeaway: 'yes', delivery: 'yes', internet_access: 'wlan', wheelchair: 'yes' }));
expect(facts.map((f) => f.kind)).toEqual(['takeaway', 'delivery', 'wheelchair', 'internetAccess']);
// Any internet_access value other than "no" counts as available.
expect(facts.find((f) => f.kind === 'internetAccess')).toEqual({ kind: 'internetAccess', value: null, url: null });
});
it('ENRICH-053: stays empty for a Google place and for no details at all', () => {
expect(collectFacts(null)).toEqual([]);
expect(collectFacts({ source: 'google', cuisine: 'italian' })).toEqual([]);
});
it('ENRICH-054: joins multi-day opening hours into one readable line', () => {
const facts = collectFacts(osm({ opening_hours: ['Mo-Fr 09:00-18:00', 'Sa 10:00-14:00'] }));
expect(facts[0]).toEqual({ kind: 'openingHours', value: 'Mo-Fr 09:00-18:00 · Sa 10:00-14:00', url: null });
});
});
describe('picture source selection', () => {
it('ENRICH-055: prefers the Commons category over the coordinate search', async () => {
// geosearch around a city centre returns statues and passers-by; the
// category of a place returns the place.
const maps = mapsStub({
details: vi.fn(async () => ({ place: { source: 'openstreetmap', wikimedia_commons: 'Category:Museum Ludwig' } })),
fetchCommonsCategoryCandidates: vi.fn(async () => [commonsCandidate()]),
});
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(maps.fetchCommonsCategoryCandidates).toHaveBeenCalledWith('Category:Museum Ludwig', 5);
expect(maps.fetchCommonsCandidates).not.toHaveBeenCalled();
expect(out.photos).toHaveLength(1);
});
it('ENRICH-056: falls back to the coordinate search when the category is empty', async () => {
const maps = mapsStub({
details: vi.fn(async () => ({ place: { source: 'openstreetmap', wikimedia_commons: 'Category:Empty' } })),
fetchCommonsCategoryCandidates: vi.fn(async () => []),
fetchCommonsCandidates: vi.fn(async () => [commonsCandidate()]),
});
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(maps.fetchCommonsCandidates).toHaveBeenCalled();
expect(out.photos).toHaveLength(1);
});
it('ENRICH-057: reports Wikivoyage as the description source when it answered', async () => {
const maps = mapsStub({
details: vi.fn(async () => ({ place: { source: 'openstreetmap', wikipedia: 'de:Berlin' } })),
fetchWikiExtract: vi.fn(async () => ({
text: 'Berlin ist das politische Zentrum Deutschlands.',
sourceUrl: 'https://de.wikivoyage.org/wiki/Berlin',
source: 'wikivoyage' as const,
})),
});
const out = await make(maps, cacheStub()).enrich(1, OSM_REQ);
expect(out.description).toMatchObject({ source: 'wikivoyage', license: 'CC BY-SA 4.0' });
});
});
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'أنشئ قائمة أولًا لحفظ الأماكن.',
'collections.removedFromAll': 'تمت الإزالة من المجموعة',
'collections.picker.title': 'الأماكن المحفوظة',
'collections.picker.showMore': 'عرض {count} إضافية',
'collections.picker.search': 'ابحث في أماكنك المحفوظة',
'collections.picker.empty': 'لا توجد أماكن محفوظة لإضافتها',
'collections.picker.hint': 'اختر مكانًا من مجموعاتك',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'جارٍ تحميل تفاصيل المكان…',
'places.osmHint':
'يتم البحث عبر OpenStreetMap (بدون صور أو ساعات عمل أو تقييمات). أضف مفتاح Google API في الإعدادات للحصول على جميع التفاصيل.',
'places.osmActive':
'البحث عبر OpenStreetMap (بدون صور أو تقييمات أو ساعات عمل). أضف مفتاح Google API في الإعدادات لبيانات موسعة.',
'places.osmActive': 'يتم استخدام OpenStreetMap. مفتاح Google API يضيف التقييمات وساعات العمل.',
'places.details.title': 'تفاصيل المكان',
'places.details.empty': 'اختر نتيجة بحث لعرض الصور والوصف.',
'places.details.loading': 'جارٍ تحميل التفاصيل...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'الوصف',
'places.details.adopt': 'استخدام هذا النص',
'places.details.adoptBlocked': 'أفرغ حقل الوصف أولًا',
'places.details.facts': 'معلومات مفيدة',
'places.details.nothing': 'لم يتم العثور على شيء لهذا المكان.',
'places.details.fact.cuisine': 'المطبخ',
'places.details.fact.openingHours': 'ساعات العمل',
'places.details.fact.menu': 'قائمة الطعام',
'places.details.fact.outdoorSeating': 'جلسات خارجية',
'places.details.fact.takeaway': 'طلبات خارجية',
'places.details.fact.delivery': 'توصيل',
'places.details.fact.wheelchair': 'مدخل بدون درج',
'places.details.fact.vegetarian': 'نباتي',
'places.details.fact.vegan': 'نباتي صرف',
'places.details.fact.internetAccess': 'واي فاي',
'places.categoryCreateError': 'فشل إنشاء الفئة',
'places.nameRequired': 'يرجى إدخال اسم',
'places.saveError': 'فشل الحفظ',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Crie uma lista primeiro para salvar lugares.',
'collections.removedFromAll': 'Removido da coleção',
'collections.picker.title': 'Lugares salvos',
'collections.picker.showMore': 'Mostrar mais {count}',
'collections.picker.search': 'Buscar nos seus lugares salvos',
'collections.picker.empty': 'Nenhum lugar salvo para adicionar',
'collections.picker.hint': 'Escolha um lugar das suas coleções',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Carregando detalhes do lugar…',
'places.osmHint':
'Busca via OpenStreetMap (sem fotos, horários ou avaliações). Adicione uma chave Google nas configurações para detalhes completos.',
'places.osmActive':
'Busca via OpenStreetMap (sem fotos, avaliações ou horário de funcionamento). Adicione uma chave Google em Configurações para mais dados.',
'places.osmActive': 'Usando o OpenStreetMap. Uma chave de API do Google adiciona avaliações e horários.',
'places.details.title': 'Detalhes do lugar',
'places.details.empty': 'Escolha um resultado para ver imagens e uma descrição.',
'places.details.loading': 'Carregando detalhes...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Descrição',
'places.details.adopt': 'Usar este texto',
'places.details.adoptBlocked': 'Esvazie primeiro o campo de descrição',
'places.details.facts': 'Bom saber',
'places.details.nothing': 'Nada encontrado para este lugar.',
'places.details.fact.cuisine': 'Cozinha',
'places.details.fact.openingHours': 'Horário',
'places.details.fact.menu': 'Cardápio',
'places.details.fact.outdoorSeating': 'Área externa',
'places.details.fact.takeaway': 'Para viagem',
'places.details.fact.delivery': 'Entrega',
'places.details.fact.wheelchair': 'Acesso sem degraus',
'places.details.fact.vegetarian': 'Vegetariano',
'places.details.fact.vegan': 'Vegano',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Falha ao criar categoria',
'places.nameRequired': 'Digite um nome',
'places.saveError': 'Falha ao salvar',
+1
View File
@@ -103,6 +103,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Crea una llista primer per poder desar llocs.',
'collections.removedFromAll': 'Eliminat de la col·lecció',
'collections.picker.title': 'Llocs desats',
'collections.picker.showMore': "Mostra'n {count} més",
'collections.picker.search': 'Cerca entre els teus llocs desats',
'collections.picker.empty': 'No hi ha llocs desats per afegir',
'collections.picker.hint': 'Tria un lloc de les teves col·leccions',
+13 -2
View File
@@ -82,8 +82,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Carregant els detalls del lloc…',
'places.osmHint':
"S'està utilitzant la cerca amb OpenStreetMap (sense fotos, horaris ni valoracions). Afegeix una clau API de Google a Configuració per obtenir tots els detalls.",
'places.osmActive':
'Cerca mitjançant OpenStreetMap (sense fotos, valoracions ni horaris). Afegeix una clau API de Google a Configuració per obtenir dades ampliades.',
'places.osmActive': 'S\'utilitza OpenStreetMap. Una clau API de Google afegeix valoracions i horaris.',
'places.details.title': 'Detalls del lloc',
'places.details.empty': 'Tria un resultat per veure imatges i una descripció.',
'places.details.loading': "S'estan carregant els detalls...",
@@ -94,6 +93,18 @@ const places: TranslationStrings = {
'places.details.description': 'Descripció',
'places.details.adopt': 'Utilitza aquest text',
'places.details.adoptBlocked': 'Buida primer el camp de descripció',
'places.details.facts': 'Bo saber',
'places.details.nothing': "No s'ha trobat res per a aquest lloc.",
'places.details.fact.cuisine': 'Cuina',
'places.details.fact.openingHours': 'Horari',
'places.details.fact.menu': 'Carta',
'places.details.fact.outdoorSeating': 'Terrassa',
'places.details.fact.takeaway': 'Per emportar',
'places.details.fact.delivery': 'Lliurament',
'places.details.fact.wheelchair': 'Accés sense esglaons',
'places.details.fact.vegetarian': 'Vegetarià',
'places.details.fact.vegan': 'Vegà',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': "No s'ha pogut crear la categoria",
'places.nameRequired': 'Introdueix un nom',
'places.saveError': "No s'ha pogut desar",
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Nejprve vytvořte seznam, abyste mohli ukládat místa.',
'collections.removedFromAll': 'Odebráno ze sbírky',
'collections.picker.title': 'Uložená místa',
'collections.picker.showMore': 'Zobrazit dalších {count}',
'collections.picker.search': 'Prohledat uložená místa',
'collections.picker.empty': 'Žádná uložená místa k přidání',
'collections.picker.hint': 'Vyberte místo ze svých sbírek',
+13 -1
View File
@@ -84,7 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Načítání podrobností místa…',
'places.osmHint':
'Používáte hledání přes OpenStreetMap (bez fotek a hodnocení). Pro plné detaily přidejte Google API klíč v nastavení.',
'places.osmActive': 'Hledání přes OpenStreetMap.',
'places.osmActive': 'Používá se OpenStreetMap. Klíč Google API přidá hodnocení a otevírací dobu.',
'places.details.title': 'Podrobnosti místa',
'places.details.empty': 'Vyber výsledek hledání a zobrazí se obrázky a popis.',
'places.details.loading': 'Načítání podrobností...',
@@ -95,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Popis',
'places.details.adopt': 'Použít tento text',
'places.details.adoptBlocked': 'Nejdřív vyprázdni pole popisu',
'places.details.facts': 'Dobré vědět',
'places.details.nothing': 'Pro toto místo se nic nenašlo.',
'places.details.fact.cuisine': 'Kuchyně',
'places.details.fact.openingHours': 'Otevírací doba',
'places.details.fact.menu': 'Menu',
'places.details.fact.outdoorSeating': 'Venkovní posezení',
'places.details.fact.takeaway': 'S sebou',
'places.details.fact.delivery': 'Rozvoz',
'places.details.fact.wheelchair': 'Bezbariérový přístup',
'places.details.fact.vegetarian': 'Vegetariánské',
'places.details.fact.vegan': 'Veganské',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Nepodařilo se vytvořit kategorii',
'places.nameRequired': 'Prosím zadejte název',
'places.saveError': 'Uložení se nezdařilo',
+1
View File
@@ -112,6 +112,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Erstelle zuerst eine Liste, um Orte zu speichern.',
'collections.removedFromAll': 'Aus Sammlung entfernt',
'collections.picker.title': 'Gespeicherte Orte',
'collections.picker.showMore': '{count} weitere anzeigen',
'collections.picker.search': 'Gespeicherte Orte durchsuchen',
'collections.picker.empty': 'Keine gespeicherten Orte zum Hinzufügen',
'collections.picker.hint': 'Wähle einen Ort aus deinen Sammlungen',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Ortsdetails werden geladen…',
'places.osmHint':
'OpenStreetMap-Suche aktiv (ohne Bilder, Öffnungszeiten, Bewertungen). Für erweiterte Daten Google API Key in den Einstellungen hinterlegen.',
'places.osmActive':
'Suche via OpenStreetMap (ohne Bilder, Bewertungen & Öffnungszeiten). Google API Key in den Einstellungen hinterlegen für erweiterte Daten.',
'places.osmActive': 'OpenStreetMap wird genutzt. Ein Google-API-Key ergänzt Bewertungen und Öffnungszeiten.',
'places.details.title': 'Ortsdetails',
'places.details.empty': 'Wähle ein Suchergebnis, um Bilder und eine Beschreibung zu sehen.',
'places.details.loading': 'Details werden geladen...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Beschreibung',
'places.details.adopt': 'Text übernehmen',
'places.details.adoptBlocked': 'Erst das Beschreibungsfeld leeren',
'places.details.facts': 'Gut zu wissen',
'places.details.nothing': 'Zu diesem Ort wurde nichts gefunden.',
'places.details.fact.cuisine': 'Küche',
'places.details.fact.openingHours': 'Öffnungszeiten',
'places.details.fact.menu': 'Speisekarte',
'places.details.fact.outdoorSeating': 'Außenbereich',
'places.details.fact.takeaway': 'Zum Mitnehmen',
'places.details.fact.delivery': 'Lieferung',
'places.details.fact.wheelchair': 'Barrierefrei',
'places.details.fact.vegetarian': 'Vegetarisch',
'places.details.fact.vegan': 'Vegan',
'places.details.fact.internetAccess': 'WLAN',
'places.categoryCreateError': 'Fehler beim Erstellen der Kategorie',
'places.nameRequired': 'Bitte einen Namen eingeben',
'places.saveError': 'Fehler beim Speichern',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Create a list first to save places.',
'collections.removedFromAll': 'Removed from collection',
'collections.picker.title': 'Saved places',
'collections.picker.showMore': 'Show {count} more',
'collections.picker.search': 'Search your saved places',
'collections.picker.empty': 'No saved places to add',
'collections.picker.hint': 'Pick a place from your collections',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Loading place details…',
'places.osmHint':
'Using OpenStreetMap search (no photos, opening hours, or ratings). Add a Google API key in settings for full details.',
'places.osmActive':
'Search via OpenStreetMap (no photos, ratings or opening hours). Add a Google API key in Settings for enhanced data.',
'places.osmActive': 'Using OpenStreetMap. A Google API key adds ratings and opening hours.',
'places.details.title': 'Place details',
'places.details.empty': 'Pick a search result to see pictures and a description.',
'places.details.loading': 'Loading details...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Description',
'places.details.adopt': 'Use this text',
'places.details.adoptBlocked': 'Clear the description field first',
'places.details.facts': 'Good to know',
'places.details.nothing': 'Nothing found for this place.',
'places.details.fact.cuisine': 'Cuisine',
'places.details.fact.openingHours': 'Opening hours',
'places.details.fact.menu': 'Menu',
'places.details.fact.outdoorSeating': 'Outdoor seating',
'places.details.fact.takeaway': 'Takeaway',
'places.details.fact.delivery': 'Delivery',
'places.details.fact.wheelchair': 'Step-free access',
'places.details.fact.vegetarian': 'Vegetarian',
'places.details.fact.vegan': 'Vegan',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Failed to create category',
'places.nameRequired': 'Please enter a name',
'places.saveError': 'Failed to save',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Crea primero una lista para guardar lugares.',
'collections.removedFromAll': 'Quitado de la colección',
'collections.picker.title': 'Lugares guardados',
'collections.picker.showMore': 'Mostrar {count} más',
'collections.picker.search': 'Busca en tus lugares guardados',
'collections.picker.empty': 'No hay lugares guardados para añadir',
'collections.picker.hint': 'Elige un lugar de tus colecciones',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Cargando detalles del lugar…',
'places.osmHint':
'Usando búsqueda con OpenStreetMap (sin fotos, horarios ni valoraciones). Añade una clave API de Google en Ajustes para obtener todos los detalles.',
'places.osmActive':
'Búsqueda mediante OpenStreetMap (sin fotos, valoraciones ni horarios). Añade una clave API de Google en Ajustes para datos ampliados.',
'places.osmActive': 'Se usa OpenStreetMap. Una clave de API de Google añade valoraciones y horarios.',
'places.details.title': 'Detalles del lugar',
'places.details.empty': 'Elige un resultado para ver imágenes y una descripción.',
'places.details.loading': 'Cargando detalles...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Descripción',
'places.details.adopt': 'Usar este texto',
'places.details.adoptBlocked': 'Vacía primero el campo de descripción',
'places.details.facts': 'Bueno saber',
'places.details.nothing': 'No se encontró nada para este lugar.',
'places.details.fact.cuisine': 'Cocina',
'places.details.fact.openingHours': 'Horario',
'places.details.fact.menu': 'Carta',
'places.details.fact.outdoorSeating': 'Terraza',
'places.details.fact.takeaway': 'Para llevar',
'places.details.fact.delivery': 'A domicilio',
'places.details.fact.wheelchair': 'Acceso sin escalones',
'places.details.fact.vegetarian': 'Vegetariano',
'places.details.fact.vegan': 'Vegano',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'No se pudo crear la categoría',
'places.nameRequired': 'Introduce un nombre',
'places.saveError': 'No se pudo guardar',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Créez d’abord une liste pour enregistrer des lieux.',
'collections.removedFromAll': 'Retiré de la collection',
'collections.picker.title': 'Lieux enregistrés',
'collections.picker.showMore': 'Afficher {count} de plus',
'collections.picker.search': 'Rechercher dans vos lieux enregistrés',
'collections.picker.empty': 'Aucun lieu enregistré à ajouter',
'collections.picker.hint': 'Choisissez un lieu dans vos collections',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Chargement des détails du lieu…',
'places.osmHint':
'Recherche via OpenStreetMap (pas de photos, horaires ni notes). Ajoutez une clé API Google dans les paramètres pour plus de détails.',
'places.osmActive':
'Recherche via OpenStreetMap (pas de photos, notes ni horaires). Ajoutez une clé API Google dans les paramètres pour des données enrichies.',
'places.osmActive': 'OpenStreetMap est utilisé. Une clé API Google ajoute notes et horaires.',
'places.details.title': 'Détails du lieu',
'places.details.empty': 'Choisis un résultat pour voir des images et une description.',
'places.details.loading': 'Chargement des détails...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Description',
'places.details.adopt': 'Utiliser ce texte',
'places.details.adoptBlocked': "Videz d'abord le champ description",
'places.details.facts': 'Bon à savoir',
'places.details.nothing': 'Rien trouvé pour ce lieu.',
'places.details.fact.cuisine': 'Cuisine',
'places.details.fact.openingHours': 'Horaires',
'places.details.fact.menu': 'Carte',
'places.details.fact.outdoorSeating': 'Terrasse',
'places.details.fact.takeaway': 'À emporter',
'places.details.fact.delivery': 'Livraison',
'places.details.fact.wheelchair': 'Accès de plain-pied',
'places.details.fact.vegetarian': 'Végétarien',
'places.details.fact.vegan': 'Végan',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Impossible de créer la catégorie',
'places.nameRequired': 'Veuillez saisir un nom',
'places.saveError': "Échec de l'enregistrement",
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Δημιούργησε πρώτα μια λίστα για να αποθηκεύεις μέρη.',
'collections.removedFromAll': 'Αφαιρέθηκε από τη συλλογή',
'collections.picker.title': 'Αποθηκευμένα μέρη',
'collections.picker.showMore': 'Εμφάνιση {count} ακόμη',
'collections.picker.search': 'Αναζήτηση στα αποθηκευμένα μέρη σου',
'collections.picker.empty': 'Δεν υπάρχουν αποθηκευμένα μέρη για προσθήκη',
'collections.picker.hint': 'Διάλεξε ένα μέρος από τις συλλογές σου',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Φόρτωση λεπτομερειών μέρους…',
'places.osmHint':
'Χρήση αναζήτησης OpenStreetMap (χωρίς φωτογραφίες, ώρες λειτουργίας ή αξιολογήσεις). Προσθέστε ένα κλειδί Google API στις ρυθμίσεις για πλήρεις λεπτομέρειες.',
'places.osmActive':
'Αναζήτηση μέσω OpenStreetMap (χωρίς φωτογραφίες, αξιολογήσεις ή ώρες λειτουργίας). Προσθέστε ένα κλειδί Google API στις Ρυθμίσεις για εμπλουτισμένα δεδομένα.',
'places.osmActive': 'Χρησιμοποιείται το OpenStreetMap. Ένα κλειδί Google API προσθέτει αξιολογήσεις και ωράρια.',
'places.details.title': 'Λεπτομέρειες τοποθεσίας',
'places.details.empty': 'Διάλεξε ένα αποτέλεσμα για να δεις εικόνες και περιγραφή.',
'places.details.loading': 'Φόρτωση λεπτομερειών...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Περιγραφή',
'places.details.adopt': 'Χρήση αυτού του κειμένου',
'places.details.adoptBlocked': 'Άδειασε πρώτα το πεδίο περιγραφής',
'places.details.facts': 'Καλό να ξέρεις',
'places.details.nothing': 'Δεν βρέθηκε τίποτα για αυτήν την τοποθεσία.',
'places.details.fact.cuisine': 'Κουζίνα',
'places.details.fact.openingHours': 'Ωράριο',
'places.details.fact.menu': 'Μενού',
'places.details.fact.outdoorSeating': 'Εξωτερικός χώρος',
'places.details.fact.takeaway': 'Για το σπίτι',
'places.details.fact.delivery': 'Διανομή',
'places.details.fact.wheelchair': 'Πρόσβαση χωρίς σκαλιά',
'places.details.fact.vegetarian': 'Χορτοφαγικό',
'places.details.fact.vegan': 'Vegan',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Αποτυχία δημιουργίας κατηγορίας',
'places.nameRequired': 'Παρακαλώ εισαγάγετε ένα όνομα',
'places.saveError': 'Αποτυχία αποθήκευσης',
+1
View File
@@ -112,6 +112,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Előbb hozz létre egy listát a helyek mentéséhez.',
'collections.removedFromAll': 'Eltávolítva a gyűjteményből',
'collections.picker.title': 'Mentett helyek',
'collections.picker.showMore': 'További {count} megjelenítése',
'collections.picker.search': 'Mentett helyek keresése',
'collections.picker.empty': 'Nincs hozzáadható mentett hely',
'collections.picker.hint': 'Válassz egy helyet a gyűjteményeidből',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Hely adatainak betöltése…',
'places.osmHint':
'OpenStreetMap keresés aktív (képek, nyitvatartás és értékelések nélkül). Bővített adatokhoz add meg a Google API kulcsot a beállításokban.',
'places.osmActive':
'Keresés OpenStreetMap-en keresztül (képek, értékelések és nyitvatartás nélkül). Bővített adatokhoz add meg a Google API kulcsot a beállításokban.',
'places.osmActive': 'Az OpenStreetMap van használatban. Egy Google API-kulcs értékeléseket és nyitvatartást ad hozzá.',
'places.details.title': 'Hely részletei',
'places.details.empty': 'Válassz egy találatot a képekhez és a leíráshoz.',
'places.details.loading': 'Részletek betöltése...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Leírás',
'places.details.adopt': 'Szöveg átvétele',
'places.details.adoptBlocked': 'Előbb ürítsd ki a leírás mezőt',
'places.details.facts': 'Jó tudni',
'places.details.nothing': 'Ehhez a helyhez nem található semmi.',
'places.details.fact.cuisine': 'Konyha',
'places.details.fact.openingHours': 'Nyitvatartás',
'places.details.fact.menu': 'Étlap',
'places.details.fact.outdoorSeating': 'Kültéri ülőhely',
'places.details.fact.takeaway': 'Elvitelre',
'places.details.fact.delivery': 'Kiszállítás',
'places.details.fact.wheelchair': 'Akadálymentes',
'places.details.fact.vegetarian': 'Vegetáriánus',
'places.details.fact.vegan': 'Vegán',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Nem sikerült létrehozni a kategóriát',
'places.nameRequired': 'Kérjük, adj meg egy nevet',
'places.saveError': 'Nem sikerült menteni',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Buat daftar dulu untuk menyimpan tempat.',
'collections.removedFromAll': 'Dihapus dari koleksi',
'collections.picker.title': 'Tempat tersimpan',
'collections.picker.showMore': 'Tampilkan {count} lagi',
'collections.picker.search': 'Cari tempat tersimpanmu',
'collections.picker.empty': 'Tidak ada tempat tersimpan untuk ditambahkan',
'collections.picker.hint': 'Pilih tempat dari koleksimu',
+13 -2
View File
@@ -83,8 +83,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Memuat detail tempat…',
'places.osmHint':
'Menggunakan pencarian OpenStreetMap (tanpa foto, jam buka, atau penilaian). Tambahkan Google API key di pengaturan untuk detail lengkap.',
'places.osmActive':
'Pencarian via OpenStreetMap (tanpa foto, penilaian, atau jam buka). Tambahkan Google API key di Pengaturan untuk data yang lebih lengkap.',
'places.osmActive': 'Menggunakan OpenStreetMap. Kunci API Google menambahkan rating dan jam buka.',
'places.details.title': 'Detail tempat',
'places.details.empty': 'Pilih hasil pencarian untuk melihat gambar dan deskripsi.',
'places.details.loading': 'Memuat detail...',
@@ -95,6 +94,18 @@ const places: TranslationStrings = {
'places.details.description': 'Deskripsi',
'places.details.adopt': 'Gunakan teks ini',
'places.details.adoptBlocked': 'Kosongkan dulu kolom deskripsi',
'places.details.facts': 'Perlu diketahui',
'places.details.nothing': 'Tidak ada yang ditemukan untuk tempat ini.',
'places.details.fact.cuisine': 'Masakan',
'places.details.fact.openingHours': 'Jam buka',
'places.details.fact.menu': 'Menu',
'places.details.fact.outdoorSeating': 'Area luar',
'places.details.fact.takeaway': 'Bawa pulang',
'places.details.fact.delivery': 'Antar',
'places.details.fact.wheelchair': 'Akses tanpa tangga',
'places.details.fact.vegetarian': 'Vegetarian',
'places.details.fact.vegan': 'Vegan',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Gagal membuat kategori',
'places.nameRequired': 'Harap masukkan nama',
'places.saveError': 'Gagal menyimpan',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Crea prima una lista per salvare i luoghi.',
'collections.removedFromAll': 'Rimosso dalla raccolta',
'collections.picker.title': 'Luoghi salvati',
'collections.picker.showMore': 'Mostra altri {count}',
'collections.picker.search': 'Cerca tra i tuoi luoghi salvati',
'collections.picker.empty': 'Nessun luogo salvato da aggiungere',
'collections.picker.hint': 'Scegli un luogo dalle tue raccolte',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Caricamento dettagli del luogo…',
'places.osmHint':
'Uso della ricerca OpenStreetMap (senza foto, orari di apertura o valutazioni). Aggiungi una chiave API Google nelle impostazioni per i dettagli completi.',
'places.osmActive':
'Ricerca tramite OpenStreetMap (senza foto, valutazioni o orari di apertura). Aggiungi una chiave API Google nelle Impostazioni per dati avanzati.',
'places.osmActive': 'Si usa OpenStreetMap. Una chiave API Google aggiunge valutazioni e orari.',
'places.details.title': 'Dettagli del luogo',
'places.details.empty': 'Scegli un risultato per vedere immagini e una descrizione.',
'places.details.loading': 'Caricamento dettagli...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Descrizione',
'places.details.adopt': 'Usa questo testo',
'places.details.adoptBlocked': 'Svuota prima il campo descrizione',
'places.details.facts': 'Da sapere',
'places.details.nothing': 'Nessun risultato per questo luogo.',
'places.details.fact.cuisine': 'Cucina',
'places.details.fact.openingHours': 'Orari',
'places.details.fact.menu': 'Menu',
'places.details.fact.outdoorSeating': "All'aperto",
'places.details.fact.takeaway': 'Da asporto',
'places.details.fact.delivery': 'Consegna',
'places.details.fact.wheelchair': 'Accesso senza gradini',
'places.details.fact.vegetarian': 'Vegetariano',
'places.details.fact.vegan': 'Vegano',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Impossibile creare la categoria',
'places.nameRequired': 'Inserisci un nome',
'places.saveError': 'Impossibile salvare',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'まずリストを作成して場所を保存しましょう。',
'collections.removedFromAll': 'コレクションから削除しました',
'collections.picker.title': '保存済みの場所',
'collections.picker.showMore': 'さらに{count}件を表示',
'collections.picker.search': '保存済みの場所を検索',
'collections.picker.empty': '追加できる保存済みの場所がありません',
'collections.picker.hint': 'コレクションから場所を選択',
+13 -1
View File
@@ -84,7 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': '詳細を読み込み中…',
'places.osmHint':
'OpenStreetMapで検索しています(写真・営業時間・評価なし)。設定でGoogle APIキーを追加すると詳細が表示されます。',
'places.osmActive': 'OpenStreetMapで検索中(写真・評価・営業時間なし)。設定でGoogle APIキーを追加してください。',
'places.osmActive': 'OpenStreetMapを使用中。Google APIキーで評価と営業時間が追加されます。',
'places.details.title': '場所の詳細',
'places.details.empty': '検索結果を選ぶと写真と説明が表示されます。',
'places.details.loading': '詳細を読み込み中...',
@@ -95,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': '説明',
'places.details.adopt': 'このテキストを使う',
'places.details.adoptBlocked': '先に説明欄を空にしてください',
'places.details.facts': '知っておくと便利',
'places.details.nothing': 'この場所の情報は見つかりませんでした。',
'places.details.fact.cuisine': '料理',
'places.details.fact.openingHours': '営業時間',
'places.details.fact.menu': 'メニュー',
'places.details.fact.outdoorSeating': '屋外席',
'places.details.fact.takeaway': 'テイクアウト',
'places.details.fact.delivery': 'デリバリー',
'places.details.fact.wheelchair': '段差なし',
'places.details.fact.vegetarian': 'ベジタリアン',
'places.details.fact.vegan': 'ヴィーガン',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'カテゴリの作成に失敗しました',
'places.nameRequired': '名前を入力してください',
'places.saveError': '保存に失敗しました',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': '먼저 목록을 만들어 장소를 저장하세요.',
'collections.removedFromAll': '컬렉션에서 제거됨',
'collections.picker.title': '저장된 장소',
'collections.picker.showMore': '{count}개 더 보기',
'collections.picker.search': '저장된 장소 검색',
'collections.picker.empty': '추가할 저장된 장소가 없습니다',
'collections.picker.hint': '컬렉션에서 장소를 선택하세요',
+13 -2
View File
@@ -83,8 +83,7 @@ const places: TranslationStrings = {
'places.loadingDetails': '장소 상세 정보 불러오는 중…',
'places.osmHint':
'OpenStreetMap 검색 사용 중 (사진, 영업 시간, 평점 없음). 전체 정보를 위해 설정에서 Google API 키를 추가하세요.',
'places.osmActive':
'OpenStreetMap으로 검색 중 (사진, 평점, 영업 시간 없음). 향상된 데이터를 위해 설정에서 Google API 키를 추가하세요.',
'places.osmActive': 'OpenStreetMap을 사용 중입니다. Google API 키를 추가하면 평점과 영업시간이 표시됩니다.',
'places.details.title': '장소 세부정보',
'places.details.empty': '검색 결과를 선택하면 사진과 설명이 표시됩니다.',
'places.details.loading': '세부정보를 불러오는 중...',
@@ -95,6 +94,18 @@ const places: TranslationStrings = {
'places.details.description': '설명',
'places.details.adopt': '이 텍스트 사용',
'places.details.adoptBlocked': '설명란을 먼저 비워 주세요',
'places.details.facts': '알아두면 좋아요',
'places.details.nothing': '이 장소에 대한 정보를 찾지 못했습니다.',
'places.details.fact.cuisine': '요리',
'places.details.fact.openingHours': '영업시간',
'places.details.fact.menu': '메뉴',
'places.details.fact.outdoorSeating': '야외 좌석',
'places.details.fact.takeaway': '포장',
'places.details.fact.delivery': '배달',
'places.details.fact.wheelchair': '단차 없는 출입',
'places.details.fact.vegetarian': '채식',
'places.details.fact.vegan': '비건',
'places.details.fact.internetAccess': '와이파이',
'places.categoryCreateError': '카테고리 생성 실패',
'places.nameRequired': '이름을 입력하세요',
'places.saveError': '저장 실패',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Maak eerst een lijst om plekken op te slaan.',
'collections.removedFromAll': 'Uit collectie verwijderd',
'collections.picker.title': 'Opgeslagen plekken',
'collections.picker.showMore': 'Nog {count} tonen',
'collections.picker.search': 'Zoek in je opgeslagen plekken',
'collections.picker.empty': 'Geen opgeslagen plekken om toe te voegen',
'collections.picker.hint': 'Kies een plek uit je collecties',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Plaatsgegevens laden…',
'places.osmHint':
"Zoeken via OpenStreetMap (geen foto's, openingstijden of beoordelingen). Voeg een Google API-sleutel toe in instellingen voor volledige details.",
'places.osmActive':
"Zoeken via OpenStreetMap (geen foto's, beoordelingen of openingstijden). Voeg een Google API-sleutel toe in Instellingen voor uitgebreide gegevens.",
'places.osmActive': 'OpenStreetMap wordt gebruikt. Een Google API-sleutel voegt beoordelingen en openingstijden toe.',
'places.details.title': 'Plaatsdetails',
'places.details.empty': 'Kies een zoekresultaat om afbeeldingen en een beschrijving te zien.',
'places.details.loading': 'Details laden...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Beschrijving',
'places.details.adopt': 'Deze tekst gebruiken',
'places.details.adoptBlocked': 'Maak eerst het beschrijvingsveld leeg',
'places.details.facts': 'Goed om te weten',
'places.details.nothing': 'Niets gevonden voor deze plaats.',
'places.details.fact.cuisine': 'Keuken',
'places.details.fact.openingHours': 'Openingstijden',
'places.details.fact.menu': 'Menukaart',
'places.details.fact.outdoorSeating': 'Terras',
'places.details.fact.takeaway': 'Afhalen',
'places.details.fact.delivery': 'Bezorging',
'places.details.fact.wheelchair': 'Drempelvrij',
'places.details.fact.vegetarian': 'Vegetarisch',
'places.details.fact.vegan': 'Veganistisch',
'places.details.fact.internetAccess': 'Wifi',
'places.categoryCreateError': 'Categorie aanmaken mislukt',
'places.nameRequired': 'Voer een naam in',
'places.saveError': 'Opslaan mislukt',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Najpierw utwórz listę, aby zapisywać miejsca.',
'collections.removedFromAll': 'Usunięto z kolekcji',
'collections.picker.title': 'Zapisane miejsca',
'collections.picker.showMore': 'Pokaż jeszcze {count}',
'collections.picker.search': 'Przeszukaj zapisane miejsca',
'collections.picker.empty': 'Brak zapisanych miejsc do dodania',
'collections.picker.hint': 'Wybierz miejsce ze swoich kolekcji',
+13 -2
View File
@@ -75,8 +75,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Ładowanie szczegółów miejsca…',
'places.osmHint':
'Korzystając z OpenStreetMap (brak zdjęć, godzin otwarcia czy ocen). Dodaj klucz API Google w ustawieniach aby uzyskać pełne dane.',
'places.osmActive':
'Szukaj przez OpenStreetMap (brak zdjęć, ocen czy godzin otwarcia). Dodaj klucz API Google w ustawieniach aby uzyskać pełne dane.',
'places.osmActive': 'Używany jest OpenStreetMap. Klucz Google API dodaje oceny i godziny otwarcia.',
'places.details.title': 'Szczegóły miejsca',
'places.details.empty': 'Wybierz wynik wyszukiwania, aby zobaczyć zdjęcia i opis.',
'places.details.loading': 'Wczytywanie szczegółów...',
@@ -87,6 +86,18 @@ const places: TranslationStrings = {
'places.details.description': 'Opis',
'places.details.adopt': 'Użyj tego tekstu',
'places.details.adoptBlocked': 'Najpierw wyczyść pole opisu',
'places.details.facts': 'Warto wiedzieć',
'places.details.nothing': 'Nic nie znaleziono dla tego miejsca.',
'places.details.fact.cuisine': 'Kuchnia',
'places.details.fact.openingHours': 'Godziny otwarcia',
'places.details.fact.menu': 'Menu',
'places.details.fact.outdoorSeating': 'Ogródek',
'places.details.fact.takeaway': 'Na wynos',
'places.details.fact.delivery': 'Dostawa',
'places.details.fact.wheelchair': 'Dostęp bez schodów',
'places.details.fact.vegetarian': 'Wegetariańskie',
'places.details.fact.vegan': 'Wegańskie',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Nie udało się utworzyć kategorii',
'places.nameRequired': 'Proszę podać nazwę',
'places.saveError': 'Nie udało się zapisać',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Сначала создайте список, чтобы сохранять места.',
'collections.removedFromAll': 'Удалено из коллекции',
'collections.picker.title': 'Сохранённые места',
'collections.picker.showMore': 'Показать ещё {count}',
'collections.picker.search': 'Поиск по сохранённым местам',
'collections.picker.empty': 'Нет сохранённых мест для добавления',
'collections.picker.hint': 'Выберите место из своих коллекций',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Загрузка данных о месте…',
'places.osmHint':
'Поиск через OpenStreetMap (без фото, часов работы и рейтингов). Добавьте API-ключ Google в настройках для полной информации.',
'places.osmActive':
'Поиск через OpenStreetMap (без фото, рейтингов и часов работы). Добавьте API-ключ Google в настройках для расширенных данных.',
'places.osmActive': 'Используется OpenStreetMap. Ключ Google API добавит рейтинги и часы работы.',
'places.details.title': 'Сведения о месте',
'places.details.empty': 'Выберите результат поиска, чтобы увидеть изображения и описание.',
'places.details.loading': 'Загрузка сведений...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Описание',
'places.details.adopt': 'Использовать этот текст',
'places.details.adoptBlocked': 'Сначала очистите поле описания',
'places.details.facts': 'Полезно знать',
'places.details.nothing': 'Для этого места ничего не найдено.',
'places.details.fact.cuisine': 'Кухня',
'places.details.fact.openingHours': 'Часы работы',
'places.details.fact.menu': 'Меню',
'places.details.fact.outdoorSeating': 'Летняя терраса',
'places.details.fact.takeaway': 'На вынос',
'places.details.fact.delivery': 'Доставка',
'places.details.fact.wheelchair': 'Без ступеней',
'places.details.fact.vegetarian': 'Вегетарианское',
'places.details.fact.vegan': 'Веганское',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Не удалось создать категорию',
'places.nameRequired': 'Введите название',
'places.saveError': 'Ошибка сохранения',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Skapa en lista först för att spara platser.',
'collections.removedFromAll': 'Borttagen från samlingen',
'collections.picker.title': 'Sparade platser',
'collections.picker.showMore': 'Visa {count} till',
'collections.picker.search': 'Sök bland dina sparade platser',
'collections.picker.empty': 'Inga sparade platser att lägga till',
'collections.picker.hint': 'Välj en plats från dina samlingar',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Hämtar information om platsen…',
'places.osmHint':
'Använder OpenStreetMap-sökningen (inga bilder, öppettider eller betyg). Lägg till en Google API-nyckel i inställningarna för fullständig information.',
'places.osmActive':
'Sök via OpenStreetMap (inga bilder, betyg eller öppettider). Lägg till en Google API-nyckel under Inställningar för utökad information.',
'places.osmActive': 'OpenStreetMap används. En Google API-nyckel lägger till betyg och öppettider.',
'places.details.title': 'Platsdetaljer',
'places.details.empty': 'Välj ett sökresultat för att se bilder och en beskrivning.',
'places.details.loading': 'Laddar detaljer...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Beskrivning',
'places.details.adopt': 'Använd den här texten',
'places.details.adoptBlocked': 'Töm beskrivningsfältet först',
'places.details.facts': 'Bra att veta',
'places.details.nothing': 'Inget hittades för den här platsen.',
'places.details.fact.cuisine': 'Kök',
'places.details.fact.openingHours': 'Öppettider',
'places.details.fact.menu': 'Meny',
'places.details.fact.outdoorSeating': 'Uteservering',
'places.details.fact.takeaway': 'Hämtmat',
'places.details.fact.delivery': 'Leverans',
'places.details.fact.wheelchair': 'Stegfri entré',
'places.details.fact.vegetarian': 'Vegetariskt',
'places.details.fact.vegan': 'Veganskt',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Det gick inte att skapa kategorin',
'places.nameRequired': 'Ange ett namn',
'places.saveError': 'Det gick inte att spara',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Yer kaydetmek için önce bir liste oluştur.',
'collections.removedFromAll': 'Koleksiyondan kaldırıldı',
'collections.picker.title': 'Kaydedilen yerler',
'collections.picker.showMore': '{count} tane daha göster',
'collections.picker.search': 'Kaydedilen yerlerinde ara',
'collections.picker.empty': 'Eklenecek kayıtlı yer yok',
'collections.picker.hint': 'Koleksiyonlarından bir yer seç',
+13 -2
View File
@@ -86,8 +86,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Yer ayrıntıları yükleniyor…',
'places.osmHint':
'OpenStreetMap aramasını kullanma (fotoğraf, açılış saatleri veya derecelendirme yok). Tüm ayrıntılar için ayarlara bir Google API anahtarı ekleyin.',
'places.osmActive':
"OpenStreetMap aracılığıyla arama yapın (fotoğraf, derecelendirme veya çalışma saatleri yok). Gelişmiş veriler için Ayarlar'a bir Google API anahtarı ekleyin.",
'places.osmActive': 'OpenStreetMap kullanılıyor. Google API anahtarı puan ve çalışma saatleri ekler.',
'places.details.title': 'Yer ayrıntıları',
'places.details.empty': 'Görseller ve açıklama için bir arama sonucu seç.',
'places.details.loading': 'Ayrıntılar yükleniyor...',
@@ -98,6 +97,18 @@ const places: TranslationStrings = {
'places.details.description': 'Açıklama',
'places.details.adopt': 'Bu metni kullan',
'places.details.adoptBlocked': 'Önce açıklama alanını boşalt',
'places.details.facts': 'Bilmekte fayda var',
'places.details.nothing': 'Bu yer için bir şey bulunamadı.',
'places.details.fact.cuisine': 'Mutfak',
'places.details.fact.openingHours': 'Çalışma saatleri',
'places.details.fact.menu': 'Menü',
'places.details.fact.outdoorSeating': 'Açık alan',
'places.details.fact.takeaway': 'Paket servis',
'places.details.fact.delivery': 'Teslimat',
'places.details.fact.wheelchair': 'Basamaksız giriş',
'places.details.fact.vegetarian': 'Vejetaryen',
'places.details.fact.vegan': 'Vegan',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Kategori oluşturulamadı',
'places.nameRequired': 'Lütfen bir ad girin',
'places.saveError': 'Kaydedilemedi',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Спершу створіть список, щоб зберігати місця.',
'collections.removedFromAll': 'Видалено з колекції',
'collections.picker.title': 'Збережені місця',
'collections.picker.showMore': 'Показати ще {count}',
'collections.picker.search': 'Пошук збережених місць',
'collections.picker.empty': 'Немає збережених місць для додавання',
'collections.picker.hint': 'Виберіть місце зі своїх колекцій',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Завантаження даних про місце…',
'places.osmHint':
'Пошук через OpenStreetMap (без фото, годин роботи та рейтингів). Додайте API-ключ Google у налаштуваннях для повної інформації.',
'places.osmActive':
'Пошук через OpenStreetMap (без фото, рейтингів та годин роботи). Додайте API-ключ Google у налаштуваннях для розширених даних.',
'places.osmActive': 'Використовується OpenStreetMap. Ключ Google API додасть рейтинги та години роботи.',
'places.details.title': 'Відомості про місце',
'places.details.empty': 'Виберіть результат пошуку, щоб побачити зображення та опис.',
'places.details.loading': 'Завантаження відомостей...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Опис',
'places.details.adopt': 'Використати цей текст',
'places.details.adoptBlocked': 'Спершу очистіть поле опису',
'places.details.facts': 'Корисно знати',
'places.details.nothing': 'Для цього місця нічого не знайдено.',
'places.details.fact.cuisine': 'Кухня',
'places.details.fact.openingHours': 'Години роботи',
'places.details.fact.menu': 'Меню',
'places.details.fact.outdoorSeating': 'Літня тераса',
'places.details.fact.takeaway': 'На винос',
'places.details.fact.delivery': 'Доставка',
'places.details.fact.wheelchair': 'Без сходинок',
'places.details.fact.vegetarian': 'Вегетаріанське',
'places.details.fact.vegan': 'Веганське',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Не вдалося створити категорію',
'places.nameRequired': 'Введіть назву',
'places.saveError': 'Помилка збереження',
+1
View File
@@ -111,6 +111,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': 'Tạo một danh sách trước để lưu địa điểm.',
'collections.removedFromAll': 'Đã xóa khỏi bộ sưu tập',
'collections.picker.title': 'Địa điểm đã lưu',
'collections.picker.showMore': 'Hiện thêm {count}',
'collections.picker.search': 'Tìm trong địa điểm đã lưu của bạn',
'collections.picker.empty': 'Không có địa điểm đã lưu nào để thêm',
'collections.picker.hint': 'Chọn một địa điểm từ bộ sưu tập của bạn',
+13 -2
View File
@@ -84,8 +84,7 @@ const places: TranslationStrings = {
'places.loadingDetails': 'Đang tải chi tiết địa điểm…',
'places.osmHint':
'Sử dụng tìm kiếm OpenStreetMap (không có ảnh, giờ mở cửa hoặc xếp hạng). Thêm khóa Google API trong cài đặt để biết đầy đủ chi tiết.',
'places.osmActive':
'Tìm kiếm qua OpenStreetMap (không có ảnh, xếp hạng hoặc giờ mở cửa). Thêm khóa Google API trong Cài đặt để có dữ liệu nâng cao.',
'places.osmActive': 'Đang dùng OpenStreetMap. Khóa API Google bổ sung đánh giá và giờ mở cửa.',
'places.details.title': 'Chi tiết địa điểm',
'places.details.empty': 'Chọn một kết quả tìm kiếm để xem hình ảnh và mô tả.',
'places.details.loading': 'Đang tải chi tiết...',
@@ -96,6 +95,18 @@ const places: TranslationStrings = {
'places.details.description': 'Mô tả',
'places.details.adopt': 'Dùng văn bản này',
'places.details.adoptBlocked': 'Hãy xóa trống ô mô tả trước',
'places.details.facts': 'Thông tin hữu ích',
'places.details.nothing': 'Không tìm thấy gì cho địa điểm này.',
'places.details.fact.cuisine': 'Ẩm thực',
'places.details.fact.openingHours': 'Giờ mở cửa',
'places.details.fact.menu': 'Thực đơn',
'places.details.fact.outdoorSeating': 'Chỗ ngồi ngoài trời',
'places.details.fact.takeaway': 'Mang đi',
'places.details.fact.delivery': 'Giao hàng',
'places.details.fact.wheelchair': 'Lối vào không bậc',
'places.details.fact.vegetarian': 'Chay',
'places.details.fact.vegan': 'Thuần chay',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': 'Không tạo được danh mục',
'places.nameRequired': 'Vui lòng nhập tên',
'places.saveError': 'Không lưu được',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': '請先建立一個清單來儲存地點。',
'collections.removedFromAll': '已從收藏中移除',
'collections.picker.title': '已儲存的地點',
'collections.picker.showMore': '再顯示 {count} 個',
'collections.picker.search': '搜尋你已儲存的地點',
'collections.picker.empty': '沒有可新增的已儲存地點',
'collections.picker.hint': '從你的收藏中選擇一個地點',
+13 -1
View File
@@ -82,7 +82,7 @@ const places: TranslationStrings = {
'places.mapsSearchError': '地點搜尋失敗。',
'places.loadingDetails': '正在載入地點詳情…',
'places.osmHint': '使用 OpenStreetMap 搜尋(無照片、營業時間或評分)。在設定中新增 Google API 金鑰以獲取完整資訊。',
'places.osmActive': '透過 OpenStreetMap 搜尋(無照片、評分或營業時間)。在設定中新增 Google API 金鑰以獲取增強資料。',
'places.osmActive': '正在使用 OpenStreetMap。加入 Google API 金鑰可取得評分與營業時間。',
'places.details.title': '地點詳細資料',
'places.details.empty': '選擇一筆搜尋結果即可查看圖片與描述。',
'places.details.loading': '正在載入詳細資料...',
@@ -93,6 +93,18 @@ const places: TranslationStrings = {
'places.details.description': '描述',
'places.details.adopt': '使用此文字',
'places.details.adoptBlocked': '請先清空描述欄位',
'places.details.facts': '值得一看',
'places.details.nothing': '找不到此地點的資訊。',
'places.details.fact.cuisine': '菜系',
'places.details.fact.openingHours': '營業時間',
'places.details.fact.menu': '菜單',
'places.details.fact.outdoorSeating': '戶外座位',
'places.details.fact.takeaway': '外帶',
'places.details.fact.delivery': '外送',
'places.details.fact.wheelchair': '無台階通行',
'places.details.fact.vegetarian': '素食',
'places.details.fact.vegan': '純素',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': '建立分類失敗',
'places.nameRequired': '請輸入名稱',
'places.saveError': '儲存失敗',
+1
View File
@@ -110,6 +110,7 @@ const collection: TranslationStrings = {
'collections.noListsYet': '请先创建一个列表来保存地点。',
'collections.removedFromAll': '已从收藏中移除',
'collections.picker.title': '已保存的地点',
'collections.picker.showMore': '再显示 {count} 个',
'collections.picker.search': '搜索你已保存的地点',
'collections.picker.empty': '没有可添加的已保存地点',
'collections.picker.hint': '从你的收藏中选择一个地点',
+13 -1
View File
@@ -82,7 +82,7 @@ const places: TranslationStrings = {
'places.mapsSearchError': '地点搜索失败。',
'places.loadingDetails': '正在加载地点详情…',
'places.osmHint': '使用 OpenStreetMap 搜索(无照片、营业时间或评分)。在设置中添加 Google API 密钥以获取完整信息。',
'places.osmActive': '通过 OpenStreetMap 搜索(无照片、评分或营业时间)。在设置中添加 Google API 密钥以获取增强数据。',
'places.osmActive': '正在使用 OpenStreetMap。添加 Google API 密钥可获得评分和营业时间。',
'places.details.title': '地点详情',
'places.details.empty': '选择一条搜索结果即可查看图片和描述。',
'places.details.loading': '正在加载详情...',
@@ -93,6 +93,18 @@ const places: TranslationStrings = {
'places.details.description': '描述',
'places.details.adopt': '使用此文本',
'places.details.adoptBlocked': '请先清空描述字段',
'places.details.facts': '值得一看',
'places.details.nothing': '未找到该地点的信息。',
'places.details.fact.cuisine': '菜系',
'places.details.fact.openingHours': '营业时间',
'places.details.fact.menu': '菜单',
'places.details.fact.outdoorSeating': '户外座位',
'places.details.fact.takeaway': '外带',
'places.details.fact.delivery': '外送',
'places.details.fact.wheelchair': '无台阶通行',
'places.details.fact.vegetarian': '素食',
'places.details.fact.vegan': '纯素',
'places.details.fact.internetAccess': 'Wi-Fi',
'places.categoryCreateError': '创建分类失败',
'places.nameRequired': '请输入名称',
'places.saveError': '保存失败',
+35 -1
View File
@@ -124,7 +124,7 @@ export const placePhotoCandidateSchema = z.object({
});
export type PlacePhotoCandidate = z.infer<typeof placePhotoCandidateSchema>;
export const placeDescriptionSourceSchema = z.enum(['google', 'osm', 'wikipedia']);
export const placeDescriptionSourceSchema = z.enum(['google', 'osm', 'wikivoyage', 'wikipedia']);
export type PlaceDescriptionSource = z.infer<typeof placeDescriptionSourceSchema>;
export const placeDescriptionSchema = z.object({
@@ -135,6 +135,39 @@ export const placeDescriptionSchema = z.object({
});
export type PlaceDescription = z.infer<typeof placeDescriptionSchema>;
/**
* A practical fact about a place, taken from its OpenStreetMap tags.
*
* This is what makes the column worth opening for a restaurant: places like
* that have no encyclopaedia article and no photograph of their own, but they
* very often carry a cuisine, opening hours and a link to their menu. The tags
* arrive with the details lookup the dialog already makes, so none of this
* costs an extra request.
*
* `kind` is translated client-side; `value` is provider data and stays as-is.
*/
export const placeFactKindSchema = z.enum([
'cuisine',
'openingHours',
'menu',
'outdoorSeating',
'takeaway',
'delivery',
'wheelchair',
'vegetarian',
'vegan',
'internetAccess',
]);
export type PlaceFactKind = z.infer<typeof placeFactKindSchema>;
export const placeFactSchema = z.object({
kind: placeFactKindSchema,
/** Free-text detail ("regional", "Mo-Sa 17:30+"); null for a plain yes. */
value: z.string().nullable(),
url: z.string().nullable(),
});
export type PlaceFact = z.infer<typeof placeFactSchema>;
export const mapsPlaceEnrichmentRequestSchema = z.object({
/** Google place id or `osm:<type>/<id>`; empty for a coordinate-only lookup. */
placeId: z.string().max(300).optional(),
@@ -149,6 +182,7 @@ export type MapsPlaceEnrichmentRequest = z.infer<typeof mapsPlaceEnrichmentReque
export const mapsPlaceEnrichmentResultSchema = z.object({
photos: z.array(placePhotoCandidateSchema),
description: placeDescriptionSchema.nullable(),
facts: z.array(placeFactSchema),
/** True when the admin switched enrichment off; the column then stays quiet. */
disabled: z.boolean().optional(),
});