From the source code of load_plugin_textdomain
it becomes appararent that the function will first look for $domain . '-' . $locale . '.mo'
(so, that’s myplugin-fr_FR.mo
) in WP_LANG_DIR . '/plugins/' . $mofile
.
Only when the file is not there, it will start looking at the specified path and if it is not there in the main plugin directory. So, if you don’t get the mo-file in the specified directory, either it isn’t there or you are supplying the wrong path.
I cannot see whether you have made any typos, but instead of combining dirname
and plugin_basename
you might want to stick to plugin_dir_path
to supply the correct directory.
Related Posts:
- Overwrite textdomain of plugins by default – Lost Translation
- How can I translate the name of my Plugin for other languages?
- Custom values are not translated
- Plugin translations problem
- Language Translation is not working?
- What is the way to ship read-me strings like plugin-strings for internationalization?
- Making my plugin translation ready. Poedit not working
- Internationalization: Not loading plugin translated text
- load_theme_textdomain path
- Read text defined under __()
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Two text domains in one plugin
- What can be reason for no plugin-strings available under stable section on translate.wordpress.org?
- Is there a way to test that readme looks in other language before submitting translation?
- Translation issue with global variables
- How to ignore extra whitespaces in translation functions like _e?
- How does translation (gettext) work for translating config file of plugin?
- Plugin not properly prepared for localization
- Rename existing cpt and taxonomy with new textdomain
- Translation for a text that is not printed on the screen
- Use localized plugin name and description even when the plugin is disabled
- Plugin: Translated plugin is “not translated”
- WP internationalization not loaded
- Plugin translations are not loaded from translate.wordpress.org
- Update plugin from personal API
- Does a plugin’s “main” file need to be named the same as the folder containing it?
- Symlinked plugin directory doesn’t appear in Admin
- How can I limit functionality in one version of a plugin?
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- WordPress widget / plugin….fields not appearing in my widget
- This doesnt work for Plugin get_template_directory_uri()
- What is $tab in `install_plugins_{$tab}` hook?
- WordPress hook for visiting a post
- Fatal error: Class not found in
- How do I use WordPress PHP functions in my Javascript code?
- What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?
- Passing $this->get_field_name() to javascript
- add_action in functions.php, do_action in plugin?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Simple ajax call not working in wordpress plugin
- How to save post change url youtube link?
- __callStatic method handler passed to add_action causes bug in PHP
- how to disable blockrenderAppender inside all Innerblocks?
- Redirection of users away from wp-admin (but not administrators)
- Plugin-generated pages use Not Found or Pages Archive templates?
- Change commission_status paid when withdraw_status vendor is completed
- WordPress Plugin [closed]
- Proper way to replace the_content only for pages created by custom plugin
- Certain functions are undefined when called form mu-plugins
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Using wordpress translations strings in plugin
- Can plugin2 uninstall plugin1 at the very beginning of plugin2’s installation?
- plugin dev – minimum base css specificity?
- I changed font of wordpress dashboard but it is slow!
- Get Every Key & Value from Array then Display All in New Line
- Creating a functionality plugin to edit seriously simple podcasting
- Plugin temporary files and files to download via FTP
- Make plugin php file called directly aware of WordPress?
- sending different email notification while registration based on user role
- How to add credit card validation check to wordpress [closed]
- Next Previous Post in wordpress with previous / next link with title?
- How to use existing hook in twentytwelve to all theme of wordpress?
- How to get a notification when the plugin is installed?
- WordPress Post HTML after Posting
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Settings options not showing up on Sub Menu page in WordPress plugin
- Remove List Bullets
- Custom Meta box change size
- How to set plugin auto-update Enabled by default?
- The Build menu theme is frozen with the wordpress theme
- How to translate wordpress blog to other languages?
- How to translate to spanish wordpress hardcoded content/files?
- what functions to use to resize images and create DB metadata for them after/during upload?
- How to Create a Learning Management Plugin in WordPress to Manage Courses [LMS]
- How to prevent redoing get_posts queries and make results available to other scripts?
- Store admin page into variable
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Overwriting Plugin’s Ajax callback function from theme
- How can I get the Post ID and Post Type within a Must Use Plugin?
- Unable to sync woocommerce variations
- Can’t find variable is_single in my jQuery plugin
- WordPress Cron function is not working
- Plugin hook breaks new WP 4.0 media library grid view?
- How to get site homepage from plugin?
- Get page type to display content
- Widget redirecting to home page
- Is an Office a custom post type [closed]
- How to add image for custom taxonomy
- I am using multi image metabox plugin but I did get how to display the images in templete?
- wordpress Ajax success doesn’t return the value
- How to open author url linked to a new tab in settings page in the WordPress plugin list
- How can I properly sanitize the update_option in WordPress?
- Why is my menu page not being displayed?
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How to update changes to multiple sites at the same time
- Why am I getting an error when requiring a file in my plugin?
- Running a function using Crown WordPress on one day a week, for example, Mondays of every week
- How to make a Template page to show the information of different things Shop and Product page?