forked from upstream-mirrors/quik
Added necessary strings.
This commit is contained in:
@@ -162,7 +162,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
|
|
||||||
if (resolveInfoList.isEmpty()) {
|
if (resolveInfoList.isEmpty()) {
|
||||||
// No STT provider found, show a Toast message
|
// No STT provider found, show a Toast message
|
||||||
Toast.makeText(this, "No speech-to-text service available on this device.", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -203,14 +203,14 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
val speechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
val speechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
|
.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
|
||||||
// Optionally include a prompt message
|
// Optionally include a prompt message
|
||||||
.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak your message")
|
.putExtra(RecognizerIntent.EXTRA_PROMPT, getString(R.string.stt_toast_extra_prompt))
|
||||||
|
|
||||||
// Check if there is a speech recognition service available
|
// Check if there is a speech recognition service available
|
||||||
val resolveInfoList = packageManager.queryIntentActivities(speechRecognizerIntent, PackageManager.MATCH_DEFAULT_ONLY)
|
val resolveInfoList = packageManager.queryIntentActivities(speechRecognizerIntent, PackageManager.MATCH_DEFAULT_ONLY)
|
||||||
|
|
||||||
if (resolveInfoList.isEmpty()) {
|
if (resolveInfoList.isEmpty()) {
|
||||||
// No STT provider found, show a Toast message
|
// No STT provider found, show a Toast message
|
||||||
Toast.makeText(this@ComposeActivity, "No speech-to-text service available on this device.", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@ComposeActivity, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show()
|
||||||
} else {
|
} else {
|
||||||
// Launch the speech recognizer
|
// Launch the speech recognizer
|
||||||
speechResultLauncher.launch(speechRecognizerIntent)
|
speechResultLauncher.launch(speechRecognizerIntent)
|
||||||
|
|||||||
Reference in New Issue
Block a user