Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate control before/after generate labels #2690

Merged
merged 3 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
"success": "Success",
"ok": "OK",
"feedback": "Feedback",
"continue": "Continue"
"continue": "Continue",
"control_after_generate": "control after generate",
"control_before_generate": "control before generate"
},
"issueReport": {
"submitErrorReport": "Submit Error Report (Optional)",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"command": "Commande",
"confirm": "Confirmer",
"continue": "Continuer",
"control_after_generate": "contrôle après génération",
"control_before_generate": "contrôle avant génération",
"copyToClipboard": "Copier dans le presse-papiers",
"currentUser": "Utilisateur actuel",
"customize": "Personnaliser",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"command": "コマンド",
"confirm": "確認",
"continue": "続ける",
"control_after_generate": "生成後の制御",
"control_before_generate": "生成前の制御",
"copyToClipboard": "クリップボードにコピー",
"currentUser": "現在のユーザー",
"customize": "カスタマイズ",
Expand Down
14 changes: 12 additions & 2 deletions src/locales/ko/main.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"0": "{",
"clipboard": {
"errorMessage": "클립보드에 복사하지 못했습니다",
"errorNotSupported": "브라우저가 클립보드 API를 지원하지 않습니다.",
"successMessage": "클립보드에 복사됨"
},
"color": {
"black": "검정색",
"blue": "파란색",
"brown": "갈색",
"custom": "사용자 정의",
"cyan": "청록색",
"default": "기본값",
"green": "초록색",
"noColor": "색 없음",
"pale_blue": "흐린 파랑색",
"pink": "분홍색",
"purple": "보라색",
"red": "빨간색",
"yellow": "노란색"
},
Expand Down Expand Up @@ -119,6 +124,8 @@
"command": "명령",
"confirm": "확인",
"continue": "계속",
"control_after_generate": "생성 후 제어",
"control_before_generate": "생성 전 제어",
"copyToClipboard": "클립보드에 복사",
"currentUser": "현재 사용자",
"customize": "사용자 정의",
Expand Down Expand Up @@ -316,9 +323,12 @@
"backgroundColor": "배경색",
"fov": "FOV",
"lightIntensity": "조명 강도",
"loadingModel": "3D 모델 로딩 중...",
"previewOutput": "출력 미리보기",
"removeBackgroundImage": "배경 이미지 제거",
"showGrid": "그리드 표시",
"switchCamera": "카메라 전환"
"switchCamera": "카메라 전환",
"uploadBackgroundImage": "배경 이미지 업로드"
},
"maintenance": {
"None": "없음",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"command": "Команда",
"confirm": "Подтвердить",
"continue": "Продолжить",
"control_after_generate": "управление после генерации",
"control_before_generate": "управление до генерации",
"copyToClipboard": "Скопировать в буфер обмена",
"currentUser": "Текущий пользователь",
"customize": "Настроить",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/zh/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"command": "指令",
"confirm": "确认",
"continue": "继续",
"control_after_generate": "生成后控制",
"control_before_generate": "生成前控制",
"copyToClipboard": "复制到剪贴板",
"currentUser": "当前用户",
"customize": "自定义",
Expand Down
8 changes: 4 additions & 4 deletions src/scripts/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useIntWidget } from '@/composables/widgets/useIntWidget'
import { useMarkdownWidget } from '@/composables/widgets/useMarkdownWidget'
import { useSeedWidget } from '@/composables/widgets/useSeedWidget'
import { useStringWidget } from '@/composables/widgets/useStringWidget'
import { t } from '@/i18n'
import { useSettingStore } from '@/stores/settingStore'
import type { InputSpec } from '@/types/apiTypes'

Expand All @@ -32,12 +33,11 @@ function controlValueRunBefore() {
}

export function updateControlWidgetLabel(widget: IWidget) {
let replacement = 'after'
let find = 'before'
if (controlValueRunBefore()) {
;[find, replacement] = [replacement, find]
widget.label = t('g.control_before_generate')
} else {
widget.label = t('g.control_after_generate')
}
widget.label = (widget.label ?? widget.name ?? '').replace(find, replacement)
}

export const IS_CONTROL_WIDGET = Symbol()
Expand Down