Plugin Directory

Changeset 1039699


Ignore:
Timestamp:
12/07/2014 05:00:31 AM (11 years ago)
Author:
captaintheme
Message:

textdomain

Location:
recipe-hero-labels
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • recipe-hero-labels/tags/1.0.0/recipe-hero-labels.php

    r1035264 r1039699  
    44 * Plugin URI: http://recipehero.in/
    55 * Description: Adds a settings tab to Recipe Hero that allows you to customize the labels used by the plugin.
    6  * Author: Bryce Adams
    7  * Author URI: http://bryce.se/
     6 * Author: Recipe Hero / Bryce Adams
     7 * Author URI: http://recipehero.in/
    88 * Version: 1.0.0
    99 *
     
    2323 */
    2424
    25 
    2625// If this file is called directly, abort.
    2726if ( ! defined( 'WPINC' ) ) {
     
    2928}
    3029
    31 
    3230/**
    3331 * Check if WooCommerce is active
    3432 **/
    3533if ( in_array( 'recipe-hero/recipe-hero.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     34
     35    // Load plugin text domain
     36    add_action( 'init', 'rhl_load_textdomain' );
    3637
    3738    // Load up...
     
    5960
    6061/**
     62 * Load the plugin text domain for translation.
     63 *
     64 * @return void
     65 */
     66if ( ! function_exists( 'rhl_load_textdomain' ) ) {
     67    function rhl_load_textdomain() {
     68        $locale = apply_filters( 'plugin_locale', get_locale(), 'recipe-hero-labels' );
     69
     70        load_textdomain( 'recipe-hero-labels', trailingslashit( WP_LANG_DIR ) . 'recipe-hero-video/recipe-hero-labels-' . $locale . '.mo' );
     71        load_plugin_textdomain( 'recipe-hero-labels', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     72    }
     73}
     74
     75/**
    6176* Recipe Hero Deactivated Notice
    6277**/
    6378if ( ! function_exists( 'rhl_rh_deactivated' ) ) {
    6479    function rhl_rh_deactivated() {
    65         echo '<div class="error"><p>' . sprintf( __( 'Recipe Hero Labels requires %s to be installed and active.', 'woocommerce-360-image' ), '<a href="http://www.recipehero.in/" target="_blank">Recipe Hero</a>' ) . '</p></div>';
     80        echo '<div class="error"><p>' . sprintf( __( 'Recipe Hero Labels requires %s to be installed and active.', 'recipe-hero-labels' ), '<a href="http://www.recipehero.in/" target="_blank">Recipe Hero</a>' ) . '</p></div>';
    6681    }
    6782}
  • recipe-hero-labels/trunk/recipe-hero-labels.php

    r1035264 r1039699  
    44 * Plugin URI: http://recipehero.in/
    55 * Description: Adds a settings tab to Recipe Hero that allows you to customize the labels used by the plugin.
    6  * Author: Bryce Adams
    7  * Author URI: http://bryce.se/
     6 * Author: Recipe Hero / Bryce Adams
     7 * Author URI: http://recipehero.in/
    88 * Version: 1.0.0
    99 *
     
    2323 */
    2424
    25 
    2625// If this file is called directly, abort.
    2726if ( ! defined( 'WPINC' ) ) {
     
    2928}
    3029
    31 
    3230/**
    3331 * Check if WooCommerce is active
    3432 **/
    3533if ( in_array( 'recipe-hero/recipe-hero.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     34
     35    // Load plugin text domain
     36    add_action( 'init', 'rhl_load_textdomain' );
    3637
    3738    // Load up...
     
    5960
    6061/**
     62 * Load the plugin text domain for translation.
     63 *
     64 * @return void
     65 */
     66if ( ! function_exists( 'rhl_load_textdomain' ) ) {
     67    function rhl_load_textdomain() {
     68        $locale = apply_filters( 'plugin_locale', get_locale(), 'recipe-hero-labels' );
     69
     70        load_textdomain( 'recipe-hero-labels', trailingslashit( WP_LANG_DIR ) . 'recipe-hero-video/recipe-hero-labels-' . $locale . '.mo' );
     71        load_plugin_textdomain( 'recipe-hero-labels', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     72    }
     73}
     74
     75/**
    6176* Recipe Hero Deactivated Notice
    6277**/
    6378if ( ! function_exists( 'rhl_rh_deactivated' ) ) {
    6479    function rhl_rh_deactivated() {
    65         echo '<div class="error"><p>' . sprintf( __( 'Recipe Hero Labels requires %s to be installed and active.', 'woocommerce-360-image' ), '<a href="http://www.recipehero.in/" target="_blank">Recipe Hero</a>' ) . '</p></div>';
     80        echo '<div class="error"><p>' . sprintf( __( 'Recipe Hero Labels requires %s to be installed and active.', 'recipe-hero-labels' ), '<a href="http://www.recipehero.in/" target="_blank">Recipe Hero</a>' ) . '</p></div>';
    6681    }
    6782}
Note: See TracChangeset for help on using the changeset viewer.