Skip to content

Commit ead9544

Browse files
committed
Properly load translations
1 parent e65f6a8 commit ead9544

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

RandomPostOnRefresh.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ class RandomPostOnRefresh {
3131
* Initialize the plugin.
3232
*/
3333
public static function initialize() {
34-
load_plugin_textdomain( 'random-post-on-refresh', false, __DIR__ . '/languages' );
34+
add_action( 'init', array( __CLASS__, 'load_textdomain' ) );
3535
add_filter( 'widget_text', 'do_shortcode' );
3636
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'wp_enqueue_scripts' ) );
3737
add_shortcode( self::SHORTCODE, array( __CLASS__, 'shortcode' ) );
3838
}
3939

40+
public static function load_textdomain() {
41+
load_plugin_textdomain( 'random-post-on-refresh', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
42+
}
43+
4044
/**
4145
* Enqueue style.
4246
*/

0 commit comments

Comments
 (0)