Right alignment of text (date and sentence start) in the News widget for scriptable

Problem 1: The News widget available in the Gallery for scriptable app is meant for left to right languages. I want to use it with a news source that is in Arabic/urdu which is a right to left language.
Problem 2: I have no understanding of coding. I’m a health care professional and don’t even understand the 123/abc of coding….
I am attaching iCloud link for the original widget (named as widget 3) and a modified widget (named as widget). The modifications are basic such as change of background color, custom url, etc.
may some nice dude here modify either the original widget (widget 3) or fix the modified widget (widget) so that it becomes like this: Date displayed to the right and sentence starts from the right.

iCloud link for the original News widget (named as widget 3): iCloud

iCloud link for the modified widget: iCloud.

Cheers. Nice day

Here you go. I’ve modified your modified version.

To right align the text and times you need to put them into a horizontal stack and add a dynamic spacer to the left of the text. I’ve commented the changes which are on lines 142 - 204.


Dear, this is dope. I spent 3 days fixing it myself. But obviously could not. I got some help on reddit as well from a nice user there but still some sentences would start from right and others centrally. But you take is 100% of what I wanted. I confirm that both date and sentences are now correct for right to left languages.

Lots of respect. Have a nice day :heart::pray:

1 Like

Glad we were able to get you sorted out :slight_smile:

1 Like