apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.92k stars 13.91k forks source link

Superset does not support Arabic language -RTL- layout #25258

Open ca5p3r opened 1 year ago

ca5p3r commented 1 year ago

Screenshots

image

Description

Superset is a powerful data visualization tool, but it does not currently support the Arabic language or the RTL layout. This makes it difficult for users in Arabic-speaking countries to create Superset dashboards in Arabic.

The following are some of the problems that users in Arabic-speaking countries experience when using Superset:

I would like to request that Superset be updated to support the Arabic language and the RTL layout. This would make Superset a more accessible tool for users in Arabic countries.

omar-nelc commented 1 year ago

Hello maintainers,

I'm Omar Al-Ithawi and I'm a Core Contributor in the @openedx project which is also built in Python and React.

In 2014, the Open edX project -- a Learning management system -- had no Arabic or Right-to-Left support and often times lacked uft-8 support on some modules.

Many contributors and myself have worked on this issue until Unicode, Arabic and Right-to-Left has been supported.

I'm planning to do the same for superset. I'm assuming Unicode is supported by Python 3.9, so we need to support Arabic and RTL styles.

For Arabic, we're planning to add translations because it seems to be fairly doable. However, we're reviewing the status of RTL support at the moment to see how can we add it.

alimahwer commented 1 year ago

Hi Omar, I have experience translating some open-source projects into Arabic. So, I will be glad to contribute to the Arabization of Superset. However, We are still waiting for who will take the initiative of adding RTL orientation to Superset. Hope we together can cooperate on this task.

omar-nelc commented 1 year ago

@alimahwer Please feel free to start translating the project even though it lacks RTL support.

I think the two problems can be fixed in parallel, so if you have the capacity to translate it, please do so and tag me for a review if needed.

bmtcril commented 9 months ago

Hi all, has there been any movement on this issue? I haven't been able to find anything related.

rusackas commented 9 months ago

Nope, I think this is in need of volunteers. I'm tempted to close this out as an Issue, since it's not a bug, but rather a feature request. Normally I would, but I'm hopeful someone on this thread might pick it up. If not, we should move it to a Discussion or close it.

bmtcril commented 9 months ago

@omar-nelc is one of our contributors so I'll round up with him and see if we can help push this forward, we'd love to have it!

OmarIthawi commented 9 months ago

@rusackas and @bmtcril thanks for keeping this issue active.

The lowest hanging fruit is to find static CSS files and process them with rtlcss on the CSS files and it would generate two files:

This framework is flexible and works with many other frameworks and systems.

The other part is to ensure the UI loads the correct file depending on the chosen user language.

Other super-set work seems to be needed such as extending styled to support RTL without needing to edit individual components similar to how rtlcss would work.

There will be some UI issues after we and it's manual frontend work to fix those. From system to system it varies, but it's a doable work in general.

Would the Superset team be open to add such build steps? Whether we contribute it or the core team does that.

rusackas commented 9 months ago

Whether we contribute it or the core team does that.

We're open to contributions! You're right that <styled> (or any other Emotion-based theming methods) would need to support this. We're moving toward that library and away from LESS/CSS files, so anything based on only those files will have less and less impact as we move away from them.

I don't know of anyone on the PMC/Committer roster who has this on their roadmap, so we'd have to lean on other contributors from this thread to take action here :) Thanks in advance!

OmarIthawi commented 9 months ago

Thanks @rusackas that makes it clear.

I'll see if my team is up to take a stab on this.

The initial suggested approach is to provide a custom styled with the following logic:

// Pseudo-code here
const bidiStyled = (args...) => {
    args.styles = args.styles.replace('margin-left', 'margin-right');
    return styled(args...);
}

const Section = bidiStyled.section`
  margin-left: 20px;
  padding-top: 10px;
`

In an RTL document, it would cause margin-right to be used.

An alternative is switch hard-coded direction properties like padding-left to context-dependent padding-block-start and similar properties. What's your opinion on that?

Applying those properties would allow (ideally) a single switch <html dir="rtl"> to flip the page direction and the rest is the browsers-work:

I've checked browser support and it seems to have good support 96%+:

Luckily, flex UI and many other CSS properties automatically adjust when <html dir=rtl> is used as shown in the screenshot below -- it's not too broken, which is a pleasant surprise!!

image

rusackas commented 9 months ago

I love the idea of switching to {padding/margin}-block-{start/end} if that unblocks this. My two questions:

• Is there a listing rule that can protect against people using the more common/obvious padding/margin attributes? • Would/could a listing rule actually fix this? • How many people use IE11, and is it OK to officially drop support for this? I would think everyone is using Edge by now... I don't see any IE users in the Superset website's stats, but we don't really know this stat for Superset itself.

Pinging a few others here who might have opinions on the matter: @kgabryje @mistercrunch @michael-s-molina

OmarIthawi commented 9 months ago

I love the idea of switching to {padding/margin}-block-{start/end} if that unblocks this. My two questions:

Great!

• Is there a listing rule that can protect against people using the more common/obvious padding/margin attributes?

I'd think not. This use case is very specific React JSX and Styled, but I presume we could fallback to basic grepping and develop a rather naive string-checking approach and it would work. I hope there's a better code aware tool, but once we start developing it'll be clearer.

• Would/could a listing rule actually fix this?

Usually yes. But it'll be annoying to both first-time and occasional contributors.

• How many people use IE11, and is it OK to officially drop support for this? I would think everyone is using Edge by now... I don't see any IE users in the Superset website's stats, but we don't really know this stat for Superset itself.

I can't say much about that.

michael-s-molina commented 9 months ago

My two cents:

OmarIthawi commented 7 months ago

Status:

CodeWithEmad commented 4 months ago

Hey @OmarIthawi, just checking in to see if there have been any updates on this over the past few months.

OmarIthawi commented 4 months ago

@CodeWithEmad the translations is ready, and we're pushing it to Superset soon. RTL work is still needed.

OmarIthawi commented 2 months ago

Arabic translations have been merged and I suppose it's scheduled for release in 4.1 or 4.2.

@CodeWithEmad @ca5p3r @alimahwer we appreciate some help in the RTL efforts.

@rusackas if you happen to know, would you mind letting us know in which release https://github.com/apache/superset/pull/29586 is expected to be included?

alimahwer commented 2 months ago

Arabic translations have been merged and I suppose it's scheduled for release in 4.1 or 4.2.

@CodeWithEmad @ca5p3r @alimahwer we appreciate some help in the RTL efforts.

@rusackas if you happen to know, would you mind letting us know in which release #29586 is expected to be included?

Dear Omar, I'm more than happy to contribute to the Arabic translation of Superset. I have a great experience in the Arabization of many FLOSS projects. However, I would like to learn more about the progress of RTL support.

OmarIthawi commented 2 months ago

@alimahwer The arabic translations has been mostly completed by my colleauge @abdilra7eem in

If you want to take another pass and to see if more translation is needed please go ahead.

However, the critical need at the moment is RTL. No one is working on RTL at the moment as far as I know.

CodeWithEmad commented 2 months ago

Hi @OmarIthawi. I haven't done anything in the RTL area in the superset project, but I'll be glad to help.

OmarIthawi commented 2 months ago

Same here @CodeWithEmad, but glad you're willing to help.

Please review the comments in this https://github.com/apache/superset/issues/25258 issue, that's all what we have at the moment.

mayankeagle commented 1 month ago

Hi @OmarIthawi how do I get access to the Superset version which incorporates the RTL feature?

OmarIthawi commented 1 month ago

@mayankeagle no work has been done on RTL support as far as I know. Only Arabic translations on the LTR User Interface.

mayankeagle commented 1 month ago

@mayankeagle no work has been done on RTL support as far as I know. Only Arabic translations on the LTR User Interface.

Hi @OmarIthawi Ok, thanks. And are the Arabic translations supported on the latest GA release version of Superset, under Apache 2.0 license?

OmarIthawi commented 1 month ago

@mayankeagle, no. The Arabic isn't released yet: https://github.com/apache/superset/releases

It's only available in the main branch.

mayankeagle commented 1 month ago

Hi @OmarIthawi thanks for the confirmation.

Could you please point me to the pull-request for this?

I would like to take a look at all the files that were modified/ added as a part of this and to understand if it includes code-changes or only resource files.

OmarIthawi commented 1 month ago

here you go @mayankeagle https://github.com/apache/superset/pull/29586

CodeWithEmad commented 1 month ago

Hey @OmarIthawi. Just a reminder that Superset uses Flask-AppBuilder and to have full support for the Arabic language, you need to add translations to that project too. I didn't see Arabic translations there.

OmarIthawi commented 1 month ago

Good note, thanks @CodeWithEmad! I think this one has to wait a bit. Superset at Open edX is not very well implemented at the moment and we're not actively using it as we should so translation have stalled.