diff --git a/bp-compliments-core.php b/bp-compliments-core.php index a63c465..5cf1e2b 100644 --- a/bp-compliments-core.php +++ b/bp-compliments-core.php @@ -41,7 +41,7 @@ public function __construct() { parent::start( 'compliments', - __( 'Compliments', BP_COMP_TEXTDOMAIN ), + __( 'Compliments', 'bp-compliments' ), constant( 'BP_COMPLIMENTS_DIR' ) . '/includes', $this->params ); diff --git a/bp-compliments.php b/bp-compliments.php index 9cc8da9..8d066c0 100644 --- a/bp-compliments.php +++ b/bp-compliments.php @@ -10,7 +10,7 @@ Plugin Name: BuddyPress Compliments Plugin URI: http://wpgeodirectory.com/ Description: Compliments module for BuddyPress. -Version: 0.0.7 +Version: 0.0.8 Author: GeoDirectory Author URI: http://wpgeodirectory.com */ @@ -19,7 +19,7 @@ if ( !defined( 'ABSPATH' ) ) exit; // Define the plugin version. -define( 'BP_COMPLIMENTS_VER', '0.0.7' ); +define( 'BP_COMPLIMENTS_VER', '0.0.8' ); /** * BuddyPress compliments text domain. @@ -28,9 +28,9 @@ /** * BuddyPress compliments names. */ -define( 'BP_COMP_SINGULAR_NAME', trim(esc_attr( get_option('bp_compliment_singular_name', __( 'Compliment', BP_COMP_TEXTDOMAIN )))) ); -define( 'BP_COMP_PLURAL_NAME', trim(esc_attr( get_option('bp_compliment_plural_name', __( 'Compliments', BP_COMP_TEXTDOMAIN )))) ); -define( 'BP_COMPLIMENTS_SLUG', strtolower(trim(esc_attr( get_option('bp_compliment_slug', __( 'compliments', BP_COMP_TEXTDOMAIN ))))) ); +define( 'BP_COMP_SINGULAR_NAME', trim(esc_attr( get_option('bp_compliment_singular_name', __( 'Compliment', 'bp-compliments' )))) ); +define( 'BP_COMP_PLURAL_NAME', trim(esc_attr( get_option('bp_compliment_plural_name', __( 'Compliments', 'bp-compliments' )))) ); +define( 'BP_COMPLIMENTS_SLUG', strtolower(trim(esc_attr( get_option('bp_compliment_slug', __( 'compliments', 'bp-compliments' ))))) ); /** @@ -68,7 +68,7 @@ function bp_compliments_init() { // show admin notice for users on BP 1.2.x } else { - $older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", BP_COMP_TEXTDOMAIN ); + $older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", 'bp-compliments' ); add_action( 'admin_notices', create_function( '', " echo '

' . $older_version_notice . '

'; @@ -136,10 +136,10 @@ function bp_compliments_localization() { * @since 0.0.1 * @package BuddyPress_Compliments */ - $locale = apply_filters('plugin_locale', get_locale(), BP_COMP_TEXTDOMAIN); + $locale = apply_filters('plugin_locale', get_locale(), 'bp-compliments'); - load_textdomain(BP_COMP_TEXTDOMAIN, WP_LANG_DIR . '/' . BP_COMP_TEXTDOMAIN . '/' . BP_COMP_TEXTDOMAIN . '-' . $locale . '.mo'); - load_plugin_textdomain(BP_COMP_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages'); + load_textdomain('bp-compliments', WP_LANG_DIR . '/' . 'bp-compliments' . '/' . 'bp-compliments' . '-' . $locale . '.mo'); + load_plugin_textdomain('bp-compliments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages'); } add_action( 'plugins_loaded', 'bp_compliments_localization' ); diff --git a/change_log.txt b/change_log.txt index fb12f8c..8f6c6c2 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,7 @@ Option added to enable/disable notifications component - ADDED Added placeholder text to message textarea - ADDED Compliments in activity dropdown filter is ambiguous - FIXED Undefined property ID notice - FIXED +Changed textdomain from defined constant to a string - CHANGED v0.0.7 Compliments can be renamed to anything Ex: "Gifts" - ADDED diff --git a/includes/bp-compliments-actions.php b/includes/bp-compliments-actions.php index 04cdfbc..ca3e1bf 100644 --- a/includes/bp-compliments-actions.php +++ b/includes/bp-compliments-actions.php @@ -48,9 +48,9 @@ function handle_compliments_form_data() { $redirect_url = bp_core_get_user_domain($receiver_id); if ( ! bp_compliments_start_compliment($args)) { - bp_core_add_message( sprintf( __( 'There was a problem when trying to send %s to %s, please contact administrator.', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ), 'error' ); + bp_core_add_message( sprintf( __( 'There was a problem when trying to send %s to %s, please contact administrator.', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ), 'error' ); } else { - bp_core_add_message( sprintf( __( 'Your %s sent to %s.', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ) ); + bp_core_add_message( sprintf( __( 'Your %s sent to %s.', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ) ); } $bp_compliment_can_see_others_comp_value = esc_attr( get_option('bp_compliment_can_see_others_comp')); diff --git a/includes/bp-compliments-activity.php b/includes/bp-compliments-activity.php index f8e0f6e..a1e6543 100644 --- a/includes/bp-compliments-activity.php +++ b/includes/bp-compliments-activity.php @@ -103,7 +103,7 @@ function compliments_register_activity_actions() { bp_activity_set_action( $bp->compliments->id, 'compliment_received', - sprintf( __( '%s Received', BP_COMP_TEXTDOMAIN ), BP_COMP_SINGULAR_NAME ), + sprintf( __( '%s Received', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ), 'compliments_format_activity_action_compliment_received', BP_COMP_PLURAL_NAME, array( 'activity' ) @@ -112,7 +112,7 @@ function compliments_register_activity_actions() { bp_activity_set_action( $bp->compliments->id, 'compliment_sent', - sprintf( __( '%s Sent', BP_COMP_TEXTDOMAIN ), BP_COMP_SINGULAR_NAME ), + sprintf( __( '%s Sent', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ), 'compliments_format_activity_action_compliment_sent', BP_COMP_PLURAL_NAME, array( 'activity' ) @@ -155,9 +155,9 @@ function compliments_format_activity_action_compliment_received( $action, $activ } if ($bp_compliment_can_see_others_comp == 'yes') { - $action = sprintf( __( '%1$s has received a %2$s from %3$s', BP_COMP_TEXTDOMAIN ), $receiver_link, $compliment_link, $sender_link ); + $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, $compliment_link, $sender_link ); } else { - $action = sprintf( __( '%1$s has received a %2$s from %3$s', BP_COMP_TEXTDOMAIN ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link ); + $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link ); } @@ -199,9 +199,9 @@ function compliments_format_activity_action_compliment_sent( $action, $activity } if ($bp_compliment_can_see_others_comp == 'yes') { - $action = sprintf( __( '%1$s has sent a %2$s to %3$s', BP_COMP_TEXTDOMAIN ), $sender_link, $compliment_link, $receiver_link ); + $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, $compliment_link, $receiver_link ); } else { - $action = sprintf( __( '%1$s has sent a %2$s to %3$s', BP_COMP_TEXTDOMAIN ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link ); + $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link ); } /** diff --git a/includes/bp-compliments-forms.php b/includes/bp-compliments-forms.php index 2a2b271..d7ee9e7 100644 --- a/includes/bp-compliments-forms.php +++ b/includes/bp-compliments-forms.php @@ -23,7 +23,7 @@ function bp_compliments_modal_form($pid = 0, $receiver_id = 0) {
-

+

@@ -55,13 +55,13 @@ function bp_compliments_modal_form($pid = 0, $receiver_id = 0) { echo ''; ?> - +
- - + +