If anybody else is looking for the anwser , Here it is
function load_txtdomain() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'my-plugin' );
load_textdomain( 'my-plugin', WP_LANG_DIR . '/my-plugin-' . $locale . '.mo' );
}
add_action('plugins_loaded','load_txtdomain');
Related Posts:
- Plugin translations not installed but… strings are translated!
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- Translation not working for Constant strings in Plugin
- How to make a WordPress plugin translation ready?
- How to provide translations for a WordPress TinyMCE plugin?
- translation does not work with text_domain
- Problems with localization
- Multiple textdomains
- How does gettext works for translating readme file of plugin?
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- use __($str) to translate strings (symfony/twig)
- Plugin Localization
- Is it possible to check is loaded language files correctly with WordPress plugin?
- Translate strings not recognised in plugin
- How to i18n text coming from the db or from an external source
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- Should shorcodes in i18n plugins be translated and if so, how?
- Widget translation on my plugin
- Generate JSON files for language translation from po file without wp-cli i18n make-json
- Build a translation correcter plugin
- Translation per IP location [closed]
- Translate slug in WPMU with PO files
- Translate MCE button text/tooltip in custom plugin
- esc_html__() and __() not working within arrays
- How to prevent someone from entering strings without making it available for translation?
- Readme.txt seems to be cached but not the version
- Return Value of load_plugin_textdomain
- Translate javascript with WordPress built-in localization API for static strings
- Plugin language always shows WP site language, not profile language
- Is hint for translator compulsory while internationalizing a string containing variables?
- Translating plugin settings page – dropdown list
- Make dynamic string translatable
- Using HTML links within translatable string
- How to translate wordpress backend to another language
- Borrowing of Previously Translated Strings by Child Plugin
- Include external po file for 3th party plugin to theme
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Load custom translation in custom plugin fails
- Add language localisation to javascript alert?
- How to store in the database directly the translation?
- Plugin translation not being displayed
- Problem with Poedit [closed]
- How to translate WP plugin name?
- get the queried_object of an url
- Save translation file of third party plugin in a custom plugin?
- What process do you use for WordPress development? [closed]
- How do I create a custom role capability?
- Where to put third party PHP library?
- Add a new tab to WordPress Plugin install Listing
- Export data as CSV in back end with proper HTTP headers
- How to integrate a PHP webmail script into the backend of WordPress?
- How to Get a List of Sub Blogs without Using get_blog_list()?
- Can I add pages to my custom menu via script?
- what is the best practice for including ‘wp-includes’ classes
- Programmatically Selecting Theme Based on URL
- Custom Plugin Database relations
- Save user-specific options in WordPress admin
- Why is print_r returning $classObj->userObj in several places on site
- Plugin development: is adding empty index.php files necessary?
- Customize multisite site creation with user data
- Adding plugin settings link upon activation
- Proper way to run wp_query from inside a plugin
- Buddypress function and global $bp question
- Custom plugin: Loop through taxonomy types and update columns for all types?
- Maximum lifetime for nonce
- How to Display my HTML form in my Custom Plugin?
- Adding rewrite rule dynamically
- Incorporate small angular feature in my wordpress site
- Use just a shortcode from another page
- How can I avoid conflicts between plugin and theme?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- $wpdb->prepare with LIKE and sprintf
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Quasi-custom API Call Plugin
- How can I show posts for a single category?
- Show content without a post
- WP ajax requests not stacking?
- In wordpress plugin wp_signon shows error
- Is it possible to load the css just on my plugin admin page?
- How to create taxonomy without using register_taxonomy () function
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- Get audio metadata on file upload
- Loading Images from Javascript on the Front End
- Custom payment method after payment user is logged out on thank you page
- The URL of images on my website changed after being set as featured image
- Use localized plugin name and description even when the plugin is disabled
- extraprops override existing props
- converting a node.js project into a wp plugin
- how to handle premium features in a wordpress plugin?
- Unexpected issue when using attachment_fields_to_edit filter
- How Can I Update wp_enqueue_scripts () From WordPress Option Page Radio Buttons
- When using an options array the Settings API isn’t creating the database record
- the correct way to use options from settings page [closed]
- On one of my sites a file is shown as 404 but the file IS there
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Need someone to help you want to manage points for members to code interface functions? thank you
- Run different permission_callback depending on HTTP method of custom REST API endpoint