Skip to content

Poeditor plugin implementation - #223

Open
gabrielglbh wants to merge 20 commits into
masorange:masterfrom
gabrielglbh:poeditor-plugin
Open

Poeditor plugin implementation#223
gabrielglbh wants to merge 20 commits into
masorange:masterfrom
gabrielglbh:poeditor-plugin

Conversation

@gabrielglbh

Copy link
Copy Markdown

Pull Request

📝 Summary

Adds PoEditor plugin as a core plugin for Titan

🔧 Changes Made

  • Add new plgin
  • Add new client
  • Add new operations
  • Add new network and UI models

🧪 Testing

  • Unit tests added/updated (poetry run pytest)
  • All tests passing (make test)
  • Manual testing with titan-dev

📊 Logs

  • No new log events

✅ Checklist

  • Self-review done
  • Follows the project's logging rules (no secrets, no content in logs)
  • New and existing tests pass
  • Documentation updated if needed
  • Plugin documentation updated when plugin functions or parameters changed (Plugins > Git Plugin, GitHub Plugin, Jira Plugin)

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>
project_id, file_path, language_code, updating
)

def get_project_languages(self, project_id: str) -> ClientResult[list[str]]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

  1. Add implementations of get_project_languages and add_terms to the PoEditorClient class, or
  2. 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.

Comment thread plugins/titan-plugin-poeditor/titan_plugin_poeditor/clients/protocols.py Outdated
)

@log_client_operation()
def add_terms(self, project_id: str, terms: list[dict]) -> ClientResult[dict]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of returning dict you could return something like this:

@dataclass class TermsAddResult: parsed: int added: int

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@gabrielglbh
gabrielglbh requested a review from finxo May 11, 2026 07:27
@wiz-c04d923138

wiz-c04d923138 Bot commented Jun 15, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 2 High 1 Medium
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 2 High 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

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