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
- Does a wordpress custom plugin is fired by default on php theme ajax request?
- How to use native wordpress translation domain inside a custom plugin?
- jquery & ajax sending data to php
- wp_localize_script is not adding a global variable for javascript
- Plugin uninstall function is not working
- Bug: Post needs to be updated twice when adding action for save_post hook
- Can’t get AJAX call working in custom plugin
- Bad Request in AJAX
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- 400 Bad Request, in wordpress theme development, wp_ajax
- flush rewrite rules after plugin update?
- When does save_post hook fire on post save/update
- Plugin does not add action
- Ajax is not working in a loop
- Remove an action by extending class and replacing it
- ajax recursive calls on wordpress returning answers outsite the function scope
- esc_html__() and __() not working within arrays
- How to prevent someone from entering strings without making it available for translation?
- Ajax submit result opens in admin-ajax.php
- Readme.txt seems to be cached but not the version
- Add child pages to submenu automatically
- Are there any security risks when submitting data-attribute data through AJAX?
- After plugin activation hook
- How to replace default comments with custom HTML?
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)
- How can I create a custom plugin that allows anonymous users to signup without registering?
- hook filter after the_content on a specific page
- Return Value of load_plugin_textdomain
- Bind a function with its own argument to show something dynamically after every content
- Is there an admin hook that will let me read GET variable before it’s too late to set the header Location
- insert query on a custom table using ajax with jQuery plugin Jeditable
- How to get error object returned by wp_create_user
- Plugin AJAX Save to Custom Table
- Why enqueue styles on hook?
- What’s the hook for filtering every texts of site?
- Translate javascript with WordPress built-in localization API for static strings
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- Associate multiple email addresses with the same user account, so they can log in with either
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Run command “composer install” when activating wordpress plugin
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- Plugin language always shows WP site language, not profile language
- Is hint for translator compulsory while internationalizing a string containing variables?
- Update variable value via add_filter
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- WP ajax requests not stacking?
- Add a check box in Menu Settings
- Custom filter not working
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- hook update_option/updated_option empty $old_value and $value
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- Translating plugin settings page – dropdown list
- Make dynamic string translatable
- AJAX button with success callback. (Titan Framework)
- ajax working when function is on child theme but not in plugin page
- AJAX call to admin-ajax.php by subscriber returns home page
- Configure WordPress to Generate Scheme-less Relative URLs
- Hide one specific woocoomerce product
- Using HTML links within translatable string
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- How to find list of all functions bind to a particular hook from my plugin?
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Ajax function is not working on WordPress
- About a programming language starts with [closed]
- Best practice for plugin: always detect admin-ajax call?
- add_action wp_ajax_ not loading in plugin file WP Network
- Why is the form not updating when I select a new sector from the list?
- Workflow for new importer plugin – your advices?
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Plugin Form Submitting to admin-ajax.php instead of admin-post.php
- How to translate wordpress backend to another language
- How to replace settings in WordPress plugin from a theme
- Redirect returning users to a certain page?
- Borrowing of Previously Translated Strings by Child Plugin
- Restrict certain actions to plugin-specific admin menu pages only
- AJAX request not routing through proxy
- Get cat parameter from admin-ajax
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- Creating posts with links from a txt file
- Set the payment processor callbacks to a plugin
- Ajax on the Administration Side of plugin – returns 0
- How to do admin ajax request in a plugin for rest api
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- Getting Post ID at “stylesheet” and “template” hooks
- Ajax action has 200 status but response of No response data available for this request
- Jquery php request is returning a weird result
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook