HM\BackUpWordPress\Plugin::text_domain PHP Method

text_domain() public method

This setup allows a user to just drop his custom translation files into the WordPress language directory Files will need to be in a subdirectory with the name of the textdomain 'backupwordpress'
public text_domain ( )
    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);
    }