Route to language page
Function: Route to language page
This action helps you guide your users to the correct language version of a page within your application. If your application supports multiple languages, you can use this action to automatically switch the user's view to a specific language for the page they are currently on.
Input
- Language (Text): The two-letter code (e.g., "en" for English, "es" for Spanish, "fr" for French) of the language you want to switch the page to. This is the primary language you wish to display.
- Default Language (Text): An optional two-letter code for a fallback language. If a page version for the primary "Language" you specified cannot be found, the system will try to redirect to a page in this "Default Language" instead.
Output
The user is redirected to the same page, but displayed in the specified language. If no page exists for the specified language (or default language), an error message will be displayed to the user.
Execution Flow
Real-Life Examples
-
Scenario: User wants to switch to Spanish.
- Inputs:
- Language:
es - Default Language: (empty)
- Language:
- Result: The user is redirected to the Spanish version of the current page.
- Inputs:
-
Scenario: User wants to switch to French, but no French page exists. Fallback to English.
- Inputs:
- Language:
fr - Default Language:
en
- Language:
- Result: The system first tries to find a French version of the page. Since it doesn't exist, it falls back and redirects the user to the English version of the current page.
- Inputs:
-
Scenario: User wants to switch to German, but neither a German nor a default English page exists.
- Inputs:
- Language:
de - Default Language:
en
- Language:
- Result: The system tries to find a German page, fails. Then it tries to find an English page, fails. An error message is displayed to the user, indicating that a German or English version of the page could not be found.
- Inputs: