/**
 * Voice settings language persistence script
 * 
 * Ensures that the language selection is maintained when saving settings.
 */
jQuery(document).ready(function($) {
    // Log the current language on page load
    const savedLanguage = $('#mementor_tts_language').val();
    if (window.mementorTTSDebug) window.mementorTTSDebug.log('TTS Plugin: Loaded with saved language:', savedLanguage);
    
    // Handle form submission
    $('#voices-settings-form').on('submit', function(e) {
        // Let form submit normally to options.php
        const language = $('#mementor_tts_language').val();
        if (window.mementorTTSDebug) window.mementorTTSDebug.log('TTS Plugin: Form submitted with language:', language);
        return true;
    });
}); 