raph-topo/wp-translations

Translations for custom packages ("pro" plugins)

Opened this issue · 3 comments

Currently, it seems WP Translation cannot find translations for packages loaded from custom repositories, such as "pro" plugins and themes. Is it really the case?

@davidhund, I saw in your logs advanced-custom-fields/advanced-custom-fields-pro, does WP Translations output anything concerning that package? Did it install translations? Is the package key for the translations a different one?

If needed, I could add an additional setting to force-install translations.

@raph-topo I am not sure if it showed something special re: those packages.
What would be the best way to test this? Can I have wp-translations 're-check' without changing my requirements?

Referring to #2 (comment)
I can see one custom plugin (i.e. not from WPackagist):

  - Installing advanced-custom-fields/advanced-custom-fields-pro (5.9.3): Extracting archive

But no news from WP Translations for it, like:

  - Translations of wpackagist-plugin/autoptimize: Downloaded nl_NL

So WP Translations did not recognize it as a WordPress plugin with potentially available translations. Probably the plugin's composer.json does not contain

  "type": "wordpress-plugin",

Could you please confirm that?

Also, in your development Vagrant, if you try Dashboard > Updates > Update Translations, does WordPress find translations for Advanced Custom Fields?

@raph-topo Excuses for the delayed response, the plugin in your example (ACF-Pro) is special in that it is a premium plugin and not available as such on WPackagist.

Instead: I can install it through Composer using https://github.com/pivvenit/acf-pro-installer
This allows me to use the ACF Key from an .env file and in turn requires ACF Pro from a Composer 'Bridge' hosted as a GitHub Page.

An example of the returned packages.json file is found at e.g: https://github.com/pivvenit/acf-composer-bridge/blob/gh-pages/composer/v3/wordpress-muplugin/packages.json

Also: I use this as a 'must-use' plugin: so my composer uses:

...
	"repositories": [
		{
			"type": "composer",
			"url": "https://wpackagist.org",
			"only": [
				"wpackagist-plugin/*",
				"wpackagist-theme/*"
			]
		},
		{
			"type": "composer",
			"url": "https://pivvenit.github.io/acf-composer-bridge/composer/v3/wordpress-muplugin/"
		}
	],
...

All in All a complex setup. I guess this is also why the language files are not picked up…
Maybe you can think of some way to make this work ;-)