Activation
5 years ago
Admin
5 years ago
Container
5 years ago
Front
5 years ago
Moment
5 years ago
Rest
5 years ago
Widget
5 years ago
Bootstrap.php
5 years ago
Cache.php
5 years ago
Helper.php
5 years ago
I18N.php
5 years ago
Image.php
5 years ago
Output.php
5 years ago
Query.php
5 years ago
Settings.php
5 years ago
Themer.php
5 years ago
Translate.php
5 years ago
WordPressPopularPosts.php
5 years ago
deprecated.php
5 years ago
template-tags.php
5 years ago
I18N.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Define the internationalization functionality |
| 4 | * |
| 5 | * Loads and defines the internationalization files for this plugin |
| 6 | * so that it is ready for translation. |
| 7 | * |
| 8 | * @since 4.0.0 |
| 9 | * |
| 10 | * @package WordPressPopularPosts |
| 11 | */ |
| 12 | |
| 13 | namespace WordPressPopularPosts; |
| 14 | |
| 15 | class I18N { |
| 16 | /** |
| 17 | * WordPress hooks. |
| 18 | * |
| 19 | * @since 5.0.0 |
| 20 | */ |
| 21 | public function hooks() |
| 22 | { |
| 23 | add_action('plugins_loaded', [$this, 'load_plugin_textdomain']); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Load the plugin text domain for translation. |
| 28 | * |
| 29 | * @since 1.0.0 |
| 30 | */ |
| 31 | public function load_plugin_textdomain() |
| 32 | { |
| 33 | $locale = apply_filters('plugin_locale', get_locale(), 'wordpress-popular-posts'); |
| 34 | load_textdomain('wordpress-popular-posts', WP_LANG_DIR . '/' . 'wordpress-popular-posts' . '/' . 'wordpress-popular-posts' . '-' . $locale . '.mo'); |
| 35 | } |
| 36 | } |
| 37 |