diff --git a/includes/Performance.php b/includes/Performance.php index 8dc7d1a..e6b601c 100644 --- a/includes/Performance.php +++ b/includes/Performance.php @@ -69,14 +69,14 @@ public function __construct( Container $container ) { $cacheManager = new CacheManager( $container ); $cachePurger = new CachePurgingService( $cacheManager->getInstances() ); - // Ensure that purgeable cache types are enabled before showing the UI. - if ( $cachePurger->canPurge() ) { - add_action( 'admin_bar_menu', array( $this, 'adminBarMenu' ), 100 ); - } + add_action( 'admin_bar_menu', array( $this, 'adminBarMenu' ), 100 ); $container->set( 'cachePurger', $cachePurger ); $container->set( 'hasMustUsePlugin', file_exists( WPMU_PLUGIN_DIR . '/endurance-page-cache.php' ) ); + + ! defined( 'NFD_PERFORMANCE_PLUGIN_LANGUAGES_PATH' ) && define( 'NFD_PERFORMANCE_PLUGIN_LANGUAGES_PATH', dirname( $container->plugin()->basename ) . '/vendor/newfold-labs/wp-module-performance/languages' ); + add_action( 'init', array( $this, 'load_text_domain'), 100 ); } /** @@ -137,6 +137,17 @@ function () { add_filter( 'action_scheduler_cleanup_batch_size', array( $this, 'nfd_as_cleanup_batch_size' ) ); } + /** + * Load module text domain + */ + public function load_text_domain() { + load_plugin_textdomain( + 'wp-module-performance', + false, + NFD_PERFORMANCE_PLUGIN_LANGUAGES_PATH + ); + } + /** * Update the default action scheduler retention period to 5 days instead of 30. * The actions scheduler table tends to grow to gigantic sizes and this should help. @@ -251,14 +262,14 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) { $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu', - 'title' => __( 'Caching', 'newfold-module-performance' ), + 'title' => __( 'Caching', 'wp-module-performance' ), ) ); $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu-purge_all', - 'title' => __( 'Purge All', 'newfold-module-performance' ), + 'title' => __( 'Purge All', 'wp-module-performance' ), 'parent' => 'nfd_purge_menu', 'href' => add_query_arg( array( self::PURGE_ALL => true ) ), ) @@ -268,7 +279,7 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) { $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu-purge_single', - 'title' => __( 'Purge This Page', 'newfold-module-performance' ), + 'title' => __( 'Purge This Page', 'wp-module-performance' ), 'parent' => 'nfd_purge_menu', 'href' => add_query_arg( array( self::PURGE_URL => true ) ), ) @@ -278,7 +289,7 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) { $wp_admin_bar->add_node( array( 'id' => 'nfd_purge_menu-cache_settings', - 'title' => __( 'Cache Settings', 'newfold-module-performance' ), + 'title' => __( 'Cache Settings', 'wp-module-performance' ), 'parent' => 'nfd_purge_menu', 'href' => admin_url( 'options-general.php#' . Performance::SETTINGS_ID ), ) diff --git a/includes/functions.php b/includes/functions.php index bd4b113..451d3c0 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -61,7 +61,7 @@ function getSkip404Option() { function getSkip404InputField() { $name = Performance::OPTION_SKIP_404; $value = getSkip404Option(); - $label = __( 'Skip WordPress 404 Handling for Static Files', 'wp-module-performance' ); + $label = __( 'Skip WordPress 404 Handling For Static Files', 'wp-module-performance' ); ?> 1);\n" +"X-Generator: Poedit 3.2.2\n" +"X-Domain: wp-module-performance\n" + +#: includes/CacheTypes/Skip404.php:53 includes/functions.php:64 +msgid "Skip WordPress 404 Handling For Static Files" +msgstr "Ignorar o tratamento de erro 404 do WordPress para arquivos estáticos" + +#: includes/functions.php:37 includes/Performance.php:233 +msgid "Cache Level" +msgstr "Nível de cache" + +#: includes/Performance.php:226 includes/Performance.php:265 +msgid "Caching" +msgstr "Cache" + +#: includes/Performance.php:272 +msgid "Purge All" +msgstr "Limpar Tudo" + +#: includes/Performance.php:282 +msgid "Purge This Page" +msgstr "Limpar esta página" + +#: includes/Performance.php:292 +msgid "Cache Settings" +msgstr "Configurações de cache" diff --git a/languages/wp-module-performance.pot b/languages/wp-module-performance.pot index 8158355..97f647b 100644 --- a/languages/wp-module-performance.pot +++ b/languages/wp-module-performance.pot @@ -13,18 +13,28 @@ msgstr "" "X-Domain: wp-module-performance\n" #: includes/CacheTypes/Skip404.php:53 +#: includes/functions.php:64 msgid "Skip WordPress 404 Handling For Static Files" msgstr "" #: includes/functions.php:37 -#: includes/Performance.php:222 +#: includes/Performance.php:233 msgid "Cache Level" msgstr "" -#: includes/functions.php:64 -msgid "Skip WordPress 404 Handling for Static Files" +#: includes/Performance.php:226 +#: includes/Performance.php:265 +msgid "Caching" msgstr "" -#: includes/Performance.php:215 -msgid "Caching" +#: includes/Performance.php:272 +msgid "Purge All" +msgstr "" + +#: includes/Performance.php:282 +msgid "Purge This Page" +msgstr "" + +#: includes/Performance.php:292 +msgid "Cache Settings" msgstr ""