Skip to content

feat(translation): ITranslationService for plugins (backendconfiguration#1384) - #974

Merged
renemadsen merged 1 commit into
masterfrom
fix/1384-translation-service-abstraction
Oct 4, 2026
Merged

renemadsen merged 1 commit into
masterfrom
fix/1384-translation-service-abstraction

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

Adds Microting.eFormApi.BasePn.Abstractions.Translation.ITranslationService so plugins can machine-translate server-side through the API host (needed by microting/eform-backendconfiguration-plugin#1384, v2 of #1324).

public interface ITranslationService
{
    bool IsConfigured { get; }
    Task<OperationDataResult<string>> TranslateText(string sourceText, string sourceLanguageCode, string targetLanguageCode);
}
  • Only the interface moves. The host (eform-angular-frontend) keeps the Google implementation, the options and the API key, and registers the implementation in DI. Plugins resolve it optionally, so the key never reaches them.
  • The interface has its own namespace. The host still declares an ITranslationService of its own until its follow-up PR switches over, and its Startup imports Microting.eFormApi.BasePn.Abstractions. With a separate namespace, a plain dependabot bump to this version cannot cause an ambiguous reference.

Release order

  1. Merge this PR, then tag v10.0.37 on master. The tag workflow publishes the NuGet package.
  2. eform-angular-frontend draft PR: bumps BasePn to 10.0.37 and implements this interface.
  3. eform-backendconfiguration-plugin draft PR: uses it in CreateTask/UpdateTask.

Tests

This repo has no test project. The interface is exercised by the host's unit tests and the plugin's integration tests (fake translator) in the follow-up PRs.

Not verified

Builds locally (dotnet build, and dotnet pack to a scratch feed that both follow-ups were built against). No runtime check.

Refs microting/eform-backendconfiguration-plugin#1384

🤖 Generated with Claude Code

…ackendconfiguration-plugin#1384)

Adds Microting.eFormApi.BasePn.Abstractions.Translation.ITranslationService
(IsConfigured + TranslateText(source, sourceCode, targetCode)), so a plugin
can machine-translate server-side through the API host without ever seeing
the API key. The host owns the implementation and the key and registers it
in DI; plugins resolve it optionally.

The interface lives in its own namespace: the host still declares an
ITranslationService of its own until it switches over, and its Startup
imports Microting.eFormApi.BasePn.Abstractions, so a plain package bump
must not produce an ambiguous reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

Copilot review overview

🟢 Approval recommended

The focused interface addition is consistent with the planned host and plugin integrations and has no identified defects.

Review effort: Balanced
Findings: None

What changed in this PR

Adds a shared translation-service contract so plugins can request host-managed server-side translations without receiving API credentials.

Changes:

  • Adds ITranslationService with configuration status and asynchronous translation.
  • Isolates the contract in a dedicated namespace to avoid host naming conflicts.
File Description
eFormApi.BasePn/​Abstractions/​Translation/​ITranslationService.cs Defines the plugin-facing translation contract and behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renemadsen
renemadsen merged commit 67adf53 into master Oct 4, 2026
5 checks passed
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