Skip to content

Commit

Permalink
[i18n] Use folder mode for locale
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Dec 11, 2024
1 parent 75c98d0 commit 47e724e
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .i18nrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion scripts/collect-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/i18n.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 47e724e

Please sign in to comment.