(this page was created automatically. In case of formatting issues, please visit the official Wiki Page)

Translation Textarea

The  Translation Textarea Component is a specialized form control that allows users to enter and manage multi-line localized text content in multiple languages. This component provides a user-friendly interface for creating and editing lengthy multilingual content with integrated language selection capabilities. It's particularly useful for internationalization scenarios where longer text values need to be maintained in different languages, such as descriptions, instructions, terms and conditions, or any user-facing content that requires localization.

Properties

General Properties

  • displayName - Sets the display name of the component shown in the structure panel. For example, "Product Description Translations" allows for easy identification of the component's purpose in the application structure, making it easier for developers and content editors to locate this specific translation textarea field.

Visual Properties

  • labelTranslations - Sets the label text displayed above the textarea field, with support for multiple languages. For example, {"en-US": "Enter Product Description", "de-DE": "Produktbeschreibung eingeben"} ensures proper localization of the field label based on the user's language settings.

  • rows - Sets the number of visible text rows in the textarea. This determines the initial height of the input area, allowing for appropriate sizing based on expected content length. For example, setting to "10" creates a taller textarea suitable for longer descriptions, while "3" would be more compact for shorter translations.

  • maxLength - Sets the maximum number of characters allowed in the textarea for each language. This helps enforce content length restrictions and provides visual feedback to users about their remaining character count. For example, setting to "1000" limits each language translation to 1000 characters, which is useful for ensuring translations don't exceed space constraints.

  • hidden - Controls whether the component is visible in the form. When set to true, the component remains in the form structure but is not displayed, which is useful for conditional translation fields that should only appear in specific scenarios.

  • saveInLocalStorage - Determines whether the component's entered translations are preserved in local storage between sessions. When enabled, translation data persists between page reloads, improving user experience for complex multilingual forms that may take time to complete.

  • defaultValue - Sets the initial translation values that will be used when the form is reset. For example, setting to {"en-US": "Default product description goes here", "de-DE": "Standardproduktbeschreibung geht hier"} would pre-populate these translations when a form is first loaded or reset.

  • readonly - Controls whether the translations can be modified by users. When set to true, the translation textarea displays the existing translations but prevents changes, which is useful for reference-only scenarios or when translations are managed through another system.

  • paddingClass - Configures spacing around the translation textarea component using CSS classes. For example, "p-4" adds medium padding on all sides of the component to improve visual spacing within its container.

Non-Visual Properties

  • dataField - Defines the field name that will be used when submitting form data. For example, setting to "productDescription" ensures the translations are submitted with this field name in the form data object, making it clear what the translations represent on the server side.

  • controlsRequestType - Specifies how the translation data is sent in HTTP requests: 'BODY', 'HEADER', or 'PATH'. For example, setting to "BODY" includes the translations in the request body, which is standard for most form submissions with multilingual data.

Validation Properties

  • validation - Configures validation rules for the translation textarea field. This allows you to set requirements such as mandatory translations for specific languages or character limits. For example, setting required validation ensures that at least one language translation is provided before the form can be submitted.

Authorization Properties

  • authorizationDisable - Specifies a policy set that determines when the component should be disabled based on user permissions. For example, setting to "translatorOnlyPolicy" will disable the translation textarea for users who don't have translation privileges according to the specified policy.

  • visibilityPolicySetId - Determines the visibility of the component based on specified policy sets. For example, setting to "contentEditorsPolicy" restricts the translation textarea visibility to users with content editing privileges.

Visibility Properties

  • displayConditions - Defines conditions for displaying the component. This allows showing or hiding the translation textarea based on complex rules involving other form values, user roles, or application state.

Event Actions Properties

  • events - Configures the events that the component can trigger and respond to:
    • ON_VALUE_CHANGE: Triggered when any translation value changes. Can be used to perform immediate actions based on translation changes, such as updating preview text or validating language-specific content.
    • ON_INIT_BASED_ON_USER_VIEW: Triggered specifically when the component initializes in user view mode rather than edit mode.
    • ON_INIT: Triggered when the translation textarea component is initialized. Can be used to perform setup operations like loading default translations from external sources.
    • ON_DESTROY: Triggered when the component is removed from the DOM. Useful for cleanup operations and releasing resources.

Testing Hooks Properties

  • id - Specifies a unique identifier for the component used for programmatic access. For example, "productDescriptionTranslations" enables targeted manipulation of this specific translation textarea field.

  • dataTestId - Sets the testing hook ID for automated testing. For example, setting to "product-description-translations" allows test scripts to reliably locate this component for automated testing of multilingual content.

  • enableAsHotspot - Enables the component as a guided tour hotspot. When enabled, the translation textarea can be highlighted during onboarding or tutorial flows to explain its multilingual functionality to new users.

  • guidedTourHotSpotTitle - Sets the title for the guided tour hotspot, supporting translations. For example, {"en-US": "Product Description Translations", "de-DE": "Produktbeschreibung Übersetzungen"} provides clear identification during guided tours.

  • guidedTourHotSpotDescription - Sets the description for the guided tour hotspot, supporting translations. For example, {"en-US": "Enter product descriptions in multiple languages", "de-DE": "Geben Sie Produktbeschreibungen in verschiedenen Sprachen ein"} provides detailed instructions during guided tours.

  • No labels