| 1 |
<?php |
| 2 |
/** |
| 3 |
* The plugin internationalization class. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
* |
| 7 |
* @package woo-additional-terms |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Woo_Additional_Terms; |
| 11 |
|
| 12 |
/** |
| 13 |
* Loads and defines the internationalization files for this plugin. |
| 14 |
*/ |
| 15 |
abstract class I18n { |
| 16 |
|
| 17 |
/** |
| 18 |
* Load the plugin text domain for translation. |
| 19 |
* |
| 20 |
* @since 1.0.0 |
| 21 |
* |
| 22 |
* @return void |
| 23 |
*/ |
| 24 |
public static function textdomain() { |
| 25 |
|
| 26 |
$domain = 'woo-additional-terms'; |
| 27 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
| 28 |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
| 29 |
|
| 30 |
// Load the translation file for current language. |
| 31 |
load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . "{$domain}/{$domain}-{$locale}.mo" ); |
| 32 |
load_plugin_textdomain( $domain, false, woo_additional_terms()->service( 'file' )->dirname() . '/languages/' ); |
| 33 |
} |
| 34 |
} |
| 35 |
|