Prevent doc-lang entities loading when doc-en file removed#314
Prevent doc-lang entities loading when doc-en file removed#314jordikroon wants to merge 2 commits into
Conversation
50499a6 to
8ea9c3a
Compare
|
This is a difficult one. The change is simple enough, but the consequences are not. If the URL resolution of that page is wrong (in chasing the page in another language instead of 404 error), then both URL resolution and here should be changed in principle. But if URL resolution is changed (to what behaviour, other than the actual one?), then the change there may be moot. But the consequences are not. The main point is that this change immediately break all translations, This change will avoid the creation of This is the direct opposite of changes like #303 , that maximize building, even for invalid XML, instead of this change that maximize breaking. So, first, let's clarify what the final result of URL resolution should be. If URL resolution hits a non existent file, should it:
The answers delimit where the changes are to be made, and in what direction. In fact, one change I did on #313 is to keep the actual behaviour, as to maximize the building of all translations. Another way to pose this question is this: should all translations break, because URL resolution is not producing some specific result, for english or in the general case? |
alfsb
left a comment
There was a problem hiding this comment.
As commented on Discord, I'm slightly opposed to this change.
I’d much prefer to change web-php/error.php into the direct, desired behaviour, than to change the result indirectly, by breaking all translations each time a file is removed (that will happen a lot, now the manual will be splited).
But let's have it open for a while, for further comments.
178bf68 to
8ea9c3a
Compare
|
So policy wise the docs should always fall back to doc-en when a translation for it doesn't exist. doc-en should be considered the main language. Thus if a file doesn't exist it should not translate to the one that comes after it. Instead it should return a 404 instead. If instead we want a redirect in place for it, that should be optional I believe. Technically said the build didn't fail. Instead it creates an empty entity instead. You can see it in this PR as well, if this would break it the tests would also fail, right? However it did result in having an empty entity reference for all translations. Which was an oversight. That should be covered with a check for $lang === "en" So in short:
The other way round. If //zh/install.windows.tools.php wouldn't exist but /en/ would, it should fall back to /en/. |
Prevents https://www.php.net/manual/en/install.windows.tools.php from rendering in Chinese.