From ce1156cc8a7cf6da7726670458535ca7c8eff954 Mon Sep 17 00:00:00 2001
Date: Mon, 11 Apr 2016 18:42:18 +0200
Subject: [PATCH] Don't even attempt to load a translation if the locale is
 `en_US`.

---
 src/wp-includes/l10n.php | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php
index bfc6598..d747cc4 100644
--- a/src/wp-includes/l10n.php
+++ b/src/wp-includes/l10n.php
@@ -630,6 +630,10 @@ function load_default_textdomain( $locale = null ) {
 	// Unload previously loaded strings so we can switch translations.
 	unload_textdomain( 'default' );
 
+	if ( 'en_US' === $locale ) {
+		return true;
+	}
+
 	$return = load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
 
 	if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists(  WP_LANG_DIR . "/admin-$locale.mo" ) ) {
@@ -674,6 +678,10 @@ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path
 	 */
 	$locale = apply_filters( 'plugin_locale', $locale, $domain );
 
+	if ( 'en_US' === $locale ) {
+		return true;
+	}
+
 	if ( false !== $plugin_rel_path	) {
 		$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
 	} elseif ( false !== $deprecated ) {
@@ -685,8 +693,9 @@ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path
 
 	// Load the textdomain according to the plugin first
 	$mofile = $domain . '-' . $locale . '.mo';
-	if ( $loaded = load_textdomain( $domain, $path . '/'. $mofile ) )
+	if ( $loaded = load_textdomain( $domain, $path . '/'. $mofile ) ) {
 		return $loaded;
+	}
 
 	// Otherwise, load from the languages directory
 	$mofile = WP_LANG_DIR . '/plugins/' . $mofile;
@@ -706,12 +715,18 @@ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path
 function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {
 	/** This filter is documented in wp-includes/l10n.php */
 	$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
+
+	if ( 'en_US' === $locale ) {
+		return true;
+	}
+
 	$path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) );
 
 	// Load the textdomain according to the plugin first
 	$mofile = $domain . '-' . $locale . '.mo';
-	if ( $loaded = load_textdomain( $domain, $path . $mofile ) )
+	if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) {
 		return $loaded;
+	}
 
 	// Otherwise, load from the languages directory
 	$mofile = WP_LANG_DIR . '/plugins/' . $mofile;
@@ -745,13 +760,19 @@ function load_theme_textdomain( $domain, $path = false ) {
 	 */
 	$locale = apply_filters( 'theme_locale', $locale, $domain );
 
-	if ( ! $path )
+	if ( 'en_US' === $locale ) {
+		return true;
+	}
+
+	if ( ! $path ) {
 		$path = get_template_directory();
+	}
 
 	// Load the textdomain according to the theme
 	$mofile = untrailingslashit( $path ) . "/{$locale}.mo";
-	if ( $loaded = load_textdomain( $domain, $mofile ) )
+	if ( $loaded = load_textdomain( $domain, $mofile ) ) {
 		return $loaded;
+	}
 
 	// Otherwise, load from the languages directory
 	$mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo";
-- 
1.9.4.msysgit.2

