wikimedia / interconnection-wordpress-theme

WordPress theme created for https://diff.wikimedia.org/
GNU General Public License v2.0
3 stars 0 forks source link

737: RTL languages do not show dates correctly in grid of posts #51

Open pamprn09 opened 4 months ago

pamprn09 commented 4 months ago

I've Added specific date format for the rtl languages.

allysonsouza commented 2 months ago

@pamprn09 @kadamwhite @goldenapples Looking at the issue, what I was thinking is that we could register a string on Polylang for the date format, allowing localisation of it. It seems more bug proof and doesn't generalise the date display by ltr or rtl, which is not exactly what dictates the date format to be displayed, but what is commonly used for the locale.

Stack Overflow solution reference: https://stackoverflow.com/a/50718299

goldenapples commented 2 months ago

Allowing the date format to be localized is good practice for internationalization, but I don't think that's the issue this ticket is covering. The issue is that even if the format is correct in the markup, like "15 March 2024", it will be displayed out of order visually it's in an element with a dir of "rtl", like this: (I've manually added the dir attribute, it's not in the actual site)

image

I'm actually not sure if this is still a bug - I haven't found a page on the diff blog which is broken, so I'm not sure if we've somehow fixed this, or if new browsers have just gotten smarter about recognizing the correct directionality of text.

kadamwhite commented 2 months ago

@ckoerner Sounds like we've got some ambiguity about this ticket, if you have time to confirm whether it's still an issue.

allysonsouza commented 2 months ago

The <span> has direction set to ltr on CSS, to ensure the order of date + posted by %author%, so I don't think we want to change it. If what we want is to change the order in which date parts are displayed, the internationalization would do the job.

ckoerner commented 2 months ago

It looks like something has been fixed along the way. Here's a screenshot from 2022 (from the humanmade/Wikimedia repo issue)

6a3e7655-807f-484b-b11b-d9f77294d683

So the original issue is resolved.

That said, to be correctly formatted RTL, the byline should be like this:

(saved before finishing my thoughts) Where "by" and "and" would be localized strings. The rest would be metadata. The ideal vs reality is that we don't localize names so it looks strange (LTR names like "John Smith" appearing in bylines) Example: https://diff.wikimedia.org/he/