Ticket #45769: 45769.2.diff
File 45769.2.diff, 1.6 KB (added by , 6 years ago) |
---|
-
src/wp-includes/l10n.php
922 922 // If a path was given and the handle file exists simply return it. 923 923 $file_base = $domain === 'default' ? $locale : $domain . '-' . $locale; 924 924 $handle_filename = $file_base . '-' . $handle . '.json'; 925 if ( $path && file_exists( $path . '/' . $handle_filename ) ) { 926 return load_script_translations( $path . '/' . $handle_filename, $handle, $domain ); 925 926 if ( $path ) { 927 $translations = load_script_translations( $path . '/' . $handle_filename, $handle, $domain ); 928 929 if ( $translations ) { 930 return $translations; 931 } 927 932 } 928 933 929 934 $src = $wp_scripts->registered[ $handle ]->src; … … 983 988 } 984 989 985 990 $md5_filename = $file_base . '-' . md5( $relative ) . '.json'; 986 if ( $path && file_exists( $path . '/' . $md5_filename ) ) { 987 return load_script_translations( $path . '/' . $md5_filename, $handle, $domain ); 991 992 if ( $path ) { 993 $translations = load_script_translations( $path . '/' . $md5_filename, $handle, $domain ); 994 995 if ( $translations ) { 996 return $translations; 997 } 988 998 } 989 if ( file_exists( $languages_path . '/' . $md5_filename ) ) { 990 return load_script_translations( $languages_path . '/' . $md5_filename, $handle, $domain ); 999 1000 $translations = load_script_translations( $languages_path . '/' . $md5_filename, $handle, $domain ); 1001 1002 if ( $translations ) { 1003 return $translations; 991 1004 } 992 1005 993 1006 return load_script_translations( false, $handle, $domain );