facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.34k stars 24.36k forks source link

I18nManager.swapLeftAndRightInRTL() doesn't work #19942

Closed sajaddp closed 5 years ago

sajaddp commented 6 years ago

Environment

Environment: OS: Windows 10 Node: 10.5.0 Yarn: 1.7.0 npm: 6.1.0 Watchman: Not Found Xcode: N/A Android Studio: Version 3.1.0.0 AI-173.4720617

Packages: (wanted => installed) react: ^16.4.1 => 16.4.1 react-native: ^0.55.4 => 0.55.4

Description

As an RTL native language, I should say that while using the following command in the native RTL apps, left and right mustn't be swapped! I18nManager.forceRTL(true); Apparently, swapLeftAndRightInRTL is for avoiding this swape, but each of the following commands does not make any changes I18nManager.swapLeftAndRightInRTL(false); and I18nManager.swapLeftAndRightInRTL(true); Please go through this problem.

Note: in native RTL apps, while using I18nManager.forceRTL(true), two conditions may happen in the first run:

  1. User's Android language is set to an RTL language (e.g. Arabic, Persian etc.) and what is displayed is the same for the other runs.
  2. User's Android language is set to an LTR language (e.g. English) and the first display is mirrored. Therefore, if swapLeftAndRightInRTL works properly, the problem can be fixed.
sajaddp commented 6 years ago

...

stale[bot] commented 6 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

sajaddp commented 6 years ago

This problem still exists on latest version

Titozzz commented 5 years ago

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.