User talk:Amire80/Archive/2023/06

From translatewiki.net
Archive icon This is an archive page for the Support page. Do not post new threads here, they will likely not be read. If you wish to continue an archived discussion, start a new thread on the Support page and include a link to the archived discussion.

Incorrect comment about "GENDER:|You"

In https://translatewiki.net/w/i.php?title=Template:Welcome/i18n&diff=next&oldid=11427241

  • You say that "GENDER:" does not work like this on translatable pages. That's wrong. The "GENDER:" parserfunction (note the required colon) has a default 1st parameter that it is the current user viewing the page. It should be used like this in messages containing "you/your" (refering directly to the reading current user, the colon must still be present). If there's a username parameter it is to cite a specific user and not the current viewing user. You probably make a confusion with the "GENDER" template (or template-like construction used for messages in non-Mediawiki projects).
  • As well in these edits, you have removed the "bdi" tags that took care of the fact that the displayed label for the links were displayed in the UI language (used by "int:messageid") for the current viewing user, and not necessarily the page language in which the containing language is translated indepenadtly of the current user's preferences (and not using the "int:" parser function), so there are possible changes of languages and scripts and the bdi was there for proper isolation of the language and the directionaility of the script used by the displayed link label.

With your edits, all existing correct messages that were translated were made fuzzy... So nobody was welcomed in any language except in English. As soon as they create their account page and receive the welcome message, it is unreadable now in many pages... You forget to not invalidate existing translations (including some of your copy edits in English jsut to add an optional comma). Verdy p (talk) 15:55, 13 February 2023 (UTC)Reply

For GENDER, I added documentation. The empty GENDER doesn't do anything useful.
You're wrong, the term "you" is translatable with a gender in various languages, depending on who it refers to. This is very common in many Mediawiki messages (and in many cases it does not need a username parameter, everytime it refers to the reading user; the second parameter, after the 1st vertical bar, was not empty, it was "you" to explicit in English that who was the user taken by default for "GENDER:"). Verdy p (talk) 16:07, 13 February 2023 (UTC)Reply
For bdi, do you have an example where it's actually needed? Amir E. Aharoni (talk) 16:01, 13 February 2023 (UTC)Reply
All translated pages using that template, and notably user talk pages where it is posted to (note that the user may have not specified their gender in their preferences when they are welcomed and also not set their default language, or the welcome message may be partially translated; the UI message for "Support" is translated separately and either parts may be in different languages/scripts, that's why they were isolated. This was tested and fixed a long time ago (after the absence was signaled by a bug report that you have now reverted, based on false assumptions). Verdy p (talk) 16:07, 13 February 2023 (UTC)Reply
There are many examples in core MediaWiiki UI messages using that form {{GENDER:|You}} or {{GENDER:|I}} in the English source (the reason being that support for gender varies across target projects and which engine will parse them). Here we are using the Mediawiki parser in a context where the viewing user should be known by MediaWiki and used properly. In old MediaWiki, the username was required after the "GENDER:" parser function call, before column and the textual forms; this is no longer the case since very long as it takes a documented default. The viewing user is also NOT the user of the talk page name where the message is posted to! That message can be read by any one else that will also be referenced by "you" (the message is not really personal to a specific target user, so your added documentation instructing to use a Amire80/Archive/2023/06 parameter to give the user name is also wrong, it should be removed as well in your newly added documentation, which was compeltely nunecesary with the past code you broke). Verdy p (talk) 16:20, 13 February 2023 (UTC)Reply
As a matter of fact, the welcome message is to the owner of the talk page. It welcomes this particular user to the site. (Actually, I'm really not sure that it's effective, but at least that's the intention.)
About bdi: by "example", I mean "a link to a page where something is shown incorrectly". On my page here, and on several other pages I checked, it is shown correctly. Amir E. Aharoni (talk) 16:41, 13 February 2023 (UTC)Reply
See Template:Rtl-inline/doc with an example showing the problems. Note that using a "span" with a simple dir="" attribute does not work across all browsers. Many of them do not apply proper isolation (and not even embedding). The W3C doc says that the effect of dir="" allows browsers to do what they think is good from them. And when the direction is not known at all (e.g. a user name variable in a template parameter), using "bdi" is the only viable choice. It is even shorter than using any span or other element. A "bdi" element without any dir attribute is enough to get isolation, while allowing the content (e.g. a user name written in any script) to be automatically rendered from its implicit direction (determined by its first character(s) only, and independantly of anything that surrounds the isolated element). These are just assumptions you made by not properly reading and understanding the HTML specifications. As well the "bdi" element is NOT restricted at all to be used inline (this is not the case of "span"), because its content model allows mixed contents (inline/"flowing", or blocks). MediaWiki was tuned years ago to recognize "bdi" and treat it differently from "span" and "bdi" is the only standard HTML element allowed by MediaWiki that supports mixed content models: it is a precious thing in Mediawiki.
This "bdi" element is part of HTML specifications since very long, and I do not know any browser that does not support it (even the oldest legacy HTML4 browser that don't now it, treat it silently, and old versions of IE (now unsupportef) that were still not HTML5 compatible and used various tricks are supporting "bdi". This is not the case of the older "bdo" element, whose support is strongly discouraged in favor of "bdi"(which is based on the Unicode Bidi specifications, and as well mapped in HTML to have a default CSS style in all browsers so that it is set with "unicode-bidi: isolation", and not "unicode-bidi: embed" used by "bdo" but kept only for compatiblity with old documents).
As well Unicode strongly discourages the use of "embedding" bidi controls in plain text in favor of isolation controls (notably for dynamic contents); the "embedding" mode is only suitable and still usable for use in static documents where all contents in the same paragraph is known; The same is true about rigth-to-left and left-to-right marks (RLM and LRM) because they are not islating the content after them.
MediaWiki has also been fixed to avoid using RLM and LRM, including in a few builtin language names rendered by "#language" (this caused various bugs in many pages, notably in language navigation boxes; instead these boxes are using "bdi" to embed the language names and avoid these tricks, making LRM and RLM also no longer useful (and even undesirable). This helped making for example Wikimedia Commons much more easily internationalizable with multilingual contents (with much better behavior when rendering UI messages with fallbacks, so that they don't break the page layout).
An example of bug when using just dir="" is documented by Microsoft for IE11: https://learn.microsoft.com/fr-fr/troubleshoot/developer/browsers/development-website/unicode-bidi-isolation-not-supported and Microsoft also instructs to use "bdi" instead. Note that this doc says it also applies to Edge, but this is not longer true since Edge was rewritten to be based on Chromium's HTML engine, and all deployed and supproted versions of Edge on Windows 7/8/8.1/10/11 are now basing Edge on the Chromium engine. The Microsoft page was updated in 2023 just to clarify that IE11 is no longer supported and has been definitely desactivated in the first versions Windows 10 (and it is no longer installed in Windows 11, except if users enable the support for rendering with legacy IE tricks, but even in this case it is still using the new Chromium-based Edge, emulating the legacy "trick" mode (but with some restrictions to avoid bypassing security issues).
There are also similar bugs with non-desktop OSes, notably some old mobiles and devices with light builtin versions of Opera (notably cheap Asian models of smartTVs or tablets) and with some less known browsers. These bugs are solved using bdi (and not hoping that browsers will appliy isolation with dir="ltr" or dir="rtl", like what modern version of supported browsers are doing now: Chrome, Edge, Safari, Firefox, Opera, and other browsers provided by default in some Linux distributions, e.g. with KDE desktop envionments). The element "bdi" is stable and has no bug, it is fully supported everywhere and is integrant part of core HTML5. Verdy p (talk) 08:13, 8 June 2023 (UTC)Reply
See https://www.w3.org/International/articles/inline-bidi-markup/ :
when browsers encounter the dir attribute on an element they (directionally) isolate the text inside the element from the text surrounding it
I replace bdi with span, and I don't see any problems on that page.
I again ask you to show me an actual problem that is caused by using span instead of bdi. Amir E. Aharoni (talk) 09:14, 8 June 2023 (UTC)Reply
Don't replace "bdi" with "span". Even the W3C says in that informative page that it is needed and clearly demonstrates its interest. "bdi" allows mixed contents (not "span" or "div": you have to choose depending on the content) and consistantly applies isolation everywhere (not the case with the dir="" attribute, as shown in the Microsoft link I posted above, but this is also true with various other simple browsers). The W3C specs are more precise (but more technical and harder to read for many users). "bdi" is also more explicit about its intended meaning, and much simpler to use.
The informative sentence that you quote from the W3C page is not completely true. It is true only for HTML5-compliant browsers (but false for IE and early versions of Edge, or many simple browsers). But that informative page just simplifies the situation. That page shows the interest of "bdi" as a well-supported alternative (with even better support than the legacy "dir" attribute whose implemetnation is inconsistant across browsers).
Note that mixed contents occur in various contexts, e.g. when transcluding the texts of translatable messages, or some templates inside what is supposed to be only inline (e.g. when there are floatting or positioned elements inside the flow: neither "span" nor "div" will work as a valid container element; "bdi" can be used everywhere with any type of contents to isolate and it does not require knowing the implicit direction of the content to properly set the dir="" attribute, which is NOT required for "bdi" and in most cases dir="" is not needed at all in "bdi" whose default inner direction is "auto" but never determined by the outer context). Verdy p (talk) 09:25, 8 June 2023 (UTC)Reply
I understand that you love rare and complex HTML and CSS features. You are welcome to use them on your own website as much as you want, but don't do it here, unless it's actually necessary. In this case, you failed to demonstrate that it is necessary.
A problem in IE11 is not a relevant example. It's an ancient browser, and it's not supported. In Microsoft Edge, a span element with a dir attribute correctly applies isolation.
I will replace bdi with span if you don't show an actual and relevant problem that not using bdi causes. And if you replace span with bdi without demonstrating an actual problem, I will block you indefinitely for edit warring and writing unnecessarily complex and hard-to-maintain code after multiple demands to stop doing it. Amir E. Aharoni (talk) 09:46, 8 June 2023 (UTC)Reply
"bdi" is absolutely not rare and complex. It is not a "trick" and simpler to explain and use consistantly without fearing side effects (notably with mixed content) and even shorter to type. It serves its intended, explicit and documented goal. The W3C changed the behavior of the "dir" attribute in HTML several times (even if it has been stable with HTML5 but that not all browsers respect), but never for "bdi" since its origin (even when it was introduced decenials ago in HTML4 and preserved without any change in HTML5). Google itself uses it everywhere in their sites, as well as Mozilla, and a lot of pages and templates in Wikimedia Commons that absolutely need it for correct results, especially in templates with variable parameters (MediaWiki adds its own complications with the "mw-content-rtl/ltr" class for its default stylesheets on some presentational elements). For exampel you cannot use dir="" to correctly render a list of native language names, or list of user names, or list of links when the items are written in an unpredictable script without using an extra parameter and without having to parse the content of each variable item (this would be very inefficient and in fact much harder and tricky to maintain). "bdi" avoids ALL these problems at once an at NO cost; it's just unfortunate that you were not used to it and still incorrectly think that it's unnecessary (you've placed a restriction on inline elements in this template, but this restriction is not even needed when you use "bdi" instead). Verdy p (talk) 09:53, 8 June 2023 (UTC)Reply
bdi should be used only when really needed, and there are very few cases where it is. It may be needed when you don't know the direction, and even then it's not certain. In the rtl-inline template, the direction is known, so it is not needed. In all other cases, it should be span. If it is used a lot on Commons, it's quite possible that it should be used less there, too. Amir E. Aharoni (talk) 10:05, 8 June 2023 (UTC)Reply
I have exactly the opposite opinion (and I'm definitely not alone): using "dir" is not even necessary and rarely needs to be used. It's just more complex to maintain consistantly. MEdiaWiki itself uses "bdi" extensively in its interface and skins (and since it did that, it solved many layout problems; in the past using dir attributes was requiring all kinds of tricks everywhere that were hard to maintain and caused various lyout bugs impossible to solve, that affected all multilingual sites, not just Arabic or Hebrew Wikipedia, but as well all multingual sites like Meta or Commons, or pages of English Wikipedia attempting to render multilingual contents, lists of user names or native language names, or references to external articles whose title garbled the layout of references by mixing everything in a way that was impossible to read; such references could as well include excerpts containing several pragraphs, or transcluded contents or page sections whose inner direction was hard to guess even if it was isolated, but forced incorrectly with a dir="ltr" or dir="rtl" attribute, when the correct behavior should have been dir="auto" which does not imply any isolation even in HTML5-compliant browsers). These layout bugs affected various page tracking tools, diff tools in page histories as soon as the variable content was not written in the same language as the default content language of the wiki, or if it was needed to include fragments written in the user language (notably UI elements inside pages, like "edit" links at end of sections, or user signatures in talk and voting pages)...
Probably you are missing something and have not worked on these issues, and just make some assumptions based on limired use cases. And given you even doubt "bdi" is useful when the direction of the content is not known, this is a clear proof that you've not understood the specifications exactly and that you just follow your intuition. It's not hard to build examples (notably with mixed content models in variable contents passed into template parameters that we don't want to parse; your argument "bdi" is more complex and unreadable than "span dir=" is just obviously false: all basic HTML authors know what it means and don't have to guess anything, it just works as expected everywhere: using dir attributes can be deprecated as it is is not needed at all in ALMOST ALL cases (where "bdi" still remains useful in frequent cases). Just like LRM/RLM marks are strongly discouraged (that are only useful to override a know character written immediately after it, to change its strong or inherited weak direction, but never at end of any message). RLM/LRM were dropped from language names where they were introduced long before knowing that it was possible to avoid them everywhere (and notably in HTML; such Unicode Bidi controls may have use only in static plain text documents, in the middle of text but never at end). Verdy p (talk) 10:19, 8 June 2023 (UTC)Reply
Note: I'm viewing wiki pages frequently on my smartTV, that is using a simple browser (not based on Android) that does not work correctly with "dir" attributes, but has no problem at all with "bdi" elements. Many users use simple smartphones or tablets or their smartTV to avigate the web, they don't use a desktop or modern mobile, many old mobiles are broken here). Non-Android SmartTV's are actively sold today, includin from wellknown Chinese brands like HTC, HiSense, or more expensive models from Samsung: their builtin browser has less capabilities and can't run Android because these devices have much less memory and storage; they have a coprocessor for the display, but not for the UI and the basic Linux-based OS, even if they support some Javascript and some core CSS (generally not CSS3!); these limtied browsers have no problem with "bdi" and they support the Bidi specifications and contents in mixed scripts (notably Arabic+English). This may not be a problem for you, but it will be a problem for many less favorized users that want to contribute for example from areas in most parts of Africa or Pakistan using less capable devices....
So unlike you, I make such rendering tests on limited devices like my TV, as well as on my smarthone (but as it is using a recent version of Android I can no longer major defects on it), and not just from my desktop PC. Some additional tests are to be done on Apple iPads (whose Safari browser is often antique and not updated by Apple) and cheap Android tablets, even if this site is not well tuned from pocket-size phones. Verdy p (talk) 10:48, 8 June 2023 (UTC)Reply
You wrote a lot, as you very often do, and you haven't given a single relevant example of where bdi is actually needed. Please don't write anything more in this thread unless you have such an example. Amir E. Aharoni (talk) 11:09, 8 June 2023 (UTC)Reply

Incubator

Hi, is in Incubator the code crh-ro not possible for a test Wiki? Zolgoyo (talk) 06:44, 3 June 2023 (UTC)Reply

There is a Wikipedia in Crimean Tatar, and it doesn't need a new Incubator. We have discussed it already at Support/Archive/2023/05: only localization, not creating a new Wikipedia. Amir E. Aharoni (talk) 07:06, 3 June 2023 (UTC)Reply
Ok, I would actually to have a alphabet converter, but I don't know how to do that. (See Portal:Crh-RO/Latin alphabet) Zolgoyo (talk) 08:46, 3 June 2023 (UTC)Reply