I think you just need to load the translations earlier to make them available for ajax hooks:
add_action( 'plugins_loaded', 'myplugin_load_textdomain' );
function myplugin_load_textdomain() {
load_plugin_textdomain( 'myplugin', false, basename( dirname( __FILE__ ) ) . '/languages' );
}
Related Posts:
- Get returned variable from a function to add_shortcode function
- WordPress Ajax callback function from plugin – OOP
- Plugin translations not installed but… strings are translated!
- template_redirect or admin-ajax.php?
- Ajax +wordpress onClick link redirect to new page and create html content
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- Translation not working for Constant strings in Plugin
- Load textdomain from global languages directory
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Difference Between Filter and Action Hooks?
- How to make a WordPress plugin translation ready?
- How many times will this code run? (or, how rich is grandma?)
- add_action hook for completely new post?
- How can I run AJAX on a button click event?
- WordPress Hook for user register
- Using filters and actions for plugin API?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- Empty POST data on server on AJAX request using Angular $http
- wp_localize_script $handle
- What’s the difference between hooks, filters and actions? [duplicate]
- How to check if certain plugin exists and in expected version
- Built in admin ajax hooks?
- How to post form in ajax mode and handle it in wordpress
- Using Ajax call in jQuery doesn’t work in widget
- Plugin Localization
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- Order of Operation for these three hooks
- Modifying values with add_action to be sent to db
- save_post hook not triggered in WP v3.6.1
- Ajax in WordPress – path issue
- Hook to get image filename when it is uploaded
- How to display a message about updates in the plugin list
- How to delete an user including data from custom database tables
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- What filter should I use to insert a button inside on Media>Add New
- Slow WP_query due to nested wp_query. Need Suggestions
- Conditional hook based on the core function that is calling it
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Send push when new post is published in a certain category
- Storing data in wordpress database from ajax call from different website
- Create custom HTML/JS app inside page
- Translation per IP location [closed]
- Translate MCE button text/tooltip in custom plugin
- use of do_action() without any functions attached
- How to get all queries’s results after they have executed?
- wp_localize_script is not adding a global variable for javascript
- Ajax is not working in a loop
- esc_html__() and __() not working within arrays
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Bind a function with its own argument to show something dynamically after every content
- How to get error object returned by wp_create_user
- What’s the hook for filtering every texts of site?
- Hook add_attachment error
- Associate multiple email addresses with the same user account, so they can log in with either
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Update variable value via add_filter
- Custom filter not working
- hook update_option/updated_option empty $old_value and $value
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- ajax working when function is on child theme but not in plugin page
- Configure WordPress to Generate Scheme-less Relative URLs
- How to find list of all functions bind to a particular hook from my plugin?
- About a programming language starts with [closed]
- Workflow for new importer plugin – your advices?
- How to do admin ajax request in a plugin for rest api
- Ajax action has 200 status but response of No response data available for this request
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- Bad request 400 using class based files
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- ajax-action.php can’t find added action
- AJAX call of function containing javascript which is not loaded (Plugin development)
- Problem in plugin debuging in wordpress
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- OOP development and hooks
- How to include files in the loop via ajax
- How to handle ajax Request in a complex-structured plugin?
- Filterable posts using categories
- Add_action not calling callback function
- PHP includes with AJAX actions
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- WordPress function is not called and ajax return 0
- add_option_{$option} action hook not being called
- Function not working on any file other than the main plugin file
- Multi hook deploiement
- woocommerce single product page hook not working
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Plugin translation not being displayed
- What is the use of wp_schedule_event hook?
- How do I replace title with my plugin?
- Page reload occurs before request finishes
- Problem with Poedit [closed]
- Insert plugin html content to a specific spot in the frontpage
- get_term_by() returning null on plugin
- Ninja Forms: Front-End Forms, Post ID?
- Execute callback after REST API request completes + Response is sent