Recommended
2 years ago
Support
2 years ago
Cross.php
2 years ago
Fallback.php
2 years ago
Fields.php
2 years ago
Helper.php
2 years ago
I18n.php
2 years ago
Plugin.php
2 years ago
Popup.php
2 years ago
PostType.php
2 years ago
Review.php
2 years ago
Settings.php
2 years ago
Shortcode.php
2 years ago
Upgrade.php
2 years 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('ninjateam-whatsapp'); |
| 16 | load_textdomain('ninjateam-whatsapp', NTA_WHATSAPP_PLUGIN_DIR . '/languages/' . $locale . '.mo'); |
| 17 | load_plugin_textdomain('ninjateam-whatsapp', false, NTA_WHATSAPP_PLUGIN_DIR . '/languages/'); |
| 18 | } |
| 19 | |
| 20 | public static function getTranslation(){ |
| 21 | $translation = array( |
| 22 | 'online' => __('Online', 'ninjateam-whatsapp'), |
| 23 | 'offline' => __('Offline', 'ninjateam-whatsapp') |
| 24 | ); |
| 25 | |
| 26 | return $translation; |
| 27 | } |
| 28 | } |
| 29 |