Make WordPress Core

Ticket #11033: load_style_textdomain.patch

File load_style_textdomain.patch, 899 bytes (added by johnjamesjacoby, 15 years ago)

load_style_textdomain

  • l10n.php

     
    396396}
    397397
    398398/**
     399 * Loads the style's translated strings.
     400 *
     401 * If the current locale exists as a .mo file in the style's root directory, it
     402 * will be included in the translated strings by the $domain.
     403 *
     404 * The .mo files must be named based on the locale exactly.
     405 *
     406 * @since 2.9.0
     407 *
     408 * @param string $domain Unique identifier for retrieving translated strings
     409 */
     410function load_style_textdomain($domain, $path = false) {
     411        $locale = get_locale();
     412
     413        $path = ( empty( $path ) ) ? get_stylesheet_directory() : $path;
     414
     415        $mofile = "$path/$locale.mo";
     416        return load_textdomain($domain, $mofile);
     417}
     418
     419/**
    399420 * Returns the Translations instance for a domain. If there isn't one,
    400421 * returns empty Translations instance.
    401422 *