-
Notifications
You must be signed in to change notification settings - Fork 111
feat: add translation feature documentation #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
204d83a
fix: add translation feature documetation
jainpawan21 32ca981
fix: add translations link on build a workflow page
jainpawan21 c8b8a7c
fix: add code rabbit suggestions
jainpawan21 29610f9
fix: add suggestions
jainpawan21 bbdb431
fix: add master json and export/import info
jainpawan21 e3289d9
fix: add nested key example
jainpawan21 9a56a7e
fix: back tick
jainpawan21 e3da18e
fix: code rabbit suggestions
jainpawan21 6a96433
fix: add victor's suggestions
jainpawan21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| --- | ||
| title: 'Translations' | ||
| description: 'Learn how to translate your workflow step content into multiple languages' | ||
| icon: 'Languages' | ||
| --- | ||
|
|
||
| ## Workflow translations | ||
jainpawan21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Novu supports multi-language translations for workflows, allowing your notifications to dynamically adapt to your users' preferred language. This documentation covers everything you need to know to enable, configure, and manage translations for your workflows. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <Callout type="info"> | ||
| Translations feature is currently in `beta` and is available for `Team` and `Enterprise` plans. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </Callout> | ||
|
|
||
| ## Introduction | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Workflow translation allows each notification workflow (e.g., onboarding, password reset, OTP, etc.) to support multiple locales. When a subscriber (user) receives a notification, Novu selects the appropriate translation based on the subscriber’s locale. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This feature helps teams: | ||
|
|
||
| - Reach users in their native language. | ||
| - Customize language per workflow or layout. | ||
| - Reduce friction in communication across geographies. | ||
|
|
||
| Translations can be managed on the [translation page](https://dashboard.novu.co/translations) on Novu dashboard. Select the default language and add the target languages you wish to support. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| ## Enabling translations | ||
|
|
||
| 1. **While creating a new workflow** | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - Check the **Enable Translations** toggle. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Set the default locale (e.g., `en_US`). | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Add target locales you wish to support (e.g., `fr_FR`, `es_ES`, `jp_JP`, etc.). | ||
|
|
||
| 2. **While editing an existing workflow** | ||
|
|
||
| - Open an existing workflow. | ||
| - Click the **Enable Translations** option in the right panel | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Enable the toggle if not already enabled. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Default and targeted locales can be configured on the translation page. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| ## Translation Groups | ||
| A translation group contains all language variants for a workflow identified by a unique workflow ID. | ||
|
|
||
| You can: | ||
|
|
||
| - Search for groups on the **Translations** page. | ||
| - View status per locale ('Outdated' or 'Up to date'). | ||
| - Import or export translations for a specific locale (e.g., `en_US`). | ||
| - Import or export translations for all workflows where translations are enabled. | ||
|
|
||
| ## Translation JSON format | ||
jainpawan21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Each locale supports JSON-based translation files. For example, `en_US.json` file contains the default translations for the workflow. Translation json files can be updated using JSON editor on the translation page. | ||
|
|
||
| ```json | ||
| { | ||
| "in-app": { | ||
| "title": "Welcome to Novu!", | ||
| "message": "Hi {{subscriber.firstName}}, let's get started!" | ||
| }, | ||
| "email": { | ||
| "subject": "Get Started", | ||
| "body": "Thank you for joining us, {{subscriber.fullName}}" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| You can export and re-upload these JSON files when translation updates are needed or use the JSON editor on the translation page to update the translations. | ||
|
|
||
|  | ||
|
|
||
| ### Exporting and importing translations | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### Export | ||
|
|
||
| - Navigate to the Translations section. | ||
| - Click **Export en_US.json** to download the latest default file. | ||
| - Use this as a base for other translations. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### Import | ||
|
|
||
| - Click **Import locale(s)**. | ||
| - Upload JSON files (e.g., fr_FR.json, es_ES.json). | ||
| - Novu detects the locale automatically. | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 💡 Translation changes in default locale (e.g., en_US) will mark other locales as *Outdated, needs update* | ||
|
|
||
| ## Using translation keys in step content editor | ||
|
|
||
| In Email or In-App editors, use `{{t.key}}` to insert a translatable string. if key is already added in the locale, it will be in the suggestions list. | ||
|
|
||
| Clicking **Add to Translations** automatically adds a new key to default locale. | ||
|
|
||
| Example: | ||
|
|
||
| ```html | ||
| {{t.subject}} → "Let's get you started" | ||
jainpawan21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
|  | ||
|
|
||
| ## Testing translations | ||
|
|
||
| Use the Preview Context to: | ||
|
|
||
| - Simulate subscriber locale (e.g., fr_FR or ru_RU). | ||
| - Preview step content for the selected language. | ||
| - Update or correct missing translations on the fly. | ||
|
|
||
| ## Keeping translations up to date | ||
|
|
||
| Any edit to the default locale will invalidate others. You’ll see a warning: `Outdated, needs update`. Re-export the default, update translated files, and re-upload. | ||
|
|
||
| ## Disabling Translations | ||
|
|
||
| A translation group can be disabled by clicking on the three dots and selecting **Disable & delete translations**. This action is irreversible and removes all associated translation data. | ||
|
|
||
| ## Translation in Layouts | ||
jainpawan21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This feature is currently in work in progress. If you are looking to use translation in email layouts, react out to us at [email protected] | ||
|
|
||
|
|
||
| ## Best practices | ||
|
|
||
| - Always finalize your default content before exporting. | ||
| - Avoid hardcoded language in the content editor. | ||
| - Use variables and translation keys consistently. | ||
| - Set subscriber locale properly to deliver notifications in the correct language. | ||
|
|
||
Binary file added
BIN
+1.92 MB
...mages/platform/workflow/translations/translations-default-and-target-locale.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.28 MB
public/images/platform/workflow/translations/translations_locale_content_edit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.91 MB
...ges/platform/workflow/translations/translations_variable_use_in_step_editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Uh oh!
There was an error while loading. Please reload this page.