[Bug] Mirror Page Formatting for Languages with Right-To-Left Scripts #16

Closed
opened 2024-08-19 11:04:39 +00:00 by Binzy_Boi · 1 comment

Whereas currently Wikimore displays Titles on the left side of the page, and boxes on the right as per the standards of English and most other Wikipedias, this should be the opposite for languages that utilize scripts that are read right-to-left rather than left-to-right.

As an example, here is Adam Sandler's article as it appears on the Arabic language Wikipedia and Wikimore equivalent respectively at the following links:

https://ar.wikipedia.org/wiki/%D8%A2%D8%AF%D9%85_%D8%B3%D8%A7%D9%86%D8%AF%D9%84%D8%B1
https://wikimore.private.coffee/wiki/ar/wiki/%D8%A2%D8%AF%D9%85_%D8%B3%D8%A7%D9%86%D8%AF%D9%84%D8%B1

image image

In the example above, the Infobox should appear on the left-hand side of the page, with the Title appearing on the right-hand side. This not only matches the formatting on Wikipedia, but improves article readability for users fluent in languages that read from right to left.

In total on Wikipedia, there are 22 Wikis with languages that read from right to left, of which one is a closed project, and another supports switching between scripts. Of the 22 Wikis, 17 utilize Arabic scripts (including the case wiki where one can swap language scripts), 2 utilize Hebrew scripts, and then the N'ko, Syriac, and Thaana scripts all have one wiki each.

Here is a table showing which specific languages utilize scripts read from right to left along with their language code for Wikipedia (ar.wikipedia.org for Arabic for example), and the specific script the language utilizes.

image

In the case of Kurmanji Kurdish (misspelled as Kuranji in the table above, whoops), the default script is Latin, as shown in this image using the recently Featured Article for Prehistory in the aforementioned language at the link below:

https://ku.wikipedia.org/wiki/P%C3%AA%C5%9Fd%C3%AErok

image

Slightly below the title for the article, there is a button that brings a dropdown menu. This changes the written variation of the article. In this case, choosing "Tîpên erebî" displays the article in the language's written form in Arabic rather than in Latin:

image

image

Clicking the button modifies the URL of the article, changing it from the default Latin link at

https://ku.wikipedia.org/wiki/P%C3%AA%C5%9Fd%C3%AErok

to

https://ku.wikipedia.org/w/index.php?title=P%C3%AA%C5%9Fd%C3%AErok&variant=ku-arab

which displays the article in the language's written form in Arabic.

Wikimore currently doesn't support swapping between different written variations of a language for an article, and while I will likely be submitting an issue regarding that functionality in general as multiple Wikis in Wikipedia utilize the function, I figured this case would be important to mention here as this is the only example of such where the script changes from being read left-to-right to right-to-left.

Whereas currently Wikimore displays Titles on the left side of the page, and boxes on the right as per the standards of English and most other Wikipedias, this should be the opposite for languages that utilize scripts that are read right-to-left rather than left-to-right. As an example, here is Adam Sandler's article as it appears on the Arabic language Wikipedia and Wikimore equivalent respectively at the following links: https://ar.wikipedia.org/wiki/%D8%A2%D8%AF%D9%85_%D8%B3%D8%A7%D9%86%D8%AF%D9%84%D8%B1 https://wikimore.private.coffee/wiki/ar/wiki/%D8%A2%D8%AF%D9%85_%D8%B3%D8%A7%D9%86%D8%AF%D9%84%D8%B1 ![image](/attachments/e1b86b8f-56da-4b7d-93ea-edda29feaebe) ![image](/attachments/a8463d41-c2ff-4978-9a8b-d8410de8e8d4) In the example above, the Infobox should appear on the left-hand side of the page, with the Title appearing on the right-hand side. This not only matches the formatting on Wikipedia, but improves article readability for users fluent in languages that read from right to left. In total on Wikipedia, there are 22 Wikis with languages that read from right to left, of which one is a closed project, and another supports switching between scripts. Of the 22 Wikis, 17 utilize Arabic scripts (including the case wiki where one can swap language scripts), 2 utilize Hebrew scripts, and then the N'ko, Syriac, and Thaana scripts all have one wiki each. Here is a table showing which specific languages utilize scripts read from right to left along with their language code for Wikipedia (ar.wikipedia.org for Arabic for example), and the specific script the language utilizes. ![image](/attachments/2a71c1ed-4f2f-4ce9-9e02-b82da77bfa32) In the case of Kurmanji Kurdish (misspelled as Kuranji in the table above, whoops), the default script is Latin, as shown in this image using the recently Featured Article for Prehistory in the aforementioned language at the link below: https://ku.wikipedia.org/wiki/P%C3%AA%C5%9Fd%C3%AErok ![image](/attachments/a69f9446-5610-499f-9cba-24010b5fa9e3) Slightly below the title for the article, there is a button that brings a dropdown menu. This changes the written variation of the article. In this case, choosing "Tîpên erebî" displays the article in the language's written form in Arabic rather than in Latin: ![image](/attachments/ee95fdf4-e1a4-4ed0-9c31-bba403e69a75) ![image](/attachments/3f06d4fe-149c-439c-b059-65ac122f9c5b) Clicking the button modifies the URL of the article, changing it from the default Latin link at https://ku.wikipedia.org/wiki/P%C3%AA%C5%9Fd%C3%AErok to https://ku.wikipedia.org/w/index.php?title=P%C3%AA%C5%9Fd%C3%AErok&variant=ku-arab which displays the article in the language's written form in Arabic. Wikimore currently doesn't support swapping between different written variations of a language for an article, and while I will likely be submitting an issue regarding that functionality in general as multiple Wikis in Wikipedia utilize the function, I figured this case would be important to mention here as this is the only example of such where the script changes from being read left-to-right to right-to-left.
Owner

Hmm, the last part is tricky. Because I can get the API to return the article in Arabic instead of Latin, but it's still returning the direction as "ltr" instead of "rtl"...

Specifically: curl 'https://ku.wikipedia.org/w/rest.php/v1/page/P%C3%AA%C5%9Fd%C3%AErok/html' -H 'Accept-Language: ku-arab' includes <body id="mwAA" lang="ku" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr" data-mw-parsoid-version="0.20.0.0-alpha16" data-mw-html-version="2.8.0" data-mw-variant-lang="ku-latn">, even though the text is in Arabic script...

I'm closing this issue because the positioning issue for titles and sidebars should now be fixed. Please open a new one for the language variants – they theoretically work now (by appending ?variant=xyz to the URL), but I haven't extensively tested them.

I also hope there is a way to automatically fetch the available variants to display a toggle or something. And as for the Kurmanji version, if that's the only one that has a change in writing directions between variants, maybe I'll just add a line of code for that if the API doesn't want to give me that information...

Hmm, the last part is tricky. Because I *can* get the API to return the article in Arabic instead of Latin, but it's still returning the direction as "ltr" instead of "rtl"... Specifically: `curl 'https://ku.wikipedia.org/w/rest.php/v1/page/P%C3%AA%C5%9Fd%C3%AErok/html' -H 'Accept-Language: ku-arab'` includes `<body id="mwAA" lang="ku" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr" data-mw-parsoid-version="0.20.0.0-alpha16" data-mw-html-version="2.8.0" data-mw-variant-lang="ku-latn">`, even though the text is in Arabic script... I'm closing this issue because the positioning issue for titles and sidebars should now be fixed. Please open a new one for the language variants – they theoretically work now (by appending `?variant=xyz` to the URL), but I haven't extensively tested them. I also hope there is a way to automatically fetch the available variants to display a toggle or something. And as for the Kurmanji version, if that's the only one that has a change in writing directions between variants, maybe I'll just add a line of code for that if the API doesn't want to give me that information...
kumi closed this issue 2024-08-19 12:16:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: PrivateCoffee/wikimore#16
No description provided.