Compare commits

...

2 Commits

10 changed files with 111 additions and 161 deletions

View File

@@ -0,0 +1,34 @@
The scan feature searches for available AI models for your configured provider
> **Note:** Results depend on your API key permissions. The provider must support the OpenAI API format.
### Key Points
- Only public models are shown by default
- Try again if no models are found
### Model Tiers
Not all models are suitable for every task:
- **Nano** - Fastest, good for simple tasks like translations
- **Mini** - Balanced speed and capability
- **Small** - Good for most tasks
- **Medium** - More capable, recommended for execise and vocabulary generation
- **Large** - Most capable, mostly paid, best results
## Tips for Success
1. **Verify your API key** is active and has correct permissions
2. Choose a capable model that supports text generation
3. For local providers, make sure your connection and endponts are set up correctly
## Can't Find Your Model?
If your model doesn't appear in the scan results:
1. Check if the model is running locally or accessible via API
2. Verify network connectivity
3. Try adding it manually by entering the model details
> Check the logs in case of validation error

View File

@@ -1,26 +1,23 @@
# Import Vocabulary with AI
# TODO REWRITE
Generate vocabulary lists automatically using AI assistance. Generate vocabulary lists automatically using AI assistance.
## Getting Started ## Getting Started
Use AI to quickly create vocabulary lists from your learning goals. Use AI to quickly create vocabulary lists for a certain topic.
## Step-by-Step Guide
### Step 1: Enter Search Term ### Step 1: Enter Search Term
Type a topic, theme, or concept for your vocabulary list: Type a topic, theme, or concept for your vocabulary list:
- Be specific for better results - Be specific for better results
- Example: "German food and restaurant phrases" - Example: "German food and restaurant phrases"
- Example: "Business vocabulary for meetings" - Example: "Things to do in Paris"
- Example: "Difficult verbs that are confusing"
### Step 2: Select Languages ### Step 2: Select Languages
Choose source and target languages: Choose source and target languages:
- **Source language** - The language you're learning from - **Source language** - The first language of the flashcard
- **Target language** - Your native language - **Target language** - The second language of the flashcard
### Step 3: Set Amount ### Step 3: Set Amount
@@ -33,22 +30,17 @@ Choose how many words to generate:
Tap the generate button: Tap the generate button:
- AI creates the vocabulary list - AI creates the vocabulary list
- Review each entry before saving
- Edit any translations if needed
## After Generation ## After Generation
Once generated, you can: Once generated, you can:
- **Review** - Check each word-translation pair - Choose which terms to keep
- **Edit** - Correct any mistakes - Optionally, add it to a category
- **Delete** - Remove unwanted entries
- **Import All** - Add all to your vocabulary
## Tips ## Tips
> **Pro Tip:** Start with 10 words per import to get familiar with the feature. - In the settings, you can give additional instructions to the AI, like "Use only nouns" or "European Portuguese orthography"
- Start with a small number of items to see how many words your AI can generate.
--- - Check the logs in the settings in case of failure
- Try out different providers and AI models as results can vary greatly
*Need help? Check our vocabulary management guide.*

View File

@@ -1,11 +1,4 @@
# Sorting Vocabulary After you imported vocabulary, you can sort vocabulary
# TODO REWRITE
Learn how to efficiently sort and organize new vocabulary as you add them.
## The Sorting Screen
When you import vocabulary, you'll see the sorting screen where you can:
- Review each word-translation pair - Review each word-translation pair
- Decide the next action for each item - Decide the next action for each item
@@ -13,19 +6,17 @@ When you import vocabulary, you'll see the sorting screen where you can:
## Actions ## Actions
### Mark as Learned ### Mark as Learned
Move the word directly to Stage 1: If you already know the word, move the word directly to Stage "Learned". This prevents the word from reappearing in your exercises.
- The word enters your learning queue
- You'll review it according to the learning schedule
### 🗑️ Delete ### Delete
Remove the word entirely: Remove the word entirely:
- Use for duplicates or unwanted entries - Use for duplicates or unwanted entries
- This action is permanent - This action is permanent
### 📝 Edit ### Edit
Tap on any word or translation to edit: Tap on any word or translation to edit:
- Correct typos - Correct typos
@@ -34,18 +25,12 @@ Tap on any word or translation to edit:
## Duplicate Handling ## Duplicate Handling
When duplicates are detected: When duplicates are detected, you can choose how to handle them:
| Icon | Meaning |
|------|---------|
| ⚠️ | Duplicate detected |
| ✅ | Original entry |
| ❌ | Duplicate entry |
**Options for duplicates:** **Options for duplicates:**
- Keep only the original - Keep only the original
- Keep the newer entry - Keep the newer entry
- Keep both (merge) - Keep both (merge): the newer entry will get deleted but all its information (categories) will be added the old item.
- Delete the duplicate - Delete the duplicate
## Helper Features ## Helper Features
@@ -57,17 +42,7 @@ Toggle to automatically strip articles from words:
- "the dog" → "dog" - "the dog" → "dog"
- Useful for cleaner vocabulary lists - Useful for cleaner vocabulary lists
### Quick Actions
Use quick action buttons for bulk operations:
- **Skip All** - Review later
- **Learn All** - Add all to Stage 1
- **Delete Duplicates** - Auto-remove duplicates
## Tips ## Tips
> **Pro Tip:** Review carefully before sorting. Once sorted, you can still edit words in the vocabulary list. You can edit your flashcards at any point in the flashcard itself
---
*For more tips, check our vocabulary management guide.*

View File

@@ -1,79 +1,7 @@
# Vocabulary Progress Tracking
# TODO REWRITE
Monitor your vocabulary learning journey with detailed progress statistics. Monitor your vocabulary learning journey with detailed progress statistics.
## Progress Overview ## Progress Overview
Track your learning with these key metrics: Track your learning with these key metrics:
### Words Learned TODO Rewrite
- Total words added to your vocabulary
- Words currently in each learning stage
- Words marked as fully learned
### Learning Streak
- Days since you started learning
- Current streak count
- Best streak achieved
### Review Statistics
- Words reviewed today
- Accuracy rate per session
- Words due for review
## Progress Tracking Features
### 📊 Dashboard
View your overall progress at a glance:
- Total vocabulary count
- Mastery percentage
- Recent activity summary
### 📈 Statistics
Detailed analytics include:
- Learning rate over time
- Stage distribution
- Accuracy trends
- Time spent studying
### 🎯 Goals
Set and track learning goals:
- Daily word targets
- Weekly review quotas
- Mastery milestones
## Learning Stages Summary
| Stage | Count | Percentage |
|-------|-------|------------|
| New | X | X% |
| Learning | X | X% |
| Mastered | X | X% |
## Review System
The review system helps you:
1. **Prioritize** - Shows words due for review first
2. **Space** - Optimizes review timing for retention
3. **Track** - Records your performance over time
## Customization
Customize your progress tracking:
- **Select metrics** to display on dashboard
- **Set goals** for personalized targets
- **Export data** for external analysis
- **Reset progress** if starting fresh
---
*Keep practicing consistently to see your progress grow!*

View File

@@ -102,8 +102,8 @@ class SettingsRepository(private val context: Context) {
val intervalStage4 = Setting(context.dataStore, PrefKeys.INTERVAL_STAGE_4, 30) val intervalStage4 = Setting(context.dataStore, PrefKeys.INTERVAL_STAGE_4, 30)
val intervalStage5 = Setting(context.dataStore, PrefKeys.INTERVAL_STAGE_5, 60) val intervalStage5 = Setting(context.dataStore, PrefKeys.INTERVAL_STAGE_5, 60)
val intervalLearned = Setting(context.dataStore, PrefKeys.INTERVAL_LEARNED, 90) val intervalLearned = Setting(context.dataStore, PrefKeys.INTERVAL_LEARNED, 90)
val criteriaCorrect = Setting(context.dataStore, PrefKeys.CRITERIA_CORRECT, 3) val criteriaCorrect = Setting(context.dataStore, PrefKeys.CRITERIA_CORRECT, 1)
val criteriaWrong = Setting(context.dataStore, PrefKeys.CRITERIA_WRONG, 2) val criteriaWrong = Setting(context.dataStore, PrefKeys.CRITERIA_WRONG, 1)
val showHints = Setting(context.dataStore, PrefKeys.SHOW_HINTS, true) val showHints = Setting(context.dataStore, PrefKeys.SHOW_HINTS, true)
val experimentalFeatures = Setting(context.dataStore, PrefKeys.EXPERIMENTAL_FEATURES, false) val experimentalFeatures = Setting(context.dataStore, PrefKeys.EXPERIMENTAL_FEATURES, false)
val tryWiktionaryFirst = Setting(context.dataStore, PrefKeys.TRY_WIKTIONARY_FIRST, false) val tryWiktionaryFirst = Setting(context.dataStore, PrefKeys.TRY_WIKTIONARY_FIRST, false)

View File

@@ -117,6 +117,7 @@ class TranslationService(private val context: Context) {
} }
suspend fun translateSentence(sentence: String): Result<TranslationHistoryItem> = withContext(Dispatchers.IO) { suspend fun translateSentence(sentence: String): Result<TranslationHistoryItem> = withContext(Dispatchers.IO) {
val statusMessageService = StatusMessageService
val additionalInstructions = settingsRepository.customPromptTranslation.flow.first() val additionalInstructions = settingsRepository.customPromptTranslation.flow.first()
val selectedSource = languageRepository.loadSelectedSourceLanguage().first() val selectedSource = languageRepository.loadSelectedSourceLanguage().first()
val sourceLangName = selectedSource?.englishName ?: "Auto" val sourceLangName = selectedSource?.englishName ?: "Auto"

View File

@@ -70,15 +70,24 @@ fun LanguageOptionsScreen(
) )
} }
) { paddingValues -> ) { paddingValues ->
Column( LazyColumn(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.padding(paddingValues) .padding(paddingValues)
.padding(16.dp), .padding(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp) verticalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
item {
AppCard { AppCard {
Column(Modifier.padding(16.dp)) { Column(Modifier.padding(16.dp)) {
AppCard(
title = stringResource(R.string.text_select_languages),
text = stringResource(R.string.text_language_settings_description),
expandable = true,
initiallyExpanded = false
) {
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -109,7 +118,10 @@ fun LanguageOptionsScreen(
} }
} }
} }
}
}
item {
PrimaryButton( PrimaryButton(
onClick = { showAddLanguageDialog = true }, onClick = { showAddLanguageDialog = true },
text = stringResource(R.string.text_add_custom_language), text = stringResource(R.string.text_add_custom_language),
@@ -117,9 +129,9 @@ fun LanguageOptionsScreen(
) )
} }
} }
}
if (showAddLanguageDialog) { if (showAddLanguageDialog) {
@Suppress("KotlinConstantConditions")
AddCustomLanguageDialog( AddCustomLanguageDialog(
showDialog = showAddLanguageDialog, showDialog = showAddLanguageDialog,
onDismiss = { showAddLanguageDialog = false }, onDismiss = { showAddLanguageDialog = false },

View File

@@ -47,7 +47,7 @@ fun MainSettingsScreen(
Setting(R.string.settings_title_voice, AppIcons.TextToSpeech, SettingsRoutes.TTS_OPTIONS), Setting(R.string.settings_title_voice, AppIcons.TextToSpeech, SettingsRoutes.TTS_OPTIONS),
Setting(R.string.label_logs, AppIcons.Log, SettingsRoutes.LOGS), Setting(R.string.label_logs, AppIcons.Log, SettingsRoutes.LOGS),
Setting(R.string.label_languages, AppIcons.Language, SettingsRoutes.LANGUAGE_OPTIONS), Setting(R.string.label_languages, AppIcons.Language, SettingsRoutes.LANGUAGE_OPTIONS),
Setting(R.string.hint_settings_title_hints, AppIcons.Info, SettingsRoutes.HINTS_OVERVIEW) //Setting(R.string.hint_settings_title_help, AppIcons.Info, SettingsRoutes.HINTS_OVERVIEW)
), ),
R.string.settings_header_translator to listOf( R.string.settings_header_translator to listOf(

View File

@@ -15,6 +15,7 @@ import eu.gaudian.translator.model.repository.dataStore
import eu.gaudian.translator.model.repository.loadObjectList import eu.gaudian.translator.model.repository.loadObjectList
import eu.gaudian.translator.model.repository.saveObjectList import eu.gaudian.translator.model.repository.saveObjectList
import eu.gaudian.translator.utils.Log import eu.gaudian.translator.utils.Log
import eu.gaudian.translator.utils.StatusMessageService
import eu.gaudian.translator.utils.TextToSpeechHelper import eu.gaudian.translator.utils.TextToSpeechHelper
import eu.gaudian.translator.utils.TranslationService import eu.gaudian.translator.utils.TranslationService
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
@@ -31,6 +32,9 @@ class TranslationViewModel @Inject constructor(
val languageRepository: LanguageRepository val languageRepository: LanguageRepository
) : AndroidViewModel(application) { ) : AndroidViewModel(application) {
private val statusMessageService = StatusMessageService
// For back/forward navigation of history in the UI (like editors) // For back/forward navigation of history in the UI (like editors)
private val _historyCursor = MutableStateFlow(-1) private val _historyCursor = MutableStateFlow(-1)
@@ -112,11 +116,13 @@ class TranslationViewModel @Inject constructor(
fun translateSentence(sentence: String) { fun translateSentence(sentence: String) {
val sentenceToTranslate = sentence.ifEmpty { _inputText.value } val sentenceToTranslate = sentence.ifEmpty { _inputText.value }
if (sentenceToTranslate.isBlank()) { if (sentenceToTranslate.isBlank()) {
statusMessageService.showSimpleMessage("Please enter a sentence to translate.")
return return
} }
if (selectedTranslationModel.value == null) { if (selectedTranslationModel.value == null) {
Log.e("TranslationViewModel", "Cannot translate because no model is selected.") Log.e("TranslationViewModel", "Cannot translate because no model is selected.")
statusMessageService.showSimpleMessage("Cannot translate because no model is selected.")
return return
} }
@@ -151,6 +157,7 @@ class TranslationViewModel @Inject constructor(
} }
.onFailure { exception -> .onFailure { exception ->
Log.e("TranslationViewModel", "Translation failed: ${exception.message}") Log.e("TranslationViewModel", "Translation failed: ${exception.message}")
statusMessageService.showErrorMessage("Translation failed: ${exception.message}")
} }
_isTranslating.value = false _isTranslating.value = false

View File

@@ -225,7 +225,7 @@
<string name="label_amount_models">%1$d models</string> <string name="label_amount_models">%1$d models</string>
<string name="label_analyze_grammar">Analyze Grammar</string> <string name="label_analyze_grammar">Analyze Grammar</string>
<string name="label_appearance">Appearance</string> <string name="label_appearance">Appearance</string>
<string name="hint_settings_title_hints">Help</string> <string name="hint_settings_title_help">Help</string>
<string name="label_apply_filters">Apply Filters</string> <string name="label_apply_filters">Apply Filters</string>
<string name="label_article">Article</string> <string name="label_article">Article</string>
<string name="label_backup_and_restore">Backup and Restore</string> <string name="label_backup_and_restore">Backup and Restore</string>
@@ -1042,4 +1042,5 @@
<string name="label_no_category">None</string> <string name="label_no_category">None</string>
<string name="text_select">Select</string> <string name="text_select">Select</string>
<string name="text_search">Search</string> <string name="text_search">Search</string>
<string name="text_language_settings_description">Set what languages you want to use in the app. Languages that are not activated will not appear in this app. You can also add your own language to the list, or change an existing language (region/locale)</string>
</resources> </resources>