New answers tagged translation
In lack of translation file the default strings from source code are being used. So if plugin is coded in US english then it just has that version in source and doesn't need the translation for it. The native way to generate translation files in WP is makepot script, shipped with development version of WordPress core. See Using the i18n tools documentation ...
Filtering gettext is horrible for performance. I would strongly recommend to try do it via any other approach. And if all else fails to add and remove filter with extreme precision around necessary parts. As for why it fails my educated guess would be — timing. It is quite common for strings to be centralized and processed early in the process. For example ...
Your theme's text domain is defined in your Theme Header in style.css. For example: /* * Plugin Name: My Plugin * Author: Otto * Text Domain: my-plugin */ The text domain should match your theme's 'slug' (ie. the name of the folder where your theme is stored). Read more: https://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains
Before we go into details, it should be noted that the guides you are referring to is only what it is, a guide. Just like coding standards (which not even the core developers stick to :-)), the Wordpress Handbook is just a guide to developers, it is not the alpha and omega. The basic idea is to use this guide and implement these guideline in such a manner ...
Top 50 recent answers are included