Skip to content

Backend: Add multi-language campaign metadata support #464

Description

@joelpeace48-cell

Summary

Campaigns targeting non-English audiences need localized name and description fields. The backend should store translations alongside the default English content and serve the appropriate locale based on the Accept-Language header.

Acceptance Criteria

  • Add translations JSON column to campaigns table: { 'es': { name, description }, 'fr': { name, description } }
  • Add PUT /api/v1/campaigns/:id/translations/:locale — upsert a translation (API key required); validate locale is BCP-47 format (e.g. es, fr, zh-CN)
  • Add GET /api/v1/campaigns/:id/translations — return all stored translations
  • Locale negotiation: GET /api/v1/campaigns and GET /api/v1/campaigns/:id serve translated name/description based on Accept-Language header; fallback to en if translation unavailable
  • Add ?locale=es query param override for explicit locale selection
  • Add available_locales array to campaign response listing which locales have translations
  • Limit: max 10 locales per campaign, each translation max 2KB
  • Unit tests: locale negotiation, fallback to English, CRUD translations

References

  • backend/src/schemas.js
  • backend/src/dal/sqliteCampaignRepository.js

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea: backendBackend API (Node/Express)difficulty: mediumModerate complexitydxDeveloper experience

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions