Force address fields to English
-
Hello,
My entire site is in a foreign language, which also makes the billing and shipping address field labels and even US state names in that language. However, all of my customers are based in the US, so addresses will need to be entered in English and I’d like to display address filed labels and US state names in English.
The following code works very well, but it forces the entire checkout and my account page into English, which is not ideal since the rest of the site is in another language. I’d like to only force the address filed labels and state names to English.
// change checkout page to English add_filter('locale', function($locale) { if (strpos($_SERVER['REQUEST_URI'], "checkout") !== false) return 'en_EN'; return $locale; }); // change my-account page to English add_filter('locale', function($locale) { if (strpos($_SERVER['REQUEST_URI'], "my-account") !== false) return 'en_EN'; return $locale; });
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Force address fields to English’ is closed to new replies.