Toggling the Language on a Form From English to Spanish
  • 12 Mar 2021
  • 1 Minute to read
  • Dark
    Light

Toggling the Language on a Form From English to Spanish

  • Dark
    Light

Article summary

Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.


Overview

Example Lab Details

Version6.13.0
Root FolderExample Lab - Toggling Form Language
Modules None
DependenciesNone

This Example Lab Project demonstrates how to dynamically change the language in a Form from English to Spanish.


Explanation

This Example Project uses the label Form components with the "Text from Data Name" checkbox selected in the properties panel. This allows the data that's passed to the label to be created using Data Flows and changed without the need for another label to be displayed.

When the Form is first run the labels are populated in English by running the "Populate Labels in English" Flow. This Flow is very simple, the only edits that were done to the Flow are the start step was connected to the end step and the outputs were all set to the constant type. Here the user can enter the original Engish text that is desired to be displayed in the Form. Once the "En Espanol?" box is checked the second Data Flow named "Update Label Language" is run. This Flow has a Rule which executes as true if the button is checked when the Flow was initiated. The true path of the rule uses a Create Data step to create a new output for each label with the Spanish translation.

If the rule returns false another Create Data step is used to output the original English text values again. The Rule in this Flow is necessary because without it the user would be unable to toggle back to English once they toggled to Spanish for the first time. This is because the "Update Label Language" Flow is run every time the checkbox value is changed, therefore without the rule to verify the status of the checkbox the labels would simply be populated with the same Spanish text each time the Flow ran.

Reference Articles


Project Download

The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.13.0 or later using our Importing/Exporting article.





Was this article helpful?