Studio Developer Manual / Version 2404
Table Of ContentsWorkflow localization follows the same approach as content type localization described in Section 9.5.1, “Localizing Types and Fields”. Localizations are added or modified using a registry. Just as for content type localization, icons are provided in terms of SVG icons, so the same prerequisites as described previously hold.
The following code example shows an excerpt of the localization of the Global Link translation workflow.
import GccWorkflowLocalization_properties from "./GccWorkflowLocalization_properties"; import gccIcon from "./icons/global-link-workflow_24.svg"; import { workflowLocalizationRegistry } from "@coremedia/studio-client.workflow-plugin-models/WorkflowLocalizationRegistry"; workflowLocalizationRegistry._.addLocalization("TranslationGlobalLink", { displayName: GccWorkflowLocalization_properties.TranslationGlobalLink_displayName, description: GccWorkflowLocalization_properties.TranslationGlobalLink_description, svgIcon: gccIcon, states: { Translate: GccWorkflowLocalization_properties. TranslationGlobalLink_state_Translate_displayName, DownloadTranslation: GccWorkflowLocalization_properties. TranslationGlobalLink_state_DownloadTranslation_displayName, ReviewDeliveredTranslation: GccWorkflowLocalization_properties. TranslationGlobalLink_state_ReviewDeliveredTranslation_displayName, ReviewCancelledTranslation: GccWorkflowLocalization_properties. TranslationGlobalLink_state_ReviewCancelledTranslation_displayName, ... }, tasks: { Prepare: GccWorkflowLocalization_properties. TranslationGlobalLink_task_Prepare_displayName, AutoMerge: GccWorkflowLocalization_properties. TranslationGlobalLink_task_AutoMerge_displayName, SendTranslationRequest: GccWorkflowLocalization_properties. TranslationGlobalLink_task_SendTranslationRequest_displayName, ... }, }); workflowLocalizationRegistry._.addIssuesLocalization({ dateLiesInPast_globalLinkDueDate: GccWorkflowLocalization_properties. dateLiesInPast_globalLinkDueDate_text, dateInvalid_globalLinkDueDate: GccWorkflowLocalization_properties. dateInvalid_globalLinkDueDate_text, ... });
Example 9.109. Workflow localization example
Display name, description and icon are defined for the workflow. As described earlier in Section 9.26.2, “Workflow Steps”, tasks and state are distinguished. Consequently, they are localized separately. Note that each task and state can also be localized with a separate display name and description instead of just with a string.
The example also shows that issues are localized with the workflowLocalizationRegistry
as well.