Title: Localization issue
Last modified: March 1, 2019

---

# Localization issue

 *  Resolved [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/)
 * It seems that the plugin makes the language file inside the plugin directory (`
   plugins/wc-frontend-manager/lang`) a priority rather than the one on `wp-content/
   languages/plugins`.
 * This is a problem when we want to use our own translation file outside the plugin
   directory.
 * In your plugin there’s a call to the function `load_textdomain` twice so the 
   first translation will override the second one. Not sure why you didn’t use a
   single `load_plugin_textdomain()` instead?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * (@wclovers)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/#post-11262973)
 * Hi,
 * Here is WCFM localization load code – [https://ibb.co/JFZj1fp](https://ibb.co/JFZj1fp)
 * We have prioritize “wp-content/languages/plugins” over “plugins/wc-frontend-manager/
   lang”.
 * And it works perfectly for all translation plugins (Loco Translate etc …)
 * Please be sure with your “.mo” file it’s properly named.
 * Thank You
 *  Thread Starter [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/#post-11263017)
 * Thanks, the way it works though is that the first language file that’s loaded
   will override the succeeding ones. It’s also right there in the top comment of
   your method 🙂
 * That’s why I suggested `load_plugin_textdomain` since it has a builtin logic 
   to check the languages directory first –
 *     ```
           // Try to load from the languages directory first.
           if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) {
               return true;
           }
   
           if ( false !== $plugin_rel_path ) {
               $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
           } elseif ( false !== $deprecated ) {
               _deprecated_argument( __FUNCTION__, '2.7.0' );
               $path = ABSPATH . trim( $deprecated, '/' );
           } else {
               $path = WP_PLUGIN_DIR;
           }
       ```
   
 * Cheers
 *  Plugin Author [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * (@wclovers)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/#post-11265950)
 * Thanks for the suggestion, we will definitely look into this 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Localization issue’ is closed to new replies.

 * ![](https://ps.w.org/wc-frontend-manager/assets/icon-256x256.jpg?rev=1800818)
 * [WCFM - Frontend Manager for WooCommerce](https://wordpress.org/plugins/wc-frontend-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-frontend-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-frontend-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-frontend-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-frontend-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-frontend-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/#post-11265950)
 * Status: resolved