feat(MiniCalendarWidget): enhance localization and refactor calendar logic
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
- Updated the MiniCalendarWidget to utilize localized strings for month names, weekdays, and loading messages, improving user experience across multiple languages. - Refactored the calendar logic to use constants for month keys and weekday order, ensuring consistency with backend configurations. - Added new translation entries for the mini widget in Cebuano, German, English, Spanish, and French, enhancing accessibility for users.
This commit is contained in:
@@ -29,18 +29,17 @@
|
||||
</label>
|
||||
|
||||
<div class="language-assistant-settings__presets">
|
||||
<p class="language-assistant-settings__presets-title">Schnellstart (1-Klick)</p>
|
||||
<p class="language-assistant-settings__presets-title">{{ $t('settings.languageAssistant.presetsTitle') }}</p>
|
||||
<div class="language-assistant-settings__preset-actions">
|
||||
<button type="button" class="preset-btn" @click="applyOllamaPreset">
|
||||
Kostenlos lokal (Ollama)
|
||||
{{ $t('settings.languageAssistant.presetOllama') }}
|
||||
</button>
|
||||
<button type="button" class="preset-btn preset-btn--secondary" @click="applyOpenAiPreset">
|
||||
Standard (OpenAI-kompatibel)
|
||||
{{ $t('settings.languageAssistant.presetOpenAi') }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="language-assistant-settings__preset-hint">
|
||||
Der Ollama-Preset setzt <code>http://127.0.0.1:11434/v1</code> und
|
||||
<code>qwen2.5:3b-instruct</code>. Kein API-Key erforderlich.
|
||||
{{ $t('settings.languageAssistant.presetHintBefore') }}<code>{{ ollamaPresetBaseUrl }}</code>{{ $t('settings.languageAssistant.presetHintBetween') }}<code>{{ ollamaPresetModel }}</code>{{ $t('settings.languageAssistant.presetHintAfter') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +55,7 @@
|
||||
</label>
|
||||
<label class="language-assistant-settings__field">
|
||||
<span>{{ $t('settings.languageAssistant.model') }}</span>
|
||||
<input v-model="form.model" type="text" autocomplete="off" placeholder="gpt-4o-mini" />
|
||||
<input v-model="form.model" type="text" autocomplete="off" :placeholder="$t('settings.languageAssistant.modelPlaceholder')" />
|
||||
</label>
|
||||
<label class="language-assistant-settings__field language-assistant-settings__field--full">
|
||||
<span>{{ $t('settings.languageAssistant.apiKey') }}</span>
|
||||
@@ -90,6 +89,10 @@ import apiClient from '@/utils/axios.js';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { showApiError, showError, showSuccess } from '@/utils/feedback.js';
|
||||
|
||||
const OLLAMA_DEFAULT_BASE_URL = 'http://127.0.0.1:11434/v1';
|
||||
const OLLAMA_DEFAULT_MODEL = 'qwen2.5:3b-instruct';
|
||||
const DEFAULT_OPENAI_MODEL = 'gpt-4o-mini';
|
||||
|
||||
export default {
|
||||
name: 'LanguageAssistantSettingsView',
|
||||
data() {
|
||||
@@ -110,6 +113,12 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['user']),
|
||||
ollamaPresetBaseUrl() {
|
||||
return OLLAMA_DEFAULT_BASE_URL;
|
||||
},
|
||||
ollamaPresetModel() {
|
||||
return OLLAMA_DEFAULT_MODEL;
|
||||
},
|
||||
apiKeyPlaceholder() {
|
||||
if (this.form.clearKey) {
|
||||
return this.$t('settings.languageAssistant.apiKeyPlaceholderClear');
|
||||
@@ -136,15 +145,15 @@ export default {
|
||||
methods: {
|
||||
applyOllamaPreset() {
|
||||
this.form.enabled = true;
|
||||
this.form.baseUrl = 'http://127.0.0.1:11434/v1';
|
||||
this.form.model = 'qwen2.5:3b-instruct';
|
||||
this.form.baseUrl = OLLAMA_DEFAULT_BASE_URL;
|
||||
this.form.model = OLLAMA_DEFAULT_MODEL;
|
||||
this.form.apiKey = '';
|
||||
this.form.clearKey = false;
|
||||
},
|
||||
applyOpenAiPreset() {
|
||||
this.form.enabled = true;
|
||||
this.form.baseUrl = '';
|
||||
this.form.model = 'gpt-4o-mini';
|
||||
this.form.model = DEFAULT_OPENAI_MODEL;
|
||||
this.form.clearKey = false;
|
||||
},
|
||||
async load() {
|
||||
@@ -153,7 +162,7 @@ export default {
|
||||
const { data } = await apiClient.get('/api/settings/llm');
|
||||
this.form.enabled = data.enabled !== false;
|
||||
this.form.baseUrl = data.baseUrl || '';
|
||||
this.form.model = data.model || 'gpt-4o-mini';
|
||||
this.form.model = data.model || DEFAULT_OPENAI_MODEL;
|
||||
this.hasKey = data.hasKey;
|
||||
this.keyLast4 = data.keyLast4;
|
||||
this.keyStatus = data.keyStatus || (data.hasKey ? 'stored' : 'missing');
|
||||
|
||||
Reference in New Issue
Block a user