[i18n] Use folder mode for locale (#1876)

* [i18n] Use folder mode for locale

* try pipe
This commit is contained in:
Chenlei Hu
2024-12-11 11:29:52 -08:00
committed by GitHub
parent 929e3a5733
commit 0c511d08e6
9 changed files with 9 additions and 8 deletions

View File

@@ -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

View File

@@ -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'],

View File

@@ -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) {

View File

@@ -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