Recommended
1 year ago
Support
1 year ago
Cross.php
1 year ago
Fallback.php
1 year ago
Fields.php
1 year ago
Helper.php
1 year ago
I18n.php
1 year ago
Plugin.php
1 year ago
Popup.php
1 year ago
PostType.php
1 year ago
Review.php
1 year ago
Settings.php
1 year ago
Shortcode.php
1 year ago
Upgrade.php
1 year ago
I18n.php
29 lines
| 1 | <?php |
| 2 | namespace NTA_WhatsApp; |
| 3 | |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | /** |
| 6 | * I18n Logic |
| 7 | */ |
| 8 | class I18n { |
| 9 | public static function loadPluginTextdomain() { |
| 10 | if ( function_exists( 'determine_locale' ) ) { |
| 11 | $locale = determine_locale(); |
| 12 | } else { |
| 13 | $locale = is_admin() ? get_user_locale() : get_locale(); |
| 14 | } |
| 15 | unload_textdomain( 'wp-whatsapp' ); |
| 16 | load_textdomain( 'wp-whatsapp', NTA_WHATSAPP_PLUGIN_DIR . '/languages/' . $locale . '.mo' ); |
| 17 | load_plugin_textdomain( 'wp-whatsapp', false, NTA_WHATSAPP_PLUGIN_DIR . '/languages/' ); |
| 18 | } |
| 19 | |
| 20 | public static function getTranslation() { |
| 21 | $translation = array( |
| 22 | 'online' => __( 'Online', 'wp-whatsapp' ), |
| 23 | 'offline' => __( 'Offline', 'wp-whatsapp' ), |
| 24 | ); |
| 25 | |
| 26 | return $translation; |
| 27 | } |
| 28 | } |
| 29 |