i18n Guide - satoshi-create/emakimono-next GitHub Wiki

🌐 i18n Guide

This project is designed to support bilingual (Japanese–English) content from the ground up, and is extensible to other languages.

We separate visual content, textual metadata, and localized text to ensure flexibility and maintainability.


📂 Where i18n is Applied

1. Scroll Metadata (image-metadata-cache.json)

Fields such as title, author, and desc support both Japanese and English variants:

{
  "title": "鳥獸人物戦画絵巻",
  "titleen": "Chōjū-jinbutsu-giga_first",
  "author": "鳥筒僧正觉爹",
  "authoren": "toba-sojo-kakuyu",
  "desc": "...",
  "descen": "..."
}

These values are shown in the UI based on the active locale.


2. Chapter Titles (emaki-text-data/{scrollId}.json)

Each scroll has an accompanying text file that defines chapter titles per language:

[
  {
    "chapter": "1",
    "title": "兆と猿の水遊び",
    "titleen": "Rabbits and Monkeys Playing in the Water"
  },
  ...
]

Each chapter key is matched with emakis[].chapter to determine the caption shown during scroll viewing.


🌍 Locale Switching

The UI supports both:

  • Automatic locale detection (via browser headers)
  • Manual language switcher (e.g., button or dropdown)

The current locale is stored in URL query params (?lang=en) or app state.


💬 For feedback or translation help, feel free to open a GitHub Issue or PR.