YouTip LogoYouTip

Rss Tag Textinput

We need to translate Chinese text to English, preserving HTML tags, code, URLs unchanged. Only translate Chinese text. Need to output full HTML with translations.\\ \\ We must identify Chinese text inside the HTML (including attribute values? Usually attribute values like href, title may contain Chinese; they should be translated? The instruction: "Only translate Chinese." It says keep HTML tags, code, URLs unchanged. URLs unchanged. For attributes like title containing Chinese, they are not URLs, but they are attribute values. Should we translate them? The instruction: "Only translate Chinese." It doesn't say to skip attribute values. It says keep HTML tags, code, URLs unchanged. So attribute values that are not URLs can be translated if they contain Chinese. However, many attribute values like href="#" are not Chinese. title attributes contain Chinese like "Bold Text ( Cmd + b )". Should we translate? Probably yes, translate the Chinese part inside attribute values. But we need to be careful not to break code.\\ \\ Also there are code blocks like ```xml ...``` containing Chinese inside XML tags like Home etc. Those are inside code block; we should translate Chinese there as well? The instruction says keep code unchanged. It says "Keep HTML tags,code,URLs unchanged." So code blocks should be left unchanged. That means we should not translate Chinese inside or inside triple backticks. So we need to leave code blocks as is.\\ \\ Thus we need to translate Chinese text outside of code blocks, and also outside of URLs (like href values). Also attribute values like title that are not URLs? The instruction says keep URLs unchanged, but not necessarily attribute values. However, to be safe, we might treat attribute values as part of HTML tags; they are not code. The instruction didn't explicitly say to keep attribute values unchanged. So we can translate Chinese inside attribute values like title.\\ \\ But there are also some Chinese inside JavaScript code inside