Open MatteoN81 opened 7 years ago
The problem depends on the load_textdomain() function in the TGMPA class, which does not load the language file correctly. In this point
are compared constants FILE and WPMU_PLUGIN_DIR to see if TGMPA is integrated into a plugin or a theme. The path to FILE (Ex: C: \ xampp \ htdocs \ wordpress \ wp-content \ plugins \ my-plugin \ class-tgm-plugin-activation.php) has slash / or backslash \ depending on the operating system running the server, instead WPMU_PLUGIN_DIR (Es. C:\xampp\htdocs\wordpress/wp-content/plugins) has a part with always slashes /. This depends on wordpress, which when declaring paths, takes the initial part from dirname (FILE), while the rest adds it using always the slash (Ex. Define ('WP_PLUGIN_DIR', WP_CONTENT_DIR. '/ Plugins');). This is not a big problem, since Windows, even if it uses backslashes \ in the paths, recognizes the slash / separator, but in comparisons between paths it will always return false, as in my case that I have a local server on Windows as a test environment, this is because they are different text strings, as one uses the slash / and the other backslah. To solve this problem, just replace the if with:
if ( false !== strpos( __FILE__, str_replace('/', DIRECTORY_SEPARATOR, WP_PLUGIN_DIR) ) || false !== strpos( __FILE__, str_replace('/', DIRECTORY_SEPARATOR, WPMU_PLUGIN_DIR) ) ) {
This will replace the slah / with the base separator of your system.
I have exactly the same problem.
It also runs the plugin in a local environment in Windows.
Hi, I have a problem with setting the language. I put the language file in the theme / plugin, renamed tgma-it_IT in it_IT, and in the message that appears to tell me to install X plugin, only translates "Dismiss this notice". The rest remains in English.
I've tried everything, but I do not understand why.