Bugs Unfixable Through Translation
-
We have identified one bug that cannot be resolved through translation.
Site Kit determines whether “this page already contains a tag” by performing a string search on the generated HTML comments. The search string itself is subject to translation and is dynamically constructed by inserting the module name.
php // includes/Core/Modules/Module_With_Tag_Trait.php $search_translatable_string = sprintf( __( 'Google %s snippet added by Site Kit', 'google-site-kit' ), $module_name // = _x( 'Analytics', 'Service name', 'google-site-kit' ) will be translated );This means that the detection mechanism only works if both the translated version of the output comment and the translated version of
'Service name'inserted into the search template are an exact match.While there is a fallback mechanism for English comments, this version concatenates “the translated module name with an English string”.
$search_string = 'Google ' . $module_name . ' snippet added by Site Kit';Since $module_name is a translated value, in a Japanese environment this results in a mixed-language string:
Google アナリティクス snippet added by Site KitThis does not match either the English comment or the Japanese comment, effectively rendering the English fallback ineffective.
You must be logged in to reply to this topic.