{"id":19033267,"date":"2026-09-30T14:40:00","date_gmt":"2026-09-30T14:40:00","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/bugs-unfixable-through-translation\/"},"modified":"2026-09-30T14:53:19","modified_gmt":"2026-09-30T14:53:19","slug":"bugs-unfixable-through-translation","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/bugs-unfixable-through-translation\/","title":{"rendered":"Bugs Unfixable Through Translation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We have identified one bug that cannot be resolved through translation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Site Kit determines whether &#8220;this page already contains a tag&#8221; 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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php\n\/\/ includes\/Core\/Modules\/Module_With_Tag_Trait.php\n$search_translatable_string = sprintf(\n    __( 'Google %s snippet added by Site Kit', 'google-site-kit' ),\n    $module_name   \/\/ = _x( 'Analytics', 'Service name', 'google-site-kit' ) will be translated\n);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This means that the detection mechanism only works if both the translated version of the output comment and the translated version of <code>'Service name'<\/code> inserted into the search template are an exact match.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While there is a fallback mechanism for English comments, this version concatenates &#8220;the translated module name with an English string&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$search_string = 'Google ' . $module_name . ' snippet added by Site Kit';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Since $module_name is a translated value, in a Japanese environment this results in a mixed-language string:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Google \u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9 snippet added by Site Kit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This does not match either the English comment or the Japanese comment, effectively rendering the English fallback ineffective.<\/p>\n","protected":false},"template":"","class_list":["post-19033267","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033267\/revisions"}],"predecessor-version":[{"id":19033280,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033267\/revisions\/19033280"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19033267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}