Fixed display of default source and target language, updated README for installation instructions

This commit is contained in:
pascalyazid committed 2026-03-12 07:58:44 +00:00
1 parent f90ec06a4f
commit 2753b07b09
6 files changed
+132 -12

No files matched your search

+5 -8
View File
@@ -3,13 +3,13 @@ import { useLanguages } from "~/composables/useLanguages";
interface Props {
label?: string;
modelValue: string;
modelValue?: string;
}
const props = defineProps<Props>();
const emit = defineEmits<{
(e: "update:modelValue", value: string): void;
}>();
const model = defineModel<string>({ default: 'en' });
const { languages } = useLanguages();
</script>
@@ -21,10 +21,7 @@ const { languages } = useLanguages();
</label>
<select
class="language-selector-input select"
:value="props.modelValue"
@change="
emit('update:modelValue', ($event.target as HTMLSelectElement).value)
"
v-model="model"
>
<option v-for="lang in languages" :key="lang.code" :value="lang.code">
{{ lang.name }}
+2 -2
View File
@@ -3,9 +3,9 @@ import { useToast } from "~/composables/useToast";
interface Props {
label?: string;
text: string;
text: string | null;
loading?: boolean;
error?: string;
error?: string | null;
}
const props = defineProps<Props>();
+6 -1
View File
@@ -29,8 +29,12 @@ function detectBrowserLanguage(): string {
}
const detectedLang = detectBrowserLanguage();
const defaultSource = detectedLang;
const defaultTarget = detectedLang === "en" ? "es" : "en";
var defaultTarget = "en"
if(detectedLang == "en") {
defaultTarget = "es";
}
export function useTranslation(options: UseTranslationOptions = {}) {
const sourceText = ref("");
@@ -96,6 +100,7 @@ export function useTranslation(options: UseTranslationOptions = {}) {
options: {
onChunk?: (chunk: string) => void;
onComplete?: (fullText: string) => void;
model?: Ref<string>;
} = {},
) {
if (!isReadyToTranslate.value) {
-1
View File
@@ -18,7 +18,6 @@ const {
swapLanguages,
clearInput,
} = useTranslation({ model });
const { status, isReady, errorMessage, checkStatus } = useOllamaStatus();
function handleTranslate() {