Skip to content

Commit

Permalink
Change textdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jan 22, 2024
1 parent 1533233 commit 579994e
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="yoast-comment-hacks"/>
<element value="comment-hacks"/>
<element value="default"/>
</property>
</properties>
Expand Down
24 changes: 12 additions & 12 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function show_forward_status( $comment_text, $comment ): string {
$ch_forwarded = \get_comment_meta( $comment->comment_ID, 'ch_forwarded' );
if ( $ch_forwarded ) {
/* translators: %s is replaced by the name you're forwarding to. */
$pre = '<div style="background: #fff;border: 1px solid #46b450;border-left-width: 4px;box-shadow: 0 1px 1px rgba(0,0,0,.04);margin: 5px 15px 2px 0;padding: 1px 12px 1px;"><p><strong>' . \sprintf( \esc_html__( 'This comment was forwarded to %s.', 'yoast-comment-hacks' ), \esc_html( $this->options['forward_name'] ) ) . '</strong></p></div>';
$pre = '<div style="background: #fff;border: 1px solid #46b450;border-left-width: 4px;box-shadow: 0 1px 1px rgba(0,0,0,.04);margin: 5px 15px 2px 0;padding: 1px 12px 1px;"><p><strong>' . \sprintf( \esc_html__( 'This comment was forwarded to %s.', 'comment-hacks' ), \esc_html( $this->options['forward_name'] ) ) . '</strong></p></div>';
$comment_text = $pre . $comment_text;
}

Expand All @@ -100,7 +100,7 @@ public function forward_comment(): void {
$comment = \get_comment( $comment_id );

/* translators: %1$s is replaced by (a link to) the blog's name, %2$s by (a link to) the title of the blogpost. */
echo '<div class="msg updated"><p>' . \sprintf( \esc_html__( 'Forwarding comment from %1$s to %2$s.', 'yoast-comment-hacks' ), '<strong>' . \esc_html( $comment->comment_author ) . '</strong>', \esc_html( $this->options['forward_name'] ) ) . '</div></div>';
echo '<div class="msg updated"><p>' . \sprintf( \esc_html__( 'Forwarding comment from %1$s to %2$s.', 'comment-hacks' ), '<strong>' . \esc_html( $comment->comment_author ) . '</strong>', \esc_html( $this->options['forward_name'] ) ) . '</div></div>';

$intro = \sprintf( 'This comment was forwarded from %s where it was left on: %s.', '<a href=" ' . \get_site_url() . ' ">' . \esc_html( \get_bloginfo( 'name' ) ) . '</a>', '<a href="' . \get_permalink( $comment->comment_post_ID ) . '">' . \get_the_title( $comment->comment_post_ID ) . '</a>' ) . "\n\n";

Expand All @@ -111,7 +111,7 @@ public function forward_comment(): void {
$intro .= '---------- Forwarded message ---------
From: ' . \esc_html( $comment->comment_author ) . ' &lt;' . \esc_html( $comment->comment_author_email ) . '&gt;
Date: ' . \gmdate( 'D, M j, Y \a\t h:i A', \strtotime( $comment->comment_date ) ) . '
Subject: ' . \esc_html__( 'Comment on', 'yoast-comment-hacks' ) . ' ' . \esc_html( \get_bloginfo( 'name' ) ) . '
Subject: ' . \esc_html__( 'Comment on', 'comment-hacks' ) . ' ' . \esc_html( \get_bloginfo( 'name' ) ) . '
To: ' . \esc_html( \get_bloginfo( 'name' ) ) . ' &lt;' . \esc_html( $this->options['forward_from_email'] ) . '&gt;';
$intro .= "\n\n";

Expand Down Expand Up @@ -142,11 +142,11 @@ public function forward_to_support_action_link( $actions, $comment ): array {
return $actions;
}

$label = \esc_html__( 'Forward to support', 'yoast-comment-hacks' );
$label = \esc_html__( 'Forward to support', 'comment-hacks' );

// '1' === approved, 'trash' === trashed.
if ( $comment->comment_approved !== '1' && $comment->comment_approved !== 'trash' ) {
$label = \esc_html__( 'Forward to support & trash', 'yoast-comment-hacks' );
$label = \esc_html__( 'Forward to support & trash', 'comment-hacks' );
}

$actions['ch_forward'] = '<a href="' . \admin_url( 'edit-comments.php' ) . '?comment_id=' . $comment->comment_ID . '&ch_action=forward_comment&nonce=' . \wp_create_nonce( 'comment-hacks-forward' ) . '">' . $label . '</a>';
Expand All @@ -160,7 +160,7 @@ public function forward_to_support_action_link( $actions, $comment ): array {
public function register_meta_boxes(): void {
\add_meta_box(
'comment-hacks-reroute',
\__( 'Comment Hacks', 'yoast-comment-hacks' ),
\__( 'Comment Hacks', 'comment-hacks' ),
[
$this,
'meta_box_callback',
Expand All @@ -177,7 +177,7 @@ public function register_meta_boxes(): void {
*/
public function meta_box_callback( $post ): void {
echo '<input type="hidden" name="comment_notification_recipient_nonce" value="' . \esc_attr( \wp_create_nonce( 'comment_notification_recipient_nonce' ) ) . '" />';
echo '<label for="comment_notification_recipient">' . \esc_html__( 'Comment notification recipients:', 'yoast-comment-hacks' ) . '</label><br/>';
echo '<label for="comment_notification_recipient">' . \esc_html__( 'Comment notification recipients:', 'comment-hacks' ) . '</label><br/>';

/**
* This filter allows filtering which roles should be shown in the dropdown for notifications.
Expand Down Expand Up @@ -325,7 +325,7 @@ public function options_validate( array $input ): array {

if ( ( $this->absolute_min + 1 ) > $input['mincomlength'] || empty( $input['mincomlength'] ) ) {
/* translators: %d is replaced with the minimum number of characters */
\add_settings_error( $this->hook, 'min_length_invalid', \sprintf( \__( 'The minimum length you entered is invalid, please enter a minimum length above %d.', 'yoast-comment-hacks' ), $this->absolute_min ) );
\add_settings_error( $this->hook, 'min_length_invalid', \sprintf( \__( 'The minimum length you entered is invalid, please enter a minimum length above %d.', 'comment-hacks' ), $this->absolute_min ) );
$input['mincomlength'] = 15;
}

Expand Down Expand Up @@ -369,8 +369,8 @@ private function sanitize_string( $value, $default ) {
*/
public function add_config_page() {
\add_options_page(
\__( 'Comment Hacks', 'yoast-comment-hacks' ),
\__( 'Comment Hacks', 'yoast-comment-hacks' ),
\__( 'Comment Hacks', 'comment-hacks' ),
\__( 'Comment Hacks', 'comment-hacks' ),
'manage_options',
$this->hook,
[
Expand All @@ -394,7 +394,7 @@ public function filter_plugin_actions( $links, $file ): array {
}

if ( $file === $this_plugin ) {
$settings_link = '<a href="' . \admin_url( 'options-general.php?page=' . $this->hook ) . '">' . \__( 'Settings', 'yoast-comment-hacks' ) . '</a>';
$settings_link = '<a href="' . \admin_url( 'options-general.php?page=' . $this->hook ) . '">' . \__( 'Settings', 'comment-hacks' ) . '</a>';
// Put our link before other links.
\array_unshift( $links, $settings_link );
}
Expand All @@ -410,7 +410,7 @@ public function config_page(): void {

// Show the content of the options array when debug is enabled.
if ( \defined( 'WP_DEBUG' ) && \WP_DEBUG ) {
echo '<h4>', \esc_html__( 'Options debug', 'yoast-comment-hacks' ), '</h4>';
echo '<h4>', \esc_html__( 'Options debug', 'comment-hacks' ), '</h4>';
echo '<div style="border: 1px solid #aaa; padding: 20px;">';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Debug output.
echo \str_replace(
Expand Down
2 changes: 1 addition & 1 deletion admin/views/comment-parent-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="inside">
<table class="form-table editcomment">
<tr valign="top">
<td class="first" style="width: 120px;"><label for="yst_comment_parent"><?php esc_html_e( 'Comment parent:', 'yoast-comment-hacks' ); ?></label></td>
<td class="first" style="width: 120px;"><label for="yst_comment_parent"><?php esc_html_e( 'Comment parent:', 'comment-hacks' ); ?></label></td>
<td><input type="text" name="yst_comment_parent" size="30" value="<?php echo esc_attr( $comment->comment_parent ); ?>" id="yst_comment_parent" /></td>
</tr>
</table>
Expand Down
Loading

0 comments on commit 579994e

Please sign in to comment.