Ensure woocommerce_params.locale exists before attempting to use it.

woocommerce_params will only be populated when the current page
is_checkout() || is_cart() per the logic in woocommerce.php. This
ensures the script will not fail on an unhandled exception if we're not
on one of those pages.