From 5e81ea1927310ad1cabcafa81012bf1837b2d051 Mon Sep 17 00:00:00 2001 From: Maciej Gryniuk Date: Thu, 25 Jun 2015 17:07:17 +0200 Subject: [PATCH 1/4] Seems like it's too early to translate options page string. --- admin.php | 2 +- scb/AdminPage.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin.php b/admin.php index 2d9151d..c423437 100755 --- a/admin.php +++ b/admin.php @@ -5,7 +5,7 @@ class BJLL_Admin_Page extends scbAdminPage { function setup() { $this->args = array( 'menu_title' => 'BJ Lazy Load', - 'page_title' => __( 'BJ Lazy Load Options', 'bj-lazy-load' ), + 'page_title' => 'BJ Lazy Load Options', ); } diff --git a/scb/AdminPage.php b/scb/AdminPage.php index 64dbdb1..5cbce96 100755 --- a/scb/AdminPage.php +++ b/scb/AdminPage.php @@ -160,7 +160,7 @@ function page_help(){} function page_header() { echo "
\n"; screen_icon( $this->args['screen_icon'] ); - echo html( 'h2', $this->args['page_title'] ); + echo html( 'h2', __( $this->args['page_title'], 'bj-lazy-load' ) ); } /** @@ -409,7 +409,7 @@ function page_init() { if ( ! $this->args['toplevel'] ) { $this->pagehook = add_submenu_page( $this->args['parent'], - $this->args['page_title'], + __( $this->args['page_title'], 'bj-lazy-load' ), $this->args['menu_title'], $this->args['capability'], $this->args['page_slug'], @@ -418,7 +418,7 @@ function page_init() { } else { $func = 'add_' . $this->args['toplevel'] . '_page'; $this->pagehook = $func( - $this->args['page_title'], + __( $this->args['page_title'], 'bj-lazy-load' ), $this->args['menu_title'], $this->args['capability'], $this->args['page_slug'], @@ -429,7 +429,7 @@ function page_init() { add_submenu_page( $this->args['page_slug'], - $this->args['page_title'], + __( $this->args['page_title'], 'bj-lazy-load' ), $this->args['submenu_title'], $this->args['capability'], $this->args['page_slug'], From 403c4f1f069f989a7fa9ab3a34383bf8c2f6bcc4 Mon Sep 17 00:00:00 2001 From: Maciej Gryniuk Date: Thu, 25 Jun 2015 17:07:29 +0200 Subject: [PATCH 2/4] `Settings` is global phrase used exactly in this place. --- scb/AdminPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scb/AdminPage.php b/scb/AdminPage.php index 5cbce96..f3bee32 100755 --- a/scb/AdminPage.php +++ b/scb/AdminPage.php @@ -463,7 +463,7 @@ private function check_args() { 'menu_title' => $this->args['page_title'], 'page_slug' => '', 'nonce' => '', - 'action_link' => __( 'Settings', $this->textdomain ), + 'action_link' => 'Settings', 'admin_action_priority' => 10, ) ); @@ -511,7 +511,7 @@ function _page_content_hook() { function _action_link( $links ) { $url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) ); - $links[] = html_link( $url, $this->args['action_link'] ); + $links[] = html_link( $url, __( $this->args['action_link'] ) ); return $links; } From 9423f7246f70632c1ac54a2c8abee3afbb38ccff Mon Sep 17 00:00:00 2001 From: Maciej Gryniuk Date: Thu, 25 Jun 2015 17:07:37 +0200 Subject: [PATCH 3/4] $this->textdomain seems like broken. --- scb/AdminPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scb/AdminPage.php b/scb/AdminPage.php index f3bee32..78a0c72 100755 --- a/scb/AdminPage.php +++ b/scb/AdminPage.php @@ -224,7 +224,7 @@ function form_handler() { */ function admin_msg( $msg = '', $class = 'updated' ) { if ( empty( $msg ) ) - $msg = __( 'Settings saved.', $this->textdomain ); + $msg = __( 'Settings saved.', 'bj-lazy-load' ); echo scb_admin_notice( $msg, $class ); } From 6e0c7c41a6cdca1ae91e8ead475316b60811196e Mon Sep 17 00:00:00 2001 From: Maciej Gryniuk Date: Thu, 25 Jun 2015 17:07:48 +0200 Subject: [PATCH 4/4] Added "Apply to text widgets" phrase to .pot (manually). --- lang/bj-lazy-load.pot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang/bj-lazy-load.pot b/lang/bj-lazy-load.pot index 2aef7bc..a45af91 100755 --- a/lang/bj-lazy-load.pot +++ b/lang/bj-lazy-load.pot @@ -31,6 +31,10 @@ msgid "No" msgstr "" #: admin.php:23 +msgid "Apply to text widgets" +msgstr "" + +#: admin.php:29 msgid "Apply to post thumbnails" msgstr ""