Use plugin_locale filter:
apply_filters( 'plugin_locale', $locale, $domain );
Change locale like this:
$my_plugin_domain = 'my_plugin_domain_name';
$override_locale="es-ES";
add_filter('plugin_locale',
function ($locale, $domain) use ($my_plugin_domain, $override_locale) {
if($domain == $my_plugin_domain) {
$locale = $override_locale;
}
return $locale;
}, 10, 2);
Related Posts:
- Why load_textdomain work but not load_plugin_textdomain?
- Force language in translate function
- Edit plugin without hooks in functions.php
- Override plugin localization
- How can I translate the name of my Plugin for other languages?
- 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
- Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?
- load_theme_textdomain path
- 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?
- Can I load the textdomain before a plugin is activated?
- Translations for my plugin don’t show up
- Translation issue with global variables
- How to ignore extra whitespaces in translation functions like _e?
- Plugin not properly prepared for localization
- Use localized plugin name and description even when the plugin is disabled
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Show Similar Post Titles ( Similar to Stack Exchange )
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Add content to /wp-admin/plugin-install.php admin screens
- How do I only load a plugin js on it’s settings pages?
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Is it necessary to translate WordPress key terms when localizing a plugin
- Activate Plugin which is in subfolder?
- Use functionality of 2 wordpress plugins
- Autoload via composer in plugin interference
- Can WordPress plugins “Talk to each other”?
- How do I store information in a dynamic block in WordPress?
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- Find the URL of the current plugin directory
- How can sanitize $_FILES[‘haq_slider’] field
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- Woocommerce plugin for minimum order and add-to-card-step
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Get plugin option in another PHP file
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- where is the main file in this plugin?
- Remove .htaccess portion upon plugin deactivation?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- First plugin, problem with get_pages
- Plugin onclick button activate other plugin
- Is there a better way of handling AJAX requests in WordPress?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add category and subcategory in WordPress custom code?
- Structuring function with registration_errors hook
- Can’t create tables with my plugin
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- using wp_cache in plugin
- Should I use the action in the plugin’s main file?
- wp_query ‘s’ parameter does not work with WC_AJAX
- Monitor all the queriers executed by my website
- Dotenv file in custom plugin
- Problem with MEMCACHE and Redis with wp_options
- Change plugin descriptions
- Getting the same post on my related post
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to remove WordPress Default Comment? not Facebook
- How to use Datatable with Ajax when creating plugin on WordPress?
- Create survey that redirects to sidebar menu customized to answers
- Changing author slug for a custom role without using plugin
- plugin operation launch every time i click on page
- WP options plugin setting not saving the selected checkboxes
- How can I customize Easy Appointment plugin?
- How to get post that has non zero or greater than zero meta value
- how to add custom css at top above all css file for specific url
- How do I change a plugin language of only one page?
- Form tries to download a file on submit
- Coming soon pages with rest of site in maintenance mode
- insert multiple entries in database using a loop issue
- wp_verify_nonce fails always
- Custom Plugin: Point to `template_directory`
- Adding list of Indexes in wordpress document
- API Functions to Register and Show WordPress List Tables
- How to save default values into an option and delete those upon actvation and deactivation in wordpress?
- Plugin options not appearing on options page using tabbed navigation
- Ajax, jQuery and WordPress
- Add custom fields in the new and edit the site forms without touching the WP core
- Extend WordPress REST API with Scheme Pro Plugin
- How to submit the custom form data in database in WordPress without plugin?
- map urls to plugins
- Embed php code in custom field of a plugin [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- Suitable hook when creating, updating and deleting posts programmatically
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How can I gather forums posted by visitors from different sites in one place? [duplicate]
- How to make content as required in custom post type?
- How to create a “Most Popular” & “Latest” TAB in WordPress
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode