Questions tagged [right-to-left]
Right to Left (RTL) refers to the scripts of natural languages that are written and read from the right to the left instead from the left to the right, such as Hebrew, Arabic and Persian. For problems with interaction of right-to-left and left-to-right text, prefer the "bidi" tag.
right-to-left
1,645
questions
270
votes
5
answers
18k
views
Why does this code, written backwards, print "Hello World!"
Here is some code that I found on the Internet:
class M{public static void main(String[]a){System.out.print(new char[]
{'H','e','l','l','o',' ','W','o','r','l','d','!'});}}
This code prints ...
129
votes
10
answers
105k
views
Android context.getResources.updateConfiguration() deprecated
Just recently context.getResources().updateConfiguration() has been deprecated in Android API 25 and it is advised to use context.createConfigurationContext() instead.
Does anyone know how ...
100
votes
11
answers
29k
views
RTL in Markdown
Is there any existing addon spec for markdown that includes support for RTL languages?
What I'm hoping for is something like
This paragraph is left to right
<- This paragraph is right to left
...
93
votes
7
answers
113k
views
right-to-left (RTL) in flutter
I was using Flutter more than a week, and wanted to create an Arabic (right-to-left) app.
I was reading Internationalizing Flutter Apps, but it didn't mention how to set the layout direction.
So, ...
90
votes
15
answers
140k
views
How to set Navigation Drawer to be opened from right to left
First of all I know this question appeared here before but after trying a lot I still didn't succeed.
I working on the example from
Android Developers site.
I'm trying to set the menu to be opened ...
74
votes
16
answers
57k
views
Aligning right to left on UICollectionView
this is a pretty straightforward question, but I haven't been able to find a definitive answer to it on SO (if I missed it, please correct me).
Basically, my question is: Is it possible to align ...
69
votes
12
answers
87k
views
How to make the text direction from right to left
I want to write text in (right to left language i.e. Arabic) in a TextView. But I want to make the text writing direction from right to left. gravity:rightwill align the text to right only. I want to ...
60
votes
17
answers
49k
views
Identifying RTL language in Android
Is there a way to identify RTL (right-to-left) language, apart from testing language code against all RTL languages?
Since API 17+ allows several resources for RTL and LTR, I assume, there should be ...
49
votes
2
answers
2k
views
UITextView renders custom font incorrectly in iOS 7
My app uses a UITextView to input Syriac text (Estrangelo font), but UITextView renders some letters incorrectly like this:
I tested it with a UILabel and a UITextView. UILabel displays it correctly, ...
48
votes
9
answers
120k
views
Right to left Text HTML input
For my website, i need to provide arabic support. Part of it is to provide input textboxes where when user types in, the new characters have to be appended to the left and the text has to be right ...
45
votes
3
answers
20k
views
How to specify RTL specific drawables
I have few images that looks different on right-to-left.
Is it possible to create rtl specific drawable directory or some rtl post-fix for file names to auto-load relevant images?
Looks like ldrtl ...
45
votes
10
answers
40k
views
Android : Change entire app layout directions programmatically
How can I change entire app layout direction to RTL?
I am writing an app that user must select it's language in first launch and the layout should change based on user selection to RTL or remains LTR.
...
44
votes
2
answers
34k
views
Right to left edges in dot (Graphviz)
I'm trying to display edges going from right to left (i.e. backwards) using dot:
C <- A -> B
The best I could do was:
digraph {
a -> b;
c -> a [dir="back"];
{rank=same;c a b}
}
.....
43
votes
9
answers
21k
views
android determine if device is in right to left language/layout
Is there a way to determine if the device is in a right to left language (something like Arabic) as opposed to something that's left to right (English)?
Something compatible with older API levels (...
43
votes
1
answer
18k
views
RTL Support: Disabling it only for specific UI components
I have a custom video player Activity.
I am forced to enable RTL Support in my Application.
But doing so will result in a Right-To-Left aligned ProgressBar. (And that looks ugly)
I want my ...
43
votes
3
answers
18k
views
How can I use a right to left language in "Sublime Text" editor
I want to use some strings which are in my language (Persian) in "Sublime Text", but the editor does not show them correctly, for example:
it should be:
<title>عنوان صفحه</title>
but ...
42
votes
4
answers
13k
views
Matplotlib: Writing right-to-left text (Hebrew, Arabic, etc.)
I'm trying to add some text to my plot which is RTL (in this case, Hebrew). After some work managed to get it to display the text, but it's displayed LTR (meaning, in the reverese order). I've dug ...
39
votes
3
answers
20k
views
Why is a trailing punctuation mark rendered at the start with direction:rtl?
This is more a sort of curiosity. While working on a multilingual web application I noticed that certain characters like punctuation marks (!?.;,) at the end of a block element are rendered as if they ...
37
votes
6
answers
17k
views
brackets displays wrongly for right to left display style
The html code
<html dir="rtl">
<p>hello (world)</p>
</html>
you will see a page like this:
(hello (world
However,if I change the html code into
<html dir="rtl">
<...
37
votes
6
answers
20k
views
Twitter Bootstrap CSS that support from RTL languages
I just discover Twitter Bootstrap and I'm wondering if there is a right-to-left (RTL) version of it.
Does anyone know?
36
votes
5
answers
10k
views
RTL is forced in RTL devices
The new version of React Native has issued support for RTL devices:
https://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html
However, it seems that in ...
35
votes
5
answers
18k
views
use locale (ltr/rtl) for gravity in TextView
I have a simple TextView which should have android:gravity="left" for ltr system locales and android:gravity="right" for rtl system locales.
The obvious choice would be: android:gravity="start" but ...
35
votes
5
answers
6k
views
UICollectionView iOS 9 issue on project with RTL languages support
It seems like Apple's new feature of auto-flip interface on RTL languages cause problems when using UICollectionView.
I used constraints of type Trailing/Leading for the collection view and they ...
34
votes
5
answers
4k
views
Why does "[x]y" display incorrectly in the RTL direction?
<div style="direction: rtl">
[x]y
</div>
You can see HTML text [x]y displays as x]y].
What is the reason of that result?
PS: I get that result in Chrome 56.0.2924.87 (64-bit).
33
votes
5
answers
10k
views
How can I fill RecyclerView with GridLayoutManager from right to left
I'm trying to fill some data into a RecyclerView with GridLayoutManager:
GridLayoutManager layoutManager = new GridLayoutManager(this, 3, GridLayoutManager.VERTICAL, false);
This will fill the data ...
31
votes
7
answers
40k
views
How to change navigation drawer font?
I want to use my own font for navigation drawer in android.I use the library comes with android studio according to this answer: https://stackoverflow.com/a/23632492/4393226.
But I don't know how to ...
31
votes
8
answers
15k
views
RTL is on web page reverses numbers with a dash
When my website displays Hebrew text mixed with numbers, and there is a number with a dash in the middle, the number with the dash in the middle is displayed RTL. For example, with the text:
רמה 4–0,...
31
votes
5
answers
17k
views
How to detect whether a character belongs to a Right To Left language?
What is a good way to tell whether a string contains text in a Right To Left language.
I have found this question which suggests the following approach:
public bool IsArabic(string strCompare)
{
...
30
votes
9
answers
32k
views
RecyclerView Grow Element From Right to Left
i use RecyclerView in horizontal direction and New element is left to right. and scrolling is ltr. how to change this direction?
Xml Code:
<android.support.v7.widget.RecyclerView
...
30
votes
6
answers
6k
views
Right To Left SnackBar
I want to display a text with an action on Design Support Library SnackBar.
My language is writen in Right-to-Left. So how can i change SnackBar text and action direction?
Something like this:
30
votes
2
answers
7k
views
Set LayoutDirection (RTL) for api lower than 17
I am going to build a Persian app (RTL).
my app includes a ListView and a Navigation Drawer
.
I added in Manifest in application tag android:supportsRtl="true"
and in onCreate() method: getWindow()...
29
votes
11
answers
198k
views
slideToggle JQuery right to left
i'm new in JQ
i have this script i found on the internet and its do exactly what i need
but i want the sliding will be from the right to the left
how can i do it? please help
this is the code
<...
28
votes
2
answers
10k
views
How to handle RTL languages on pre 4.2 versions of Android?
Background
TextView always had issues with RTL (Right-To-Left) languages. Since I know only how to read Hebrew (in addition to English), I will talk about its issues:
Text alignment (and I'm not ...
28
votes
6
answers
4k
views
How to detect on which side of the browser is scrollbar - right or left (in case of RTL)?
For <html dir="rtl"> some browsers (Safari, Edge, IE) will automatically move the scrollbar to the left side which is the correct behavior:
Unfortunately, major browsers (Chrome and Firefox) ...
27
votes
2
answers
17k
views
Force RTL layout direction not working for app
I'm trying to add RTL language support in my app (specifically Arabic right now). I'll be supporting English as well. What I've done:
Set minSdkVersion to 17
Added android:supportsRtl="true" to my ...
26
votes
10
answers
44k
views
Changing to right to left RTL programmatically
I'm working on an App which supports two languages: English and Arabic.
When the user changes the language to Arabic, I need my app to make the text right-to-left (RTL).
I searched for this issue, ...
26
votes
6
answers
19k
views
JavaScript: how to check if character is RTL?
How can I programmatically check if the browser treats some character as RTL in JavaScript?
Maybe creating some transparent DIV and looking at where text is placed?
A bit of context. Unicode 5.2 ...
25
votes
5
answers
18k
views
Javascript - how to find hebrew?
i"m trying to fint if a string starts(first letter) width an RTL language/ hebrew.
any ideas?
24
votes
4
answers
2k
views
Right to left languages support in R, using Mac
I am wondering if there is anyway to support right-to-left languages in R while using Mac
For instance suppose the following code:
x <- data.frame(a=runif(10),b=runif(10))
ggplot(x, aes(a,b)) + ...
22
votes
3
answers
14k
views
Display phone numbers as left-to-right in right-to-left language
I have a display of a users contact details where the user can alternate the display between left-to-right and right-to-left text.
In the Arabic language, the text is displayed and read from right-to-...
22
votes
1
answer
15k
views
The project references RTL attributes, but does not explicitly enable or disable RTL support [duplicate]
In Eclipse manifest file , i get a warning message. Application language is Turkish ( Not right to left ).
"The project references RTL attributes, but does not explicitly enable or disable RTL ...
22
votes
4
answers
10k
views
android : is constraint layout support RTL
what is the best practice to support RTL in constraint layout in android Studio,
or should I create A separated layouts one for English and the other for Arabic?
English Version
The Expected layout ...
21
votes
5
answers
6k
views
RTL shows numbers at the end of lines
Trying to display a hebrew string that starts with a number, always displays the number at the end of the string like so: 1. יום שישי בבוקר
but I need the number to be displayed at the right side of ...
21
votes
6
answers
39k
views
Bootstrap - Change direction of the navbar
I've using Twitter bootstrap and trying to align the navbars' text to the right, i.e - that the "brand" will appear on the right, and all else to the left of it. (For right-to-left website).
Any ...
21
votes
7
answers
37k
views
Right to left (RTL) support in React
What would be the best way to implement RTL support in React apps? Is there a way to override default <p> and <span> tags (components) to add RTL support so that I don't have to rewrite ...
21
votes
5
answers
20k
views
How do I position the cursor on the right in EditText
My application uses RTL language (right to left).
When the EditText field gets focus, the cursor appears on the left and only when the user starts to type, the cursor (and the RTL text) moves right.
...
21
votes
2
answers
1k
views
Insert RTL text correctly in PHPWord template
I'm using PHPWord template processor to insert some text in a template.
The word template is formatted LTR as all the labels are English.
Here is the line in the word template:
User Name: ${name}
...
20
votes
3
answers
14k
views
How to detect that text typed in text-area is RTL
I have a textarea in which the user can enter text in english (or any other left-to-right language) or in a language that is RTL.
When the user writes in RTL, the user must press Right-shift + ctrl ...
20
votes
4
answers
49k
views
Left and right padding (not leading and trailing) in SwiftUI
A padding modifier in SwiftUI takes an EdgeInsets, eg
.padding(.leading, 8)
However, there are only leading and trailing EdgeInsets, and not left and right. This presents a problem because not ...
19
votes
3
answers
6k
views
flutter RTL syntax error with "package:intl/intl.dart"
Hi i recently try to use a date Picker for flutter and i didn't find any Doc or tutorial for it so i open flutter gallery project and try to copy code .
as following the code i import "package:intl/...