Skip to content

The translation isn't updated in real time when switching languages. It needs a refresh. #5698

@comfyui-wiki

Description

@comfyui-wiki

Problem

Vue node translations don't update in real-time when switching languages in settings - they require a page refresh to display the new language.

Screen.Recording.2025-09-20.at.19.11.16.mov

Root Cause

Vue node components use the global $t() function which isn't reactive to i18n.global.locale.value changes. The locale is updated in GraphView.vue:157 but Vue nodes don't re-render.

Components affected:

Reproduction

  1. Enable Vue nodes (Comfy.VueNodes.Enabled = true)
  2. Open Settings and change language (e.g., English → Chinese)
  3. Observe that Vue node text remains in the original language
  4. Refresh page - translations now update correctly

Solution

Apply the same pattern used in PRs #5184 and #4213 to fix Vue node i18n reactivity. Two approaches:

Option 1: Add locale key to LGraphNode component

<template>
  <div :key="localeKey">
    <\!-- Vue node content -->
  </div>
</template>

<script setup>
const settingStore = useSettingStore()
const localeKey = computed(() => settingStore.get('Comfy.Locale'))
</script>

Option 2: Convert to Composition API

Replace $t() with useI18n() composition API:

<script setup>
const { t } = useI18n()
</script>
<template>
  <div>{{ t('Node Header Error') }}</div>
</template>

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions