Skip to content

Commit

Permalink
fix: tts doesn't work with auto lang detection enabled (closes #458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Feb 4, 2025
1 parent 5039ae1 commit 3335fd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fun TranslationField(
}
)

if (translationModel.engine.supportsAudio) {
if (translationModel.engine.supportsAudio && language.code.isNotEmpty()) {
StyledIconButton(
imageVector = Icons.Default.VolumeUp
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ fun TranslationComponent(
translationModel = viewModel,
isSourceField = true,
text = viewModel.insertedText,
viewModel.sourceLanguage,
language = viewModel.sourceLanguage.copy(
code = viewModel.sourceLanguage.code.ifEmpty {
viewModel.translation.detectedLanguage.orEmpty()
}
),
showLanguageSelector = showLanguageSelector,
setLanguage = {
if (it == viewModel.targetLanguage) {
Expand Down

0 comments on commit 3335fd7

Please sign in to comment.