updateLocale method
Implementation
Future<void> updateLocale(String newLocale) async {
if (newLocale != _localeId) {
print('Updating locale from $_localeId to $newLocale');
// Stop current recognition if running
if (_isMicOn) {
await stopListening();
}
// Update locale
_localeId = newLocale;
// Force cleanup of current instance
await dispose();
_isInitialized = false;
// Reinitialize with new locale
await _initializeWithRetry();
}
}