fix: add missed translations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import { onMount, tick } from 'svelte';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
import { RAGTemplate } from '$lib/utils/rag';
|
||||
import { LITELLM_API_BASE_URL, OPENAI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
let loaded = false;
|
||||
|
||||
let stopResponseFlag = false;
|
||||
@@ -172,7 +174,7 @@
|
||||
console.log('submitPrompt', $chatId);
|
||||
|
||||
if (selectedModels.includes('')) {
|
||||
toast.error('Model not selected');
|
||||
toast.error($i18n.t('Model not selected'));
|
||||
} else if (messages.length != 0 && messages.at(-1).done != true) {
|
||||
// Response not done
|
||||
console.log('wait');
|
||||
@@ -330,7 +332,7 @@
|
||||
await sendPromptOllama(model, prompt, responseMessageId, _chatId);
|
||||
}
|
||||
} else {
|
||||
toast.error(`Model ${modelId} not found`);
|
||||
toast.error($i18n.t(`Model {{modelId}} not found`, { modelId }));
|
||||
}
|
||||
})
|
||||
);
|
||||
@@ -524,12 +526,18 @@
|
||||
responseMessage.content = error.error;
|
||||
}
|
||||
} else {
|
||||
toast.error(`Uh-oh! There was an issue connecting to Ollama.`);
|
||||
responseMessage.content = `Uh-oh! There was an issue connecting to Ollama.`;
|
||||
toast.error(
|
||||
$i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: 'Ollama' })
|
||||
);
|
||||
responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {
|
||||
provider: 'Ollama'
|
||||
});
|
||||
}
|
||||
|
||||
responseMessage.error = true;
|
||||
responseMessage.content = `Uh-oh! There was an issue connecting to Ollama.`;
|
||||
responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {
|
||||
provider: 'Ollama'
|
||||
});
|
||||
responseMessage.done = true;
|
||||
messages = messages;
|
||||
}
|
||||
@@ -691,12 +699,18 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toast.error(`Uh-oh! There was an issue connecting to ${model}.`);
|
||||
responseMessage.content = `Uh-oh! There was an issue connecting to ${model}.`;
|
||||
toast.error(
|
||||
$i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: model })
|
||||
);
|
||||
responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {
|
||||
provider: model
|
||||
});
|
||||
}
|
||||
|
||||
responseMessage.error = true;
|
||||
responseMessage.content = `Uh-oh! There was an issue connecting to ${model}.`;
|
||||
responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {
|
||||
provider: model
|
||||
});
|
||||
responseMessage.done = true;
|
||||
messages = messages;
|
||||
}
|
||||
@@ -746,7 +760,7 @@
|
||||
);
|
||||
}
|
||||
} else {
|
||||
toast.error(`Model ${modelId} not found`);
|
||||
toast.error($i18n.t(`Model {{modelId}} not found`, { modelId }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user