FAQsHow to avoid translating/replacing Bricks components?
How to avoid translating/replacing Bricks components?
Bricks components can be translated by Gato AI Translations, however with a workaround: Bricks doesn't support language in the component, then the plugin replaces a component with its inner elements in the translated page, upon which it can translate those.
If you prefer to avoid this behavior, and keep the components in the translated page as they are, you can do so. (However, they will not be translated.)
To do so, add the following PHP code in your functions.php
:
add_filter(
'gatompl:persisted_query',
function (string $persistedQuery, string $persistedQueryFile): string {
if (str_ends_with($persistedQueryFile, '/translate-customposts-for-polylang.gql')) {
return str_replace(
'bricksData(replaceComponents: true)',
'bricksData',
$persistedQuery
);
}
return $persistedQuery;
},
10,
2
);