feat: allow translations plugins to customize import message and color#1023
Merged
feat: allow translations plugins to customize import message and color#1023
Conversation
…nslation notifications - Add TranslationImportResult interface so onImport handlers can return rich notifications (title, message, link, color) instead of only TranslationRow[]. - Add color property to TranslationExportResult for controlling notification appearance (uses Mantine color names). - Update LocalizationModal UI to render action buttons and custom colors for both import and export service notifications.
Replace free-form color string with status: 'success' | 'info' | 'error'. UI maps success to green, error to red, info to undefined (default).
stevenle
approved these changes
Apr 3, 2026
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.
Summary
Adds support for rich notifications from
onImporttranslation service handlers, matching the existingonExportbehavior.Changes
TranslationImportResult type: New interface allowing
onImporthandlers to return{title, message, link, color}instead of onlyTranslationRow[]. When a non-array result is returned, the UI displays an informational notification (with optional action button) instead of attempting to merge rows.color property: Added to both
TranslationExportResultandTranslationImportResult. Accepts Mantine color names (e.g.green,red,blue) to control notification appearance.UI update:
LocalizationModalnow checksArray.isArray(resData.data)for import results. Arrays are processed as before; objects are rendered as notifications with optional title, message, link button, and color.Motivation
Translation services (e.g. Localizer) need to communicate status back to users during import, such as "requests still in progress" or "no pending requests", without throwing errors. Previously the only way to show a message was to throw, which displayed an error-styled notification with no action buttons. Now services can return a
TranslationImportResultto show informational notifications with links.