Skip to content

feat(ui): added support for internationalization (i18n) in the UI#6252

Open
HackZers7 wants to merge 50 commits intoFlowiseAI:mainfrom
HackZers7:feature/i18n
Open

feat(ui): added support for internationalization (i18n) in the UI#6252
HackZers7 wants to merge 50 commits intoFlowiseAI:mainfrom
HackZers7:feature/i18n

Conversation

@HackZers7
Copy link
Copy Markdown

This PR introduces UI internationalization (i18n) support across the Flowise frontend.

What was added

  • Added English locale resources in packages/ui/public/locales/en.json.
  • Added a basic UI language switcher and related language utilities.
  • Added i18n support across a large set of UI areas (auth, canvas, chatflows/chat messages, credentials, datasets, doc store, evaluators/evaluations, files, organization/roles/users/workspace, tools, settings, etc.).

Current limitation

At this stage, localization support is implemented only at the UI layer.
It currently does not take into data coming from backend entities (e.g. server, components).
Support for backend-driven/localizable server-component data is planned for upcoming iterations.

Related to #2233

= and others added 30 commits April 20, 2026 09:39
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces internationalization (i18n) support across the UI components and views by replacing hardcoded strings with translation keys using react-i18next. While the overall approach is correct, several issues were identified: missing t function scope in utility files, incorrect i18n keys due to copy-paste errors, typos in key names, and invalid usage of React components within string literals in configuration files. I have provided feedback to address these issues, including suggestions for using i18next.t() in utility functions and correcting the key references.

Comment thread packages/ui/src/utils/genericHelper.js Outdated
for (const item of parsedValue) {
if (!item.variable) {
alert('Please specify a Variable. Try connecting Condition node to a previous node and select the variable')
alert(t('errors.specifyVariable'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The variable t is not defined in the scope of getCustomConditionOutputs. Since i18next is imported at the top of the file, you should use i18next.t() instead. This issue occurs multiple times in this function (lines 1108, 1112, 1116, 1129, 1130).

Suggested change
alert(t('errors.specifyVariable'))
alert(i18next.t('errors.specifyVariable'))

@@ -1161,7 +1160,7 @@ export const getCustomConditionOutputs = (value, nodeId, existingEdges, isDataGr
}
const newOutput = {
name: 'output',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The variable t is not defined here. Use i18next.t() instead.

Suggested change
name: 'output',
label: i18next.t('common.labels.output'),

const renderFullfilledConditions = (conditions) => {
const fullfilledConditions = conditions.filter((condition) => condition.isFulfilled)
return fullfilledConditions.map((condition, index) => {
return fulfilledConditions.map((condition, index) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

ReferenceError: fulfilledConditions is not defined. This is a typo, as the variable is defined as fullfilledConditions (with two 'l's) on line 204. Please ensure the variable names match.

Suggested change
return fulfilledConditions.map((condition, index) => {
return fullfilledConditions.map((condition, index) => {

Comment on lines +165 to +170
{ id: 301, name: 'components.dialogs.promptLangsmithHub.langs.chinese' },
{ id: 302, name: 'components.dialogs.promptLangsmithHub.langs.english' },
{ id: 303, name: 'components.dialogs.promptLangsmithHub.langs.french' },
{ id: 304, name: 'components.dialogs.promptLangsmithHub.langs.german' },
{ id: 305, name: 'components.dialogs.promptLangsmithHub.langs.russian' },
{ id: 306, name: 'components.dialogs.promptLangsmithHub.langs.spanish' }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The name properties in the languages array are assigned string literals of i18n keys instead of being translated via the t() function. This will cause the raw keys to be displayed in the UI.

Suggested change
{ id: 301, name: 'components.dialogs.promptLangsmithHub.langs.chinese' },
{ id: 302, name: 'components.dialogs.promptLangsmithHub.langs.english' },
{ id: 303, name: 'components.dialogs.promptLangsmithHub.langs.french' },
{ id: 304, name: 'components.dialogs.promptLangsmithHub.langs.german' },
{ id: 305, name: 'components.dialogs.promptLangsmithHub.langs.russian' },
{ id: 306, name: 'components.dialogs.promptLangsmithHub.langs.spanish' }
{ id: 301, name: t('components.dialogs.promptLangsmithHub.langs.chinese') },
{ id: 302, name: t('components.dialogs.promptLangsmithHub.langs.english') },
{ id: 303, name: t('components.dialogs.promptLangsmithHub.langs.french') },
{ id: 304, name: t('components.dialogs.promptLangsmithHub.langs.german') },
{ id: 305, name: t('components.dialogs.promptLangsmithHub.langs.russian') },
{ id: 306, name: t('components.dialogs.promptLangsmithHub.langs.spanish') }

Comment on lines +21 to +23
description: `<Trans i18nKey='assistants.cards.customAssistant.agentFlow.bufferMemory.inputs.sessionId.description' components={{
a: <a href="https://docs.flowiseai.com/memory#ui-and-embedded-chat" target="_blank" />
}} />`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The description field is set to a string literal containing a <Trans> component. This will not work as expected because the consumer of this data likely expects a plain string or HTML, and won't execute the React component inside the string. Additionally, using JSX syntax in a .js file (like the <a> tag on line 22) may cause build errors. Use the t() function provided as an argument to the toolAgentFlow function to retrieve the translated string directly.

                            description: t('assistants.cards.customAssistant.agentFlow.bufferMemory.inputs.sessionId.description'),

Comment on lines +183 to +185
description: `<Trans i18nKey='assistants.cards.customAssistant.agentFlow.chatOpenAI.inputs.allowImageUploads.description' components={{
a: <a href="https://docs.flowiseai.com/using-flowise/uploads#image" target="_blank" />
}} />`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the previous issue, the description field here is set to a string containing a <Trans> component and JSX tags, which is invalid for a data structure and may cause build errors in a .js file. Use t() to retrieve the translated string.

                            description: t('assistants.cards.customAssistant.agentFlow.chatOpenAI.inputs.allowImageUploads.description'),

{
id: 'viewLeads',
title: 'View Leads',
title: 'menu.viewMessages',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The i18n key for the "View Leads" menu item is incorrectly set to menu.viewMessages. It should be menu.viewLeads to correctly reflect the item's purpose and maintain consistency with other menu configuration files.

Suggested change
title: 'menu.viewMessages',
title: 'menu.viewLeads',

? `Please fill in the following required fields: ${missingFields.join(', ')}`
: 'Please fill in all mandatory fields for the selected model.'
? t('components.dialogs.agentFlows.messages.errors.fields.fillFields', { fields: missingFields.join(', ') })
: t('components.dialogs.agentFlows.messages.errors.fields.fillFIeldsForModel')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in the i18n key fillFIeldsForModel (capital 'I'). It should be fillFieldsForModel to match standard camelCase naming conventions used elsewhere in the project.

Suggested change
: t('components.dialogs.agentFlows.messages.errors.fields.fillFIeldsForModel')
: t('components.dialogs.agentFlows.messages.errors.fields.fillFieldsForModel')

>
<DialogTitle sx={{ fontSize: '1rem' }} id='alert-dialog-title'>
{dialogProps.title || 'Allowed Domains'}
{dialogProps.title || t('components.allowedDomains.title')}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fallback i18n key components.allowedDomains.title appears to be a copy-paste error in ChatFeedbackDialog.jsx. It should be updated to a key relevant to chat feedback.

Suggested change
{dialogProps.title || t('components.allowedDomains.title')}
{dialogProps.title || t('components.chatFeedback.title')}

>
<DialogTitle sx={{ fontSize: '1rem' }} id='alert-dialog-title'>
{dialogProps.title || 'Allowed Domains'}
{dialogProps.title || t('components.allowedDomains.title')}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fallback i18n key components.allowedDomains.title is used here, which seems to be a copy-paste error. It should be replaced with a key appropriate for the Speech to Text dialog.

Suggested change
{dialogProps.title || t('components.allowedDomains.title')}
{dialogProps.title || t('components.speechToText.title')}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant