Open tomslominski opened 8 years ago
I think the tgmpa-
prefix should be removed from the .mo
file names, because the Internationalization paragraph of the Theme Handbook says:
You can load the MO file by calling the function load_theme_textdomain(). This call loads {locale}.mo from your theme’s base directory or {text-domain}-{locale}.mo from the WordPress theme language folder.
I did it on my theme and now the MO file is corretly loaded.
TGMPA is also used in plugins as well though.
Here is a suggestion that would load the correct mo file no matter where TGMPA is used, and remove the need for the custom generator to change the text domain strings.
I suspect that implementing this would require other changes of which I am unaware, which is why I am offering it here rather than as a PR. It is just that it seems to me that simplifying the code is a good direction to go in.
remove the need for the custom generator to change the text domain strings.
@RichardCoffee Unfortunately the Theme Review Team at WordPress.org demands that the text domain is changed as well as some other things. The text-domain change has to do with being able to (re-)use translations offered by their own theme/plugin translation platform GlotPress. The Custom Generator was created as too many theme authors apparently know so little of PHP that they were doing blanket search & replace actions, breaking TGMPA and giving it a bad reputation. So independently of the changes you suggest - which are similar to #601 -, the Custom Generator will still need to be used for themes.
For full info on what the Custom Generator does, see the original PR for it: https://github.com/TGMPA/TGM-Plugin-Activation/pull/519
Hi. I've recently downloaded the latest version of TGMPA (2.6.1) from the custom downloader on your site and included it with my theme (distributed outside of WP/ThemeForest). I'm a bit confused about how the newly supplied language files work. I read through the instructions and the text domain loading code, and it seems to me that these are named wrongly.
Here's what WordPress tries to load for your plugin (debugged using the Display text domains plugin):
Since I am including TGMPA with a plugin (inside the theme-name/inc/plugins/ directory), the file should be found in the first directory. However, since the files supplied in the TGMPA package are named
tgmpa-de_DE.mo
, notde_DE.mo
asload_theme_textdomain()
(invoked here) expects, the language file isn't found, and the translation doesn't work.I see that there is some attempt made to correct the filename using
correct_plugin_mofile()
, but this works only for plugins.Am I misunderstanding something here, or is this genuinely a bug?
Anyway, thanks for a great plugin!