mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-07 22:40:14 -03:00
fix(filter): apply preset on full tile click and suppress i18n double-translate warnings
- Move preset apply handler from span.preset-name to div.filter-preset so clicking anywhere on the tile triggers the preset, not just the label text. - Add whitespace heuristic in showToast() to skip translate() for plain messages that are already translated at the call site. This prevents i18next from logging 'Translation key not found' for pre-translated strings like 'Preset "name" applied'.
This commit is contained in:
@@ -134,7 +134,10 @@ export async function copyToClipboard(text, successMessage = null) {
|
||||
}
|
||||
|
||||
export function showToast(key, params = {}, type = 'info', fallback = null) {
|
||||
const message = translate(key, params, fallback);
|
||||
// Plain messages (contain spaces) are not i18n dot-notation keys — use verbatim
|
||||
// to avoid spurious "Translation key not found" warnings from i18next
|
||||
const isPlainMessage = typeof key === 'string' && /\s/.test(key);
|
||||
const message = isPlainMessage ? key : translate(key, params, fallback);
|
||||
const toast = document.createElement('div');
|
||||
toast.className = `toast toast-${type}`;
|
||||
toast.textContent = message;
|
||||
|
||||
Reference in New Issue
Block a user