Apply function only for specific post

Turned out that to check the post_id the function is is_single

function change_my_locale($locale ) {
    if ( is_single(52397) ) {
        return 'es_ES';
    }
    return $locale;
}
add_filter('locale', 'change_my_locale');

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)