+function load_theme_textdomain( $domain, $path = false ) {
+ $locale = apply_filters( 'theme_locale', get_locale(), $domain );
+
+ if ( ! $path )
+ $path = get_template_directory();
+
+ // Load the textdomain from the Theme provided location, or theme directory first
+ $mofile = "{$path}/{$locale}.mo";
+ if ( $loaded = load_textdomain($domain, $mofile) )
+ return $loaded;
+
+ // Else, load textdomain from the Language directory
+ $mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo";
+ return load_textdomain($domain, $mofile);
+}
+
+/**
+ * Loads the child themes translated strings.
+ *
+ * If the current locale exists as a .mo file in the child themes root directory, it
+ * will be included in the translated strings by the $domain.
+ *
+ * The .mo files must be named based on the locale exactly.
+ *
+ * @since 2.9.0
+ *
+ * @param string $domain Unique identifier for retrieving translated strings
+ */
+function load_child_theme_textdomain( $domain, $path = false ) {
+ if ( ! $path )
+ $path = get_stylesheet_directory();
+ return load_theme_textdomain( $domain, $path );
+}
+
+/**
+ * Returns the Translations instance for a domain. If there isn't one,
+ * returns empty Translations instance.
+ *
+ * @param string $domain
+ * @return object A Translation instance
+ */
+function get_translations_for_domain( $domain ) {
+ global $l10n;
+ if ( !isset( $l10n[$domain] ) ) {
+ $l10n[$domain] = new NOOP_Translations;
+ }
+ return $l10n[$domain];
+}