mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
[i18n] Use folder mode for locale (#1876)
* [i18n] Use folder mode for locale * try pipe
This commit is contained in:
3
.github/workflows/i18n.yaml
vendored
3
.github/workflows/i18n.yaml
vendored
@@ -22,7 +22,8 @@ jobs:
|
||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Update translations
|
||||
run: npm run locale
|
||||
# Pipe output so that it doesn't error out on stdout.clearLine
|
||||
run: npm run locale 2>&1 | cat
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
working-directory: ComfyUI_frontend
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
const { defineConfig } = require('@lobehub/i18n-cli');
|
||||
|
||||
module.exports = defineConfig({
|
||||
entry: 'src/locales/en.json',
|
||||
entry: 'src/locales/en',
|
||||
entryLocale: 'en',
|
||||
output: 'src/locales',
|
||||
outputLocales: ['zh', 'ru', 'ja', 'ko'],
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { ComfyCommandImpl } from '../src/stores/commandStore'
|
||||
import type { FormItem, SettingParams } from '../src/types/settingTypes'
|
||||
import type { ComfyApi } from '../src/scripts/api'
|
||||
|
||||
const localePath = './src/locales/en.json'
|
||||
const localePath = './src/locales/en/main.json'
|
||||
const extractMenuCommandLocaleStrings = (): Set<string> => {
|
||||
const labels = new Set<string>()
|
||||
for (const [category, _] of CORE_MENU_COMMANDS) {
|
||||
|
||||
10
src/i18n.ts
10
src/i18n.ts
@@ -1,9 +1,9 @@
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import en from './locales/en.json'
|
||||
import zh from './locales/zh.json'
|
||||
import ru from './locales/ru.json'
|
||||
import ja from './locales/ja.json'
|
||||
import ko from './locales/ko.json'
|
||||
import en from './locales/en/main.json'
|
||||
import zh from './locales/zh/main.json'
|
||||
import ru from './locales/ru/main.json'
|
||||
import ja from './locales/ja/main.json'
|
||||
import ko from './locales/ko/main.json'
|
||||
|
||||
export const i18n = createI18n({
|
||||
// Must set `false`, as Vue I18n Legacy API is for Vue 2
|
||||
|
||||
Reference in New Issue
Block a user