Title: using load_textdomain instead of load_plugin_textdomain function
Last modified: August 21, 2016

---

# using load_textdomain instead of load_plugin_textdomain function

 *  Resolved [bitbusters](https://wordpress.org/support/users/bitbusters/)
 * (@bitbusters)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/using-load_textdomain-instead-of-load_plugin_textdomain-function/)
 * Hi,
    According to the [Codestyling Localization] plugin for translating themes
   and plugins online in an existing installation, Media Library Assistant has a:“
   Loading Issue: Author is using load_textdomain instead of load_plugin_textdomain
   function. This may break behavior of WordPress, because some filters and actions
   won’t be executed anymore. Please contact the Author about that.” The installation
   behaves strangely, I’m not sure what is the reason, but it might be that. I’m
   not that deep into WP to be able to help… But I wanted to let you guys know.
 * [https://wordpress.org/plugins/media-library-assistant/](https://wordpress.org/plugins/media-library-assistant/)

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

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/using-load_textdomain-instead-of-load_plugin_textdomain-function/#post-5030009)
 * Thank you for bringing this issue to my attention. I have downloaded and activated
   CodeStyling Localization version 1.99.30, by Heiko Rabe. When I navigate to the
   Tools/Localization screen (Manage Language Files) I can see the message you quote
   in your post.I believe this is more an issue for CodeStyling Localization than
   for MLA.
 * Here is the code MLA uses to load language files:
 *     ```
       /*
        * To override the plugin's translation files for one, some or all strings,
        * create a sub-directory named 'media-library-assistant' in the WordPress
        * WP_LANG_DIR (e.g., /wp-content/languages) directory.
        */
       load_textdomain( $text_domain, trailingslashit( WP_LANG_DIR ) . $text_domain . '/' . $text_domain . '-' . $locale . '.mo' );
       load_plugin_textdomain( $text_domain, false, MLA_PLUGIN_BASENAME . '/languages/' );
       ```
   
 * As you can see, MLA does in fact use `load_plugin_domain` to load its own language
   files. The additional call to `load_textdomain` allows a plugin user to override
   some or all of the translations provided by MLA with their own translations. 
   This is a common technique, which I adapted from these articles:
    - [How to load theme and plugin translations](http://ulrich.pogson.ch/load-theme-plugin-translations)
    - [How to load your plugin and theme language files](http://www.wpinsite.com/articles/how-to-load-your-plugin-theme-language-files)
    - [Language Packs 101 – Prepwork](http://ottopress.com/2013/language-packs-101-prepwork/)
 * I looked through the CodeStyling Localization source code and found the source
   of its message in `codestyling-localization.php`, function `csp_po_get_plugin_capabilities`.
   This function goes through the plugin source files looking for calls to the domain-
   loading functions. However, it only looks for one call and stops after finding
   the first call. For MLA, this means that the second call is never found and processed.
 * I will report my findings to the CodeStyling Localization author. According to
   the [plugin’s official website](http://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en),
   support is only available by e-mailing the author. He does not monitor or respond
   to opsts in the WordPress Respository Support Forum for the plugin.
 * I am marking this issue resolved because I do not believe any changes to MLA 
   are required. I don’t believe any of the strange behavior you mentioned is caused
   by MLA, but please update this topic if you have problems or further questions
   about this topic. Thanks for your interest in MLA.
 *  [thenorth3000](https://wordpress.org/support/users/thenorth3000/)
 * (@thenorth3000)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/using-load_textdomain-instead-of-load_plugin_textdomain-function/#post-5030136)
 * Hello,
 * I’m also facing with this issue when i tried to translate Flatsome theme and 
   WooCommerce plugin. Do you have any idea about this?
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/using-load_textdomain-instead-of-load_plugin_textdomain-function/#post-5030137)
 * Thanks for your question. I do not have any experience with the “**_Flatsome 
   theme_**“. I have used Woocommerce in a few different languages and have not 
   encountered this issue with that plugin.
 * If you are having a specific problem with MLA, can you give me more details? 
   You can update this topic or start a new one and I will give you what help I 
   can.

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

The topic ‘using load_textdomain instead of load_plugin_textdomain function’ is 
closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

## Tags

 * [textdomain](https://wordpress.org/support/topic-tag/textdomain/)

 * 3 replies
 * 3 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/using-load_textdomain-instead-of-load_plugin_textdomain-function/#post-5030137)
 * Status: resolved