Poeditor plugin implementation - #223
Conversation
Implements a comprehensive POEditor plugin following the 5-layer architecture pattern and POEditor API v2 specification. Features: - Project management (list, get project details) - Term operations (add, update terms following API spec) - Translation file upload - Multi-language support - Full error handling with ClientResult pattern - Textual TUI integration with workflow steps - Improved error messages for plugin configuration Plugin Architecture: - Models: Network (REST API), View (UI), Mappers - Clients: Network layer, Services, Public facade - Operations: Pure business logic - Steps: UI orchestration for workflows - Workflows: list-projects, import-translations API Compliance: - terms/add: Strict validation, supports all optional fields - terms/update: Full spec support including fuzzy_trigger - projects/upload: File upload with multipart/form-data - Proper statistics parsing (parsed/added/updated) Configuration: - API token via secrets (POEDITOR_API_TOKEN) - Project-level plugin enablement - Enhanced error messages guide users to configure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83284f9 to
fe4a323
Compare
| project_id, file_path, language_code, updating | ||
| ) | ||
|
|
||
| def get_project_languages(self, project_id: str) -> ClientResult[list[str]]: |
There was a problem hiding this comment.
These methods are being added to the client facade’s public API, but clients/protocols.py still only declares list_projects, get_project, and upload_file. Since the plugin exports PoEditorClientProtocol for DI/testing, the declared interface is now incomplete. Please add get_project_languages, add_terms, and create_terms_with_translations to PoEditorClientProtocol so the public contract matches the implementation.
There was a problem hiding this comment.
I see that you've added the three methods to PoEditorClientProtocol, but looking at the current client facade code, I can only find create_terms_with_translations implemented. The methods get_project_languages and add_terms appear in the protocol declaration but are not present in the client facade's methods. Could you either:
- Add implementations of
get_project_languagesandadd_termsto thePoEditorClientclass, or - Clarify if these methods are implemented elsewhere or planned for a follow-up?
The goal is for the protocol to accurately reflect what's actually implemented in the facade.
| ) | ||
|
|
||
| @log_client_operation() | ||
| def add_terms(self, project_id: str, terms: list[dict]) -> ClientResult[dict]: |
There was a problem hiding this comment.
Instead of returning dict you could return something like this:
@dataclass class TermsAddResult: parsed: int added: int
There was a problem hiding this comment.
The current code still shows _add_terms returning ClientResult[dict] with data={'parsed': parsed, 'added': added}. The patch should change this to ClientResult[TermsAddResult] and use data=TermsAddResult(parsed=parsed, added=added) instead. Please ensure this change is applied to the final code.
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
By: finxo
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Pull Request
📝 Summary
Adds PoEditor plugin as a core plugin for Titan
🔧 Changes Made
🧪 Testing
poetry run pytest)make test)titan-dev📊 Logs
✅ Checklist
Plugins > Git Plugin,GitHub Plugin,Jira Plugin)