global $langOK;
add_action( 'plugins_loaded', 'myplugin_load_textdomain' );
function myplugin_load_textdomain() {
global $langOK;
$langOK = load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
Later you can check the value of $langOK
( TRUE = success, FALSE = failure ).
Related Posts:
- How to make a WordPress plugin translation ready?
- How to provide translations for a WordPress TinyMCE plugin?
- Problems with localization
- 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
- Plugin translations not installed but… strings are translated!
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- 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
- 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
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- 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?
- Translation not working for Constant strings in Plugin
- Load textdomain from global languages directory
- 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?
- WordPress Update Plugin Hook/Action? Since 3.9
- How come `wp_options` table does not have an index on `autoload`?
- Best way to abort plugin in case of insufficient PHP version?
- Optimize shortcode callbacks
- Modifying the way WP sets cookies
- How to get vim to autocomplete WordPress API functions?
- How do I make specific plugin functionality apply to different sites in a network?
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- How to add multiple copies of a widget from “available widgets”
- How do I approach removing menu items on the fly based on settings in my plugin?
- Can I use core’s “or Link to Existing Content” feature in my plugin?
- Plugin with specific admin menu icon
- using new WP_Query in save_post function alters $post
- Preview Changes button missing on custom post type page since updating to 3.4
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Warning: Cannot modify header information – How to resolve this issue? [closed]
- $paged always 0 on plugin’s custom page
- Is there a way in which I can compare product id with the order id to display content on front end before placing the order? [closed]
- Video Security just like facebook [closed]
- Link Pop-up in custom plugin
- How to handle shortcodes through plugin
- WordPress debug messages not displaying
- How to enqueue scripts in right way in a plugin?
- Plugin AJAX Save to Custom Table
- How To Update WordPress Custom Plugin For Customer? [closed]
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- How to close tinymce inline popup
- Why doesn’t update_post_meta work for certain strings?
- Font size of HTML content
- How to write a shopping queue line plugin with a queue button?
- New jquery and bootstrap breaks plugin
- How do I add filter with woocommerce categories?
- Where do I hook to have the server do something in PHP on block attribute change?
- Some difficulties in implementing markdown editor
- WordPress shortcode with a switch
- Share functions between admin and frontend
- Editor Plugin – Breaks when toggling between Visual to Text
- Woocommerce Single Product Tabs Got Duplicate
- Can i prevent the effect of the_title filter on the dashboard’s posts/pages titles?
- Making adding info to an overlay bio easy for average user?
- Delete Query executing regardless of WHERE Clause condition
- How to change the wording of front-end `next article` for custom type registered in a plug-in?
- Get (eventual) permalink from post within Edit Post in Admin panel
- Ajax not working to insert, query and result data
- WordPress User Management Departmental Managers
- Link to a admin submenu item using a custom link
- loop and in admin header problem
- Remove image in post when it’s removed in media library
- Facebook share button help
- How to Implement SAM Broadcaster with WordPress? [closed]
- how do I find out if a placed order was deleted or trashed? [closed]
- How can I interact with a third party service that sends POST requests to me in response to the order information that I send them?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook