managarten/packages/help/src/translations.ts
Till JS ab24db36dd fix(packages): cross-package broken imports + missing exports
Five unrelated packages each had a few imports pointing at the wrong
file or missing from their public surface. Grouped because none of
the individual fixes warrants its own commit and they all unblock
the same downstream consumer (apps/mana/apps/web type-check).

packages/help
  - HelpPage.svelte: `'../types.js'` and `'./content'` for
    HelpPageProps/HelpSection/SearchResult — neither path exists.
    Real homes are `../ui-types` (props) and `../search-types`
    (search shapes). Fix the imports.
  - HelpSearch.svelte: same `'../content'` typo for SearchResult →
    `'../search-types'`.
  - translations.ts: `'./types.js'` for HelpPageTranslations →
    `'./ui-types'`.
  - ui-types.ts: was importing SearchResult from `'./content'` but
    that module only exports content shapes. Split into two imports
    so HelpContent stays from content.ts and SearchResult comes from
    search-types.ts.

packages/feedback
  - FeedbackPage.svelte: imported `Feedback` and `CreateFeedbackInput`
    from `'./createFeedbackService'` but the service module only
    exports the service factory. Real homes are `'./feedback'`
    (Feedback) and `'./api'` (CreateFeedbackInput).
  - FeedbackForm.svelte: same `'./feedback'` typo for
    CreateFeedbackInput → `'./api'`.

packages/subscriptions
  - UsageCard / CostCard / pages/SubscriptionPage: all imported
    UsageData / CostItem from `'./plans'` but those types live in
    `'./usage'`. SubscriptionPage additionally had a relative-path
    bug — it's at `src/pages/`, not `src/`, so `./plans` resolved
    to `pages/plans` (nonexistent). Now imports `'../plans'` for
    plan types and `'../usage'` for usage/cost types.

packages/shared-ui
  - index.ts: re-exports the QuickInputItem family from
    `./quick-input` but had forgotten `HighlightPattern`. Added.
    Apps that build their own InputBar pattern config (e.g.
    mana/web/src/lib/quick-input/types.ts) need it as a public type.
  - PillNavigation.svelte: imported `SpotlightAction` and
    `ContentSearcher` from `./GlobalSpotlight.svelte` (a Svelte
    component file), which only re-exports the default. Both types
    live in `./types`. Move them to the existing types-import
    block; the GlobalSpotlight import becomes a plain default.

packages/shared-auth-ui
  - stores/createAuthStore.svelte.ts: imported AuthServiceAdapter /
    AuthResult / BaseUser from `'./types'` (nonexistent — the file
    is `'./store-types'`).

Net: -23 type errors. Zero behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:23:34 +02:00

175 lines
4 KiB
TypeScript

/**
* Default translations for the HelpPage component.
* Apps can use these directly or override individual fields.
*/
import type { HelpPageTranslations } from './ui-types';
export const defaultTranslationsDE: HelpPageTranslations = {
title: 'Hilfe & Support',
subtitle: 'Finde Antworten und lerne die App kennen',
searchPlaceholder: 'Hilfe durchsuchen...',
sections: {
faq: 'FAQ',
features: 'Features',
shortcuts: 'Tastenkürzel',
gettingStarted: 'Erste Schritte',
changelog: 'Änderungen',
contact: 'Kontakt',
},
search: {
noResults: 'Keine Ergebnisse für "{query}"',
resultsCount: '{count} Ergebnisse',
searching: 'Suche...',
},
faq: {
noItems: 'Keine häufigen Fragen verfügbar.',
allCategories: 'Alle',
categories: {
general: 'Allgemein',
account: 'Konto',
billing: 'Abrechnung',
features: 'Funktionen',
technical: 'Technisch',
privacy: 'Datenschutz',
},
},
features: {
noItems: 'Keine Features verfügbar.',
comingSoon: 'Demnächst',
learnMore: 'Mehr erfahren',
},
shortcuts: {
noItems: 'Keine Tastenkürzel verfügbar.',
columns: {
shortcut: 'Kürzel',
action: 'Aktion',
description: 'Beschreibung',
},
},
gettingStarted: {
noItems: 'Keine Anleitungen verfügbar.',
estimatedTime: 'Geschätzte Zeit',
difficulty: {
beginner: 'Einsteiger',
intermediate: 'Fortgeschritten',
advanced: 'Experte',
},
},
changelog: {
noItems: 'Keine Änderungen verfügbar.',
showAll: 'Alle Versionen anzeigen',
types: {
major: 'Hauptversion',
minor: 'Nebenversion',
patch: 'Patch',
beta: 'Beta',
},
labels: {
features: 'Neue Funktionen',
improvements: 'Verbesserungen',
bugFixes: 'Fehlerbehebungen',
},
},
contact: {
noInfo: 'Keine Kontaktinformationen verfügbar.',
email: 'E-Mail senden',
responseTime: 'Antwortzeit',
},
common: {
back: 'Zurück',
showMore: 'Mehr anzeigen',
showLess: 'Weniger anzeigen',
},
};
export const defaultTranslationsEN: HelpPageTranslations = {
title: 'Help & Support',
subtitle: 'Find answers and learn how to use the app',
searchPlaceholder: 'Search help...',
sections: {
faq: 'FAQ',
features: 'Features',
shortcuts: 'Shortcuts',
gettingStarted: 'Getting Started',
changelog: 'Changelog',
contact: 'Contact',
},
search: {
noResults: 'No results for "{query}"',
resultsCount: '{count} results',
searching: 'Searching...',
},
faq: {
noItems: 'No frequently asked questions available.',
allCategories: 'All',
categories: {
general: 'General',
account: 'Account',
billing: 'Billing',
features: 'Features',
technical: 'Technical',
privacy: 'Privacy',
},
},
features: {
noItems: 'No features available.',
comingSoon: 'Coming Soon',
learnMore: 'Learn More',
},
shortcuts: {
noItems: 'No keyboard shortcuts available.',
columns: {
shortcut: 'Shortcut',
action: 'Action',
description: 'Description',
},
},
gettingStarted: {
noItems: 'No guides available.',
estimatedTime: 'Estimated time',
difficulty: {
beginner: 'Beginner',
intermediate: 'Intermediate',
advanced: 'Advanced',
},
},
changelog: {
noItems: 'No changelog available.',
showAll: 'Show all releases',
types: {
major: 'Major',
minor: 'Minor',
patch: 'Patch',
beta: 'Beta',
},
labels: {
features: 'New Features',
improvements: 'Improvements',
bugFixes: 'Bug Fixes',
},
},
contact: {
noInfo: 'No contact information available.',
email: 'Send email',
responseTime: 'Response time',
},
common: {
back: 'Back',
showMore: 'Show more',
showLess: 'Show less',
},
};
/**
* Get default translations for a locale, with optional overrides.
* Use this to customize only the fields that differ per app (e.g. subtitle).
*/
export function getHelpTranslations(
locale: string,
overrides?: Partial<HelpPageTranslations>
): HelpPageTranslations {
const base = locale === 'de' ? defaultTranslationsDE : defaultTranslationsEN;
if (!overrides) return base;
return { ...base, ...overrides };
}