There was multiple issues regarding Patterns and Polylang compatibility:
Having Polylang Pro didn't trigger Pilo'Press Polylang compatibility because of is_plugin_active('polylang/polylang.php') use.
There was also an issue causing patterns to generate more posts than it should have (ex: 1 CPT with 3 languages was generating 8 posts instead of 4 because of the original post not being set default language before generating translations)
This issue was only occuring when the post-type was made / active before Polylang was active.
Test case to reproduce the issue:
First, deactivate Polylang if it's active
Register a new post-type
Go to Patterns > Locked content and see if your post-type is correctly there
Activate Polylang plugin
Set some languages(ex: French as default language and English as additional language)
Go back to Patterns > Locked content and search for your registered post-type
When the issue occur, you should have 2 "Post-type: ..." posts of the default language and 2 of the English language instead of just 1 of each.
Switch to this pull request / branch and do the test case again to see if it fixed the issue.
There was multiple issues regarding Patterns and Polylang compatibility:
Having Polylang Pro didn't trigger Pilo'Press Polylang compatibility because of
is_plugin_active('polylang/polylang.php')
use.There was also an issue causing patterns to generate more posts than it should have (ex: 1 CPT with 3 languages was generating 8 posts instead of 4 because of the original post not being set default language before generating translations) This issue was only occuring when the post-type was made / active before Polylang was active.
Test case to reproduce the issue: