-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localization differences - Address EmbedLiveSample case with its "localized" argument #4971
Comments
You raised an important issue. Indeed, currently it is not very convenient to work with embedded live samples, it is definitely worth to automate them somehow. Especially it's not very scalable option in case of translated content. However I'm worried about another question -- will MDN platform continue to evolve or not? I don't see any progress after Peter left the project. I have a feeling that it is in an abandoned state. Maybe there is financial difficulties, I don't know, so I would like to know the current situation with the content platform. |
I am using a HTML heading element ( I think, if the macro can process a localized id correctly, the best approach seems using the macro without the argument -- then we will be able to use markdown instead of HTML heading elements. |
I'm not in a position yet to comment on the issue mentioned here, but I wanted to respond to a concern raised:
A fair question, @lex111. There's been some changes to the size of the team and some near-term changes in who was working on what as a consequence. It's not abandoned, but it is taking us time to get back to a level of activity we sustained before. It's one thing for me to say it's not abandoned, however; I hope @schalkneethling and others on the team will soon be able to prove it through renewed efforts on the platform. Thanks for your understanding and patience. |
+1 to what @ddbeck said. We did drop the ball here but, I am trying to pick it back up. We have had some good conversations all round and we are working on way forward that will benefit all interested parties. Thank you for your patience and please, keep filing those issues. |
@escattone You might also want to have a look at this issue. |
OK, so as I understand it the problem is:
...so the flaw checker reports (probably almost every?) live sample call as a flaw. (this isn't unique to live samples of course. At least cross-reference macros often include localizable text in their arguments. But I guess the flaw checker ignores these?) Back when we were discussing what the impact of Markdown on live samples would be, @escattone and I thought it would be a good principle that as far as possible macro calls should not need to be locale-sensitive, and that was one of the reasons we came up with this way for a live sample not to need to pass the argument, but for Yari to figure it out from the context (aka "(Auto)EmbedLiveSample"). So in principle I guess I am in favour of updating macro calls to remove the argument. There are some risks around this in that we've not tried applying it on a large scale yet. But having spent a lot of time picking at live samples in the last few months for Markdowning, I think it will probably work in at least the vast majority of the time. But still, as you say, it's a project. I am a little worried about this "(Auto)EmbedLiveSample" system, because it seems very implicit/magical. In general I prefer systems where it's clearly expressed in the code/content what's going on, and this isn't like that. But it's the least-bad idea I could think of. Long term I like the idea of separating out examples from pages and embedding the complete example at build time, as we proposed to do in stumptown. But that seems a long way off.
I didn't know that, and I'm sorry to hear it. I would have expected Yari would be able to handle this case. If it's not an easy fix in Yari, that seems like another reason to want to move away from including IDs in live sample arguments. |
For this reason, there is also a 'Translating heading IDs' principle in 'General guidelines for MDN translated content'. So I'm also in favor of updating the macro calls to remove the argument if it needs to change.
@SphinxKnight The above option seems to be the most likely. Of course, it will depend on how we choose. If so, what specifically problems might arise from a locale(translated-content) contributor's point of view? |
@wbamberg, regarding application of "(Auto)EmbedLiveSample" and its effect across the English docset, I've searched/replaced the macro calls to replace the first arg with an empty string and crawled all the pages locally via a script.
I intend to build a more thorough "scanner" by fetching the actual generated content and comparing the result before/after this change. @mfuji09 I wasn't aware of this issue as well, I struggled a bit with some French headings but I guess rewording kind of worked for this locale :x @hochan222 I don't expect particular issues for localizers/contributors apart from the set of PRs which will need to be made/reviewed and, later on, explaining newcomers why there is an empty string as the first argument ^^ |
That's amazing, @SphinxKnight !
Yes, that's pretty good! (I was expecting it would be OK but nice to have this extra evidence.) I'll have a go at fixing these.
Was talking this over with Ryan yesterday and it might be a good time to move to a new macro or to revise the arguments it can take. Already it takes 2 arguments that are always ignored ("width" and "hide Codepen buttons"). |
I've filed mdn/content#10758 which tries to fix those 8 pages. Unfortunately it looks like there is a bug in the new algorithm, as well as apparently some difference in the way it handles whitespace. |
Could you file an issue with regards to the algorithm bug and whitespace differences? |
Is there a tracking bug to discuss and do this work? Either creating a new macro or refactoring the existing one. |
|
I just filed #5016 for that. |
For cross-reference, another "frailty" of EmbedLiveSample when it comes to embedded images for mdn/translated-content #5215 |
@SphinxKnight @wbamberg If this is still an issue, could you please try and describe the problem and the desired solution again from today's perspective? |
The situation is described above and hasn't changed. To summarise:
If we want to go ahead with the ID-less version (and that's at least partly a choice for translators, but in this thread they seem pretty keen) then we should make sure it is working properly with our content and consistently use it in en-US and other locales. We should also consider revising the EmbedLiveSample API at the same time (#5016). |
As far as I understand,
EmbedLiveSample
macro builds the sample content based on a given heading ID (first parameter) or (I just discovered this) fallbacks without argument by using an algorithm based on content.The thing is,
EmbedLiveSample
is:As the localization differences take into account macros and their arguments, and as headings' IDs are generated based on their content… We often encounter what I think are false positive signals when translating (see the first flaw on mdn/translated-content#3158 (comment) for example). Before corresponding PRs it was actually one of the most important source of issues for French content on mdn/translated-content.
There are a few ways to fix this:
EmbedLiveSample
macro calls in mdn/content and mdn/translated-content (as it mdn/content acts as the source of truth/reference for mdn/translated-content)EmbedLiveSample
from the list of "macros of interest" for localization differencesEmbedLiveSample
(and any other macros with arguments based on localizable content)I'm not sure of the way I prefer.
EmbedLiveSample
has long been frail regarding l10n (cf. mdn/translated-content#2844 and mdn/translated-content#2842 for example among others).EmbedLiveSample
from the localization differences check is the most easy one but it feels wrong as, I believe, good live samples are essential to the quality of a page (whether it's an English or a localized one)EmbedLiveSample
in the current algorithm only has an impact on mdn/yari but feels a bit like a "ad hoc" solution.Pointers:
@escattone @wbamberg @lex111 @mfuji09 @hochan222, let me know if you have any thoughts about this.
The text was updated successfully, but these errors were encountered: