Skip to content

feat: Add JSON import / export of source and translation text#829

Open
spaghetti-stack wants to merge 1 commit into
mayocream:mainfrom
spaghetti-stack:main
Open

feat: Add JSON import / export of source and translation text#829
spaghetti-stack wants to merge 1 commit into
mayocream:mainfrom
spaghetti-stack:main

Conversation

@spaghetti-stack

@spaghetti-stack spaghetti-stack commented Jun 28, 2026

Copy link
Copy Markdown

Changes

  • Allows exporting source and translation text of a whole project to JSON format.
  • Allows importing translation text for a whole project in JSON format.

This way it is now possible to use an external translation provider to, for example:

  • Perform translations using an LLM that make use of the full context of all pages.
  • Use external translators not currently supported by Koharu.
  • Compare and switch between multiple translations without having to rerun the translation pipeline.

This feature is similar to #614 and #555 (but without speaker ID).

I chose JSON as format because it is easy to parse, and the format is (slightly) more compact than XML so using an LLM for whole context translation would use less tokens. XML or Markdown could also be added in the future.

User facing changes:

image

Added the "Export source texts", "Export translations" and "Import translations" buttons to the UI which are used to interact with this new feature.

Testing

I have manually tested the import / export functionality. There are also front end and back end unit tests.

@github-actions

Copy link
Copy Markdown

Thanks for your first PR to Koharu.

Please review our contribution guide before review:
https://koharu.rs/contribute/introduction/

In the PR description, include:

  • what changed
  • any user-visible behavior differences
  • how you verified the change

If AI helped produce the patch, a human still needs to review and understand it before submission.

Allows exporting source and translation text of a whole project to JSON format.
Allows importing translation text for a whole project in JSON format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant