Our project supports multiple languages using vue-i18n
. This allows users around the world to use the application in their preferred language.
- en (English)
- zh (中文)
- ru (Русский)
- ja (日本語)
- ko (한국어)
- fr (Français)
- es (Español)
We welcome the addition of new languages. You can add a new language by following these steps:
We use lobe-i18n as our translation tool, which integrates with LLM for efficient localization.
Update the configuration file to include the new language(s) you wish to add:
const { defineConfig } = require('@lobehub/i18n-cli');
module.exports = defineConfig({
entry: 'src/locales/en.json', // Base language file
entryLocale: 'en',
output: 'src/locales',
outputLocales: ['zh', 'ru', 'ja', 'ko', 'fr', 'es'], // Add the new language(s) here
});
Set your OpenAI API Key by running the following command:
npx lobe-i18n --option
Once configured, generate the translation files with:
npx lobe-i18n locale
This will create the language files for the specified languages in the configuration.
Import the newly generated locale file(s) in the src/i18n.ts
file to include them in the application's i18n setup.
Add the newly added language to the following item in src/constants/coreSettings.ts
:
{
id: 'Comfy.Locale',
name: 'Locale',
type: 'combo',
// Add the new language(s) here
options: [
{ value: 'en', text: 'English' },
{ value: 'zh', text: '中文' },
{ value: 'ru', text: 'Русский' },
{ value: 'ja', text: '日本語' },
{ value: 'ko', text: '한국어' },
{ value: 'fr', text: 'Français' },
{ value: 'es', text: 'Español' }
],
defaultValue: navigator.language.split('-')[0] || 'en'
},
This will make the new language selectable in the application's settings.
Start the development server, switch to the new language, and verify the translations. You can switch languages by opening the ComfyUI Settings and selecting from the ComfyUI > Locale
dropdown box.