[Feature Request] How to translate an element's id in ATE?
This thread is resolved. Here is a description of the problem and solution.
Problem: You are working on a site under development and trying to use the Advanced Translation Editor (ATE) in WPML to translate an HTML header tag's id attribute. However, ATE does not recognize the 'test' id when you try to search for it in the translation editor. Solution: We recommend adding the IDs in the following format:
After this, you can translate the string via WPML -> String Translation. Please check the last three strings on this page.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Additionally, you can open a new support ticket for further assistance here.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am working on a site under development and trying to use the Advanced Translation Editor (ATE) in WPML to translate an element's id. The specific element I am dealing with is an HTML header tag with an id attribute.
Symptoms:
ATE does not recognize the 'test' id when I try to search for it in the translation editor (even via the search box).
Questions:
How can I translate an element's id in ATE?
What needs to be added to wpml-config to make ATE "see" the id of an HTML element (which is -- in my case -- is not part of any plugin or shortcode)?
Thanks for contacting WPML forums support. I'll be glad to help you today.
1) Could you please share and example of the ID you want to translate?
2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me a lot of information about how your site is configured.
Yes, I believe that is exactly what I am encountering. The string looks exactly as I have it. Like on my site, I can't translate it through ATE as it's not even detected through the search box/bar.
As for wizard, I like that it essentially understands what I wrote. At least I don't see any significant misrepresentations when paraphrasing. (That's exactly how the systems I know/use work: DeepL Write and Grammarly AI Writing Assistant.) However, your wizard gets rid of a lot of details that I find fundamentally important, because often (I've written to support several times and have encountered this wizard) it's what it excludes that turns out to be important: either support explicitly asks about it (which seems logical in the proper context), or it would help support understand my questions without further clarification. So for now, I rather dislike this wizard.
1) Thanks for your confirmation. The workarounds I found to translate this ID is to manually translate it or use the Classic Translation editor instead of ATE.
I've consulted our 2nd tier support team, and I'll update you as soon as I get their reply.
By manual translation, do you mean translation through the WP editor? If yes, this (as well as translation through the classic editor) is inconvenient, because this translation will disappear in case of further translation through ATE, and if you don't use ATE, you can't use the translation memory. All this causes additional inconvenience, which is already too much in WPML usage. It seems to me that html tag attributes are something that may need to be translated quite often. I've found in old tickets that some attributes are untranslatable because there is a high risk of errors (e.g. 'style'), but this is hardly the case for the 'id' attribute (at least it wasn't on the list of untranslatable attributes). I'm certainly happy to settle for a translation of the 'name' attribute of the 'a' tag, if that's easier.
BTW, I don't get support response notification emails today as I always have. I use a business email account from Microsoft, I check spam folders as well, and I have no problems with receiving other email on this account today. So maybe some issues with email are on your side (although, of course, it's possible that it could be on mine).
1) I'll update you as soon as I get our second-tier support reply, and I'll add that you want to use ATE for this case, not other workarounds, to the ticket.
2) I didn't receive any complaints from my clients today regarding the email notification, and it works correctly for me.
I'll check with my team mates to know if they faced any issues with emails today.
I would like to make one important clarification regarding my addition about the name attribute. I can translate it through ATE, but I am not satisfied with it. I would like to get a translation (id or name attribute) that is _necessary_ from ATE's point of view. I agree to create something custom for this, to prescribe something in functions, that sort of thing. I can't rely on translation, which ATE considers only optional (and done via search-box). Because such a translation can "disappear" under a number of circumstances (it's the subject of separate tickets - under what circumstances, but I assure you that on large pages translated into dozens of languages and not being top-level pages this is very likely, as well as not saving anything that is not explicitly prescribed in the translation; WPML simply can't handle making all the changes, even if I on my side allocate huge resources and remove many restrictions in WP, apache and mysql settings). I've asked an essentially similar question before about "plain text", as in, say, strings consisting entirely of numbers. I was answered: no, no, no, no, that's not possible. But I found a way to get what I wanted with them, by adding a meaningless tag to _part_ of the string, such as: "1234<cstm>5</cstm>". Since ATE needs to figure out which part of the string to tag, it has to register such a string for mandatory translation. I can "remove" this tag if I want, i.e. make, say, "54321<cstm></cstm>", ATE allows it, because the tag is formally preserved. But I can't make such arbitrary changes in html attributes. So I'm looking for some solution that would make ATE not just see this attribute, but require it to be translated. I'm ready to "attach" the id attribute to any tag, as long as the frontend doesn't reflect it (visually). Id is great because it can be attached to almost anything. And I'm ready to do it, if it allows to require translation of this attribute.
The ids that I want to translate are needed to mark the points on pages that are linked to. That is, these ids match the hashes in the slugs that are reflected in the URLs, which I have all translated, eg.
We have a list of attributes we can translate and ID logically is never translated. So, we can not set it as a translatable attribute, even theoretically, if we make it translatable. We will increase the average Xliff size and segment count by ~ 10%, and all this content will be useless.
Maybe in the future, we will add such a setting if many users need such a feature
The case has been escalated as a feature request so we can estimate the number of clients who need this feature.
Please let me know if the string translation workaround fixes the issue for you.