Skip to content
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

[BUG]: Terms of Service and Privacy Policy content should still be left-aligned, even if the app is in an RTL language. #5039

Open
seanlip opened this issue Jun 9, 2023 · 20 comments · May be fixed by #5573
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks.

Comments

@seanlip
Copy link
Member

seanlip commented Jun 9, 2023

Describe the bug

In RTL languages, we are currently keeping our Terms of Service and Privacy policy content in English (so that we can have a canonical version). However, the English text should be left-aligned.

(Thanks to @KolliAnitha for the repro and images, which I took from #5028.)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Home' - Options
  2. Select App language as Arabic
  3. Go back and click on Help - Terms of Service/ Privacy policy
  4. See that the content is right-aligned despite being in English.

Expected behavior
The English content should be left-aligned (but not the note at the bottom of the page linking to the up-to-date policy).

Demonstration
Screenshot_20230608-080139

Environment
Device/emulator being used: Infinix SMART 5
Android or SDK version (e.g. Android 5 or SDK 21): Android 11
App version (you can get this through system app settings or via the admin controls menu in-app): 0.11-beta-8c81c98d8b

@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. triage needed and removed triage needed labels Jun 9, 2023
@adhiamboperes adhiamboperes added Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks. labels Jun 15, 2023
@ShubhadeepKarmakar
Copy link
Collaborator

Same thing is happening on the onboardimg screen.

onboarding.screen.mp4

@ShubhadeepKarmakar
Copy link
Collaborator

ShubhadeepKarmakar commented Sep 27, 2023

I would like to work on this issue.
May I get assigned to it?

@adhiamboperes
Copy link
Collaborator

I would like to work on this issue. May I get assigned to it?

What's your proposal for fixing this?

@ShubhadeepKarmakar
Copy link
Collaborator

ltr.mp4

I would like to work on this issue. May I get assigned to it?

What's your proposal for fixing this?

PoliciesFragmentPresenter

These changes are made in the PoliciesFragmentPresenter.kt class and work perfectly but this is not the correct approach I think. DisplayLocaleImpl.kt class was final in nature but I had to make the DisplayLocaleImpl class open in nature to change the PoliciesFragmentPresenter class.

@adhiamboperes
Copy link
Collaborator

ltr.mp4

I would like to work on this issue. May I get assigned to it?

What's your proposal for fixing this?

PoliciesFragmentPresenter

These changes are made in the PoliciesFragmentPresenter.kt class and work perfectly but this is not the correct approach I think. DisplayLocaleImpl.kt class was final in nature but I had to make the DisplayLocaleImpl class open in nature to change the PoliciesFragmentPresenter class.

I get the sense that you are trying to force the layout direction to be LTR. You don't need to modify DisplayLocaleImpl or override it's methods to retrieve Layout Direction. AppLanguageResourceHandler has a public api for that, getLayoutDirection(). See StateAssemblerMarginBindingAdapters or SurveyOnboardingBackgroundView for usage examples.

@ShubhadeepKarmakar
Copy link
Collaborator

Under the ListItemLeadingMarginSpan class we have the ulSpan class and the olSpan class which takes displayLocal as an input and then retrieves the direction of the layout using the getLayoutDirection() method to get the bullet drawing position.
That's why I created an object of the DisplayLocaleImp class and overridden the getLayoutDirection() method to pretend it's LTR.
OR
We can make another class just for PoliciesTextview which implements Oppia.DisplayLocale class. Everything remains the same as in the DisplayLocaleImp class, we only need to change the getLayoutDirection() method to assert the LTR over the RTL.
rtl_page-0001

@adhiamboperes any suggestion?

@adhiamboperes
Copy link
Collaborator

Under the ListItemLeadingMarginSpan class we have the ulSpan class and the olSpan class which takes displayLocal as an input and then retrieves the direction of the layout using the getLayoutDirection() method to get the bullet drawing position. That's why I created an object of the DisplayLocaleImp class and overridden the getLayoutDirection() method to pretend it's LTR. OR We can make another class just for PoliciesTextview which implements Oppia.DisplayLocale class. Everything remains the same as in the DisplayLocaleImp class, we only need to change the getLayoutDirection() method to assert the LTR over the RTL. rtl_page-0001

@adhiamboperes any suggestion?

The layout direction retrieved will be the same regardless of the function you call to retrieve it, which is why you should use the public function from AppLanguageResourceHandler and don't reimplement DisplayLocale.

@neeldoshii
Copy link

is this issue fixed?
@ShubhadeepKarmakar @BenHenning

@adhiamboperes
Copy link
Collaborator

@neeldoshii, feel free to suggest a fix for this. Please also refer to #5181 (comment) for a potential solution.

@neeldoshii
Copy link

Sure @adhiamboperes, I will release a fix in my PR based on the comment.
Also, is there any communication channel which is used to communicate with other contributors?

@adhiamboperes
Copy link
Collaborator

Sure @adhiamboperes, I will release a fix in my PR based on the comment. Also, is there any communication channel which is used to communicate with other contributors?

At the moment, Our discussions page is the best place to communicate.

@neeldoshii
Copy link

@Vishwajith-Shettigar I am still working on this. If you don't mind can I work on it?

@neeldoshii
Copy link

Hi @adhiamboperes, currently on the debug release we are not able to change the app language?

Is it some kind of issue?

@Vishwajith-Shettigar
Copy link
Collaborator

Hi @neeldoshii if you are working on any issue you should be assigned first, please take care of it, I'm closing my PR and assigning you.

@Vishwajith-Shettigar
Copy link
Collaborator

Vishwajith-Shettigar commented Jan 11, 2024

Hi @adhiamboperes, currently on the debug release we are not able to change the app language?

Is it some kind of issue?

You are using gradle to build i guess, if you want change app language you have to build app on bazel and for this issue you can change your system language to arabic or something like that.

@adhiamboperes
Copy link
Collaborator

Hi @adhiamboperes, currently on the debug release we are not able to change the app language?
Is it some kind of issue?

You are using gradle to build i guess, if you want change app language you have to build app on bazel and for this issue you can change your system language to arabic or something like that.

@neeldoshii, as @Vishwajith-Shettigar said, you can instead change your system language to RTL like Arabic which will also change the app language, if you're unable to build bazel.

@neeldoshii
Copy link

image

I have worked and able to make the text to have in LTR.

I get the sense that you are trying to force the layout direction to be LTR. You don't need to modify DisplayLocaleImpl or override it's methods to retrieve Layout Direction. AppLanguageResourceHandler has a public api for that, getLayoutDirection(). See StateAssemblerMarginBindingAdapters or SurveyOnboardingBackgroundView for usage examples.

I have followed the instructions based on the mentioned.

I am little confused. If you look closely html <li> tags are having issues. The bullet point are always forcefully there in RTL.
If I perform any change in LiTagHandler class and make them forcefully be in left side then it will get broked on some other screen if we use li tags.

Any idea how to solve this?

@adhiamboperes @Vishwajith-Shettigar
Thank You

@Vishwajith-Shettigar
Copy link
Collaborator

@neeldoshii I doubt that texts are still in proper LTR mode according to the screenshot ( look at last sentence of all paragraphs). Better you create a draft PR.

For li tag, you can overload the method related to li tag for privacy page or your can create a new object of displaylocaleimp and override getLayoutDirection to return LTR.
Refer both closed PR.

@adhiamboperes
Copy link
Collaborator

@TanishMoral11, could you work on this issue?

@TanishMoral11
Copy link
Contributor

TanishMoral11 commented Nov 6, 2024

Hey @adhiamboperes,
Yeah Sure, I’d be happy to work on this issue.
Please Assign This To Me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment