public function text_domain() { // Set unique textdomain string $textdomain = 'backupwordpress'; // The 'plugin_locale' filter is also used by default in load_plugin_textdomain() $locale = apply_filters('plugin_locale', get_locale(), $textdomain); // Set filter for WordPress languages directory $hmbkp_wp_lang_dir = apply_filters('hmbkp_do_filter_wp_lang_dir', trailingslashit(WP_LANG_DIR) . trailingslashit($textdomain) . $textdomain . '-' . $locale . '.mo'); // Translations: First, look in WordPress' "languages" folder = custom & update-secure! load_textdomain($textdomain, $hmbkp_wp_lang_dir); // Translations: Secondly, look in plugin's "languages" folder = default load_plugin_textdomain($textdomain, false, HMBKP_PLUGIN_LANG_DIR); }