Skip to content

Add Bisu Platform as a translation source - #23

Merged
mrstif merged 3 commits into
mainfrom
bisu-platform
Jul 30, 2026
Merged

mrstif merged 3 commits into
mainfrom
bisu-platform

Conversation

@mrstif

@mrstif mrstif commented Jul 30, 2026

Copy link
Copy Markdown
Member

What

Adds our own Bisu Platform as a translation source, alongside the existing Tolgee / OneSky / Google Sheets / URL sources.

How

  • New Bisu::Source::Bisu source (lib/bisu/source/bisu.rb): GET /api/v1/export?languages=all&mode=flat with Authorization: Bearer bsu_... and Accept: application/json, returning the data map keyed by language code.
  • Registered in lib/bisu.rb (require + when "bisu") and validated via BISU_STRUCT in lib/bisu/config.rb (api_key + host required).
  • Spec + JSON fixture, README docs (linked to the platform repo), and a changelog entry.

Config

dictionary:
  type: bisu
  api_key: bsu_...
  host: <BISU-PLATFORM-HOST>

Notes

The export API is modelled on Tolgee's. We use the JSON map export rather than the ZIP variant: the ZIP names files with the project-slug prefix (e.g. hole19-golf-en.json), and since both the slug and locales like pt-BR/fr-CA contain hyphens, the language can't be reliably parsed from the filename. The JSON data map is keyed by exact language codes, avoiding that entirely. Verified end-to-end against a real 16-language export.

🤖 Generated with Claude Code

mrstif and others added 3 commits July 30, 2026 11:54
Mirrors the Tolgee source pattern: downloads a ZIP export from the
Bisu Platform API (GET /api/v1/export), authenticating with a per-project
bearer token, and extracts one JSON file per language.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The ZIP export names files with the project slug prefix
(e.g. hole19-golf-en.json), so deriving the language from the filename
produced "hole19-golf-en" instead of "en", causing "Unknown language en".
The slug and locales both contain hyphens, so the language can't be
robustly parsed from the filename.

Switch to the JSON export (Accept: application/json), whose "data" map is
keyed by the exact language codes, removing all filename guessing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mrstif
mrstif requested a review from Copilot July 30, 2026 15:59
@mrstif
mrstif merged commit 5672313 into main Jul 30, 2026
9 checks passed
@mrstif
mrstif deleted the bisu-platform branch July 30, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new translation dictionary source backed by the internal Bisu Platform export API, integrating it into the existing Bisu sources and documenting/configuring it for users.

Changes:

  • Introduces Bisu::Source::Bisu to fetch JSON map exports from the Bisu Platform and return the data hash keyed by language code.
  • Registers the new "bisu" dictionary type in the main source selection and config validation.
  • Adds RSpec coverage + fixture, updates README documentation, and records the change in the changelog.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/bisu/source/bisu.rb Implements the new Bisu Platform dictionary source via HTTPS GET and JSON parsing.
lib/bisu.rb Wires the "bisu" dictionary type to instantiate the new source.
lib/bisu/config.rb Adds BISU_STRUCT and registers "bisu" in DICTIONARY_STRUCT.
spec/lib/bisu/source/bisu_spec.rb Adds tests for successful parsing and auth header usage, plus error handling.
spec/fixtures/sample_bisu_response.json Fixture for the platform export response shape (data by language).
README.md Documents configuration for the new Bisu Platform source.
CHANGELOG.md Adds an “Unreleased” entry noting the new source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/bisu/source/bisu.rb Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants