Open Radzio1615 opened 6 years ago
Hi! I just had the same problem, I don't know much about "textdomains" but it seems in current versions "load_theme_textdomain" loads language files of the form $lang.'.mo' and not of the form $domain.'-'.$lang.'.mo',
This is the way TGM Plugin has put them in its "/languages" folder. It would be enough to remove "tgmpa-" from the names of the language files.
In case you have not understood, the idea is to change the name of the file from "tgmpa-it_IT.mo" to "it_IT.mo", this has worked for me within a custom WordPress theme 5.4.4
PD: I know I'm 2 years late ouo..., but I think my answer could help other people
EDIT:
Well, to say that "it worked" is really a lot, I think the translations need to be updated, but at least it has loaded the .po and .mo files!
hello sorry if I join this issue after so long, but I suppose this issue can be fixed in this way.
You have to change this line
if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
so
if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) || false !== strpos( __FILE__, get_template_directory() ) ) {
So we will check if TGM is placed inside the template folder, otherwise translations aren't loaded.
thank you in advance for your time!
Hi! Unfortunately, the translation of the plugin does not work. I use TGM in theme. I put
class-tgm-plugin-activation.php
,plugins.php
andlanguage
folder inmytheme/tgm/
My functions.php file:
Translation of the theme works properly. I excluded
tgm
folder from theme translation. Do i have to change something intgm
php files or add some code tofunctions.php
?