Repository navigation
Add Bisu Platform as a translation source - #23
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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::Bisuto fetch JSON map exports from the Bisu Platform and return thedatahash 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds our own Bisu Platform as a translation source, alongside the existing Tolgee / OneSky / Google Sheets / URL sources.
How
Bisu::Source::Bisusource (lib/bisu/source/bisu.rb):GET /api/v1/export?languages=all&mode=flatwithAuthorization: Bearer bsu_...andAccept: application/json, returning thedatamap keyed by language code.lib/bisu.rb(require+when "bisu") and validated viaBISU_STRUCTinlib/bisu/config.rb(api_key+hostrequired).Config
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 likept-BR/fr-CAcontain hyphens, the language can't be reliably parsed from the filename. The JSONdatamap is keyed by exact language codes, avoiding that entirely. Verified end-to-end against a real 16-language export.🤖 Generated with Claude Code