Skip to content

[5.3] RTL Calendar Days #44900

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

Merged
merged 2 commits into from
May 19, 2025
Merged

[5.3] RTL Calendar Days #44900

merged 2 commits into from
May 19, 2025

Conversation

brianteeman
Copy link
Contributor

@brianteeman brianteeman commented Feb 14, 2025

When the calendar is being displayed with an RTL language the data in the calendar is correctly ordered RTL. However the names od the days is incorrect as this remains LTR

This PR adds a conditional check for RTL and reverses the string of days so that it is displayed correctly

Note that JS is not my thing and it looks like there is code for this already at line 140 but it is not working? Maybe a js expert can see why.

Pull Request for Issue #44818 .

Testing Instructions

Install an RTL language which uses the gregorian calendar OR edit administrator\language\en-GB\langmetadata.xml and set rtl to 1

as this is a js change you will need to apply the pr and then npm run build:js or use a prebuilt package

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

image

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

When the calendar is being displayed with an RTL language the data in the calendar is correctly ordered RTL. However the names od the days is incorrect as this remains LTR

This PR adds a conditional check for RTL and reverses the string of days so that it is displayed correctly

Note that JS is not my thing and it looks like there is code for this already at line 140 but it is not working? Maybe a js expert can see why.

Signed-off-by: BrianTeeman <[email protected]>
@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.3-dev labels Feb 14, 2025
@brianteeman brianteeman mentioned this pull request Feb 14, 2025
@richard67 richard67 added the bug label Feb 14, 2025
@fgsw
Copy link

fgsw commented Feb 14, 2025

Prebuilt packages are not available for download, also not the custom update server:

prebuilt-joomla-fail

@richard67
Copy link
Member

Prebuilt packages are not available for download, also not the custom update server:

Seems there is an issue with a full disk. Will notify some people.

@fgsw
Copy link

fgsw commented Feb 15, 2025

Later created Pull Request have now available Prebuilt packages (this one still not).

@richard67
Copy link
Member

richard67 commented Feb 15, 2025

I‘ve restarted the drone build, so new packages should be available soon.

@richard67
Copy link
Member

Packages are available now.

@richard67
Copy link
Member

Normally I would say this PR is a bug fix so it has to go into 5.2-dev ... but as it comes too late for 5.2.4 it would go into 5.2.5, which will be released just 2 weeks before 5.3.0 stable, so I think it doesn't really matter.

@fgsw
Copy link

fgsw commented Feb 15, 2025

I have tested this item ✅ successfully on 0c4cb29


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44900.

@richard67
Copy link
Member

Install an RTL language which uses the gregorian calendar

@brianteeman I've tested with Urdu, which uses Gregorian calendar, and to see that nothing is broken I've tested also with Persian (Farsi), which uses the Jalali calendar. In both cases the day order changes with your PR. As I don't speak or read Farsi or Urdu I have to investigate if your PR is right. But maybe your testing instruction only forgot to mention Jalali calendar?

@richard67
Copy link
Member

For Urdu (Pakistan) ur-PK, which uses the Gregorian calendar, the PR works as described, i.e. only the direction of weekday headings has changed:
2025-02-15_test-pr-44900_urdu

For Farsi (Persian, Iran) fa-IR, which uses the Jalali calendar, the PR not only changes the direction but also the week start:
2025-02-15_test-pr-44900_persian

As I don't understand Farsi, I can't say right now which one is right.

@richard67
Copy link
Member

richard67 commented Feb 15, 2025

Possibly the code added by this PR should not be added after but before line 654?
No, forget it.

@richard67
Copy link
Member

I've found https://www.parstimes.com/persian/calendar/ , but the day names or abbreviations in the calendar for today look completely different to me:
2025-02-15_test-pr-44900_persian-www

@richard67
Copy link
Member

I've emailed the Persian translation coordinator. I did not get an answer yet, but right now it looks as if this PR fixes the issue also for Persian, i.e. the PR is right. At least that's the feedback I got up to now from discussion in Mattermost.

If that is confirmed, this PR will get a successful test from me.

@brianteeman
Copy link
Contributor Author

I would still like a js person to review this especially because of

Note that JS is not my thing and it looks like there is code for this already at line 140 but it is not working? Maybe a js expert can see why.

@brianteeman
Copy link
Contributor Author

I've emailed the Persian translation coordinator. I did not get an answer yet, but right now it looks as if this PR fixes the issue also for Persian, i.e. the PR is right. At least that's the feedback I got up to now from discussion in Mattermost.

If that is confirmed, this PR will get a successful test from me.

am i wasting my time here

@richard67
Copy link
Member

richard67 commented Apr 26, 2025

I've emailed the Persian translation coordinator. I did not get an answer yet, but right now it looks as if this PR fixes the issue also for Persian, i.e. the PR is right. At least that's the feedback I got up to now from discussion in Mattermost.
If that is confirmed, this PR will get a successful test from me.

am i wasting my time here

@brianteeman No, just leave the PR open. I did not get a reply from them. I will try again and try to find other testers. Give me a bit time. I'm optimistic we can get this ready for 5.3.x, if not 5.3.1 then 5.3.2.

Update: I just see it has already 1 good test (which I've restored after branch update because still valid).

@richard67
Copy link
Member

Ok, I have found out what the issue with the Persian calendar is:

The translators have worked around the issue in their joomla.ini file.

Currently that is:

; Days of the Week
SAT="ی"
SATURDAY="یکشنبه"
SUN="ش"
SUNDAY="شنبه"
MON="ج"
MONDAY="جمعه"
TUE="پ"
TUESDAY="پنجشنبه"
WED="چ"
WEDNESDAY="چهارشنبه"
THU="س"
THURSDAY="سه شنبه"
FRI="د"
FRIDAY="دوشنبه"

When throwing that into a translator or check at https://en.wikipedia.org/wiki/Names_of_the_days_of_the_week you will see that they have used for Sunday the translation of Saturday, for Monday the translation of Friday, for Tuesday the translation of Thursday, Wednesday ir right, for Thursday they have used the translation of Tuesday, for Friday the translation of Monday and for Saturday the one of Sunday.

That means they have worked around the reverse order and also the wrong start of the week and weekend days in their langmetadata.xml.

Or in short words: This PR here is right (as my test for Urdu ur-PK has shown), but it will need a fix in their translations when this PR gets merged and released because it breaks their ugly workaround.

@tecpromotion Do you have a contact to the Persian translators? I had tried the email address from the translation downloads but did not get any answer when I had asked for their advice before.

@richard67
Copy link
Member

I have tested this item ✅ successfully on 7319a4b

I've successfully tested with Urdu (ur-PK) and with German (de-DE), the latter patched to RTL in the langmetadata.xml.

The different week start day (Monday in de-DE, Sunday in the others) was also correctly handled.

The issues I've discovered for the Persian calendar are caused by a wrong workaround in their translation, see my previous comment.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44900.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44900.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 26, 2025
@richard67
Copy link
Member

richard67 commented Apr 26, 2025

In the Persian (fa-IR) langmetadata.xml, the <weekEnd>0,6</weekEnd> should be changed to <weekEnd>5</weekEnd> because due to their current law only Friday is weekend. The <firstDay>6</firstDay> is correct, their working week starts on Saturday.

In the Persian (fa-IR) joomla.ini file, the week days should be changed
from

; Days of the Week
SAT="ی"
SATURDAY="یکشنبه"
SUN="ش"
SUNDAY="شنبه"
MON="ج"
MONDAY="جمعه"
TUE="پ"
TUESDAY="پنجشنبه"
WED="چ"
WEDNESDAY="چهارشنبه"
THU="س"
THURSDAY="سه شنبه"
FRI="د"
FRIDAY="دوشنبه"

to

; Days of the Week
SAT="ش"
SATURDAY="شنبه"
SUN="ی"
SUNDAY="یکشنبه"
MON="د"
MONDAY="دوشنبه"
TUE="س"
TUESDAY="سه شنبه"
WED="چ"
WEDNESDAY="چهارشنبه"
THU="پ"
THURSDAY="پنجشنبه"
FRI="ج"
FRIDAY="جمعه"

@rdeutz
Copy link
Contributor

rdeutz commented May 14, 2025

@dgrammatiko could you have a look here?

Note that JS is not my thing and it looks like there is code for this already at line 140 but it is not working? Maybe a js expert can see why.

@bembelimen bembelimen merged commit c26b622 into joomla:5.3-dev May 19, 2025
4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 19, 2025
@bembelimen
Copy link
Contributor

Thx

@bembelimen bembelimen added this to the Joomla! 5.3.1 milestone May 19, 2025
@brianteeman
Copy link
Contributor Author

thanks

@brianteeman brianteeman deleted the rtl_calendar branch May 19, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.3-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants