RTL interface has wrong position for some of popup boxes

AI 生成的摘要

The discussion revolves around an issue with the RTL (right-to-left) interface in Discourse, where some popup boxes appear in the wrong position. enigmaty shares images to illustrate the problem, specifically with the “topic admin actions” and “share a link to this post” popups.

Initial responses from riking and riking suggest that the positioning might be correct, but then acknowledge that it’s actually a bug. enigmaty clarifies that the issue is with the button at the end of each topic, not beside the posts.

simon investigates the issue and shares images from his own forum with the Persian locale selected. He asks about the Discourse version and custom CSS, and later provides a custom CSS solution to fix the problem.

simon explains that the issue is challenging to fix without changing a lot of code but provides a temporary solution using custom CSS. He also mentions that the share-link popup can be fixed with a code change to check for RTL locales.

enigmaty confirms that the custom CSS solution works and expresses gratitude. They also ask about customizing the admin interface, pointing out the lack of an admin_rtl.scss file. simon responds that saving custom styles is disabled for admin pages but suggests using a plugin to add custom styles.

I have RTL interface. When I click on “topic admin actions” the popup box shows on the opposite side.

This is also happens when I click on the created at link (which triggers the share link). Also with “share a link to this post”

Thanks

Can you help me with this @simon?

1 个赞

That’s, uh, technically the correct position for it to be in. It’s supposed to be in the gutter alongside the post stream.

It’s a little far away though, innit? But this is not a RTL layout bug, no.

1 个赞

Maybe the image is not clear. the button is in right of the page (the ranch icon under the topic) and when you click it the box shoes up on the left side. This not what happens on LTR layout. The box shows on the same side of the button.

The Admin box shows on top of the post.

2 个赞

Aah, I thought you were clicking the corner wrench (in the upper-right). Yeah, that’s wrong.

3 个赞

Please, can someone help me with this.

Thanks

This is how it looks on my forum when Persian is selected as the locale. Does this seem correct?

What version of Discourse are you using? Do you have any custom css?

The share-link box has the wrong position.

1 个赞

I am talking about the button right before the end of each topic, not the one that is beside the the posts. It should be right before the ‘Bookmark’ button.

I just setup the latest docker image form the repo, and I do not use any custom css.

Right :slight_smile: I see the problem now. I can try to fix it tomorrow.

4 个赞

Thank you :grinning:

For the topic-admin-popup-menu, without changing a lot of code, I don’t see a good way to change the widget code to get it to work for rtl for both the time-line container (on the upper part of the page) and for the topic-footer-main-buttons.

I think you can use this custom css to get it to work for you. There may be an issue with setting #main-outlet to position relative, but I think it will be ok.

.rtl {
    
    #main-outlet {
        position: relative;
    }

    #topic-footer-main-buttons .topic-admin-popup-menu[style] {
        left: auto !important;
       right: 8px !important;
    }

    .timeline-container .topic-admin-popup-menu[style] {
       left: auto !important;
       right: 40px !important;
    }
}

The share-link popup can be fixed for rtl. It just needs a switch in the code to check if the current locale is rtl. I’ll do that soon if no one else does it first.

3 个赞

Thank you. It worked for me. Even the ‘Share link’ is now better than before (It is closer to the button).
I really appropriate your help. :slight_smile:

I just want to ask you something. Do you have a problem when you customize your admin interface? You see there is no admin_rtl.scss in the code base (there is for desktop and mobile). So when I try to customize any thing in my admin interface, It only works if I am browsing the interface coming from my desktop interface. I mean, if you refresh the page the customization is gone. If you go directly to the admin interface, the customization is gone.

I have a category on my forum for learning Persian (not much it happening with it now, but hopefully soon.) Other than that I don’t use the rtl layout.

I think saving custom styles is disabled for the admin pages. Adding them through a plugin should work.

2 个赞