Bunmori
Concepts

Translations

Multi-language content in Bunmori

Translations

Bunmori has built-in support for multi-language content. Each item can have translations in multiple languages.

How Translations Work

  1. Collections define which languages are supported
  2. Fields are marked as translatable or not
  3. Each item stores translations separately per language

Translation Structure

Each translation contains:

  • languageCode - ISO code (e.g., "en", "de", "ja")
  • title - Item title in this language
  • data - Translatable field values

Fetching Translations

All languages:

GET /api/public/{domain}/collections/{collection}/items

Specific language:

GET /api/public/{domain}/collections/{collection}/items?language=es

Handling Missing Translations

The API automatically handles missing translations with language fallback:

  1. If the requested translation doesn't exist, content from the default language is returned
  2. The response includes metadata to help you identify when fallback was used:
    • language - The language code of the content actually returned
    • requestedLanguage - The language code that was requested
    • translationExists - Boolean indicating if translation exists for requested language

Example response with fallback:

{
  "id": "abc123",
  "language": "en",
  "requestedLanguage": "de",
  "translationExists": false,
  "title": "My Post",
  "translationData": {}
}

In this example, German (de) was requested but doesn't exist, so English (en) content was returned instead.

Adding Translations

In the admin UI, translations are managed per item:

  1. Open an item for editing
  2. Only languages with existing translations appear as tabs
  3. Click "Add Translation" to create a translation in a new language
  4. Fill in the required fields (title and any required translatable fields)
  5. Save the item

On this page