right-to-left

right-to-left (RTL) in flutter

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 11:49:00
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, how to show right-to-left (RTL) layout in Flutter? first you must add flutter_localizations package to your pubspec.yml dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter now you have two choices : 1. force a locale ( and direction ) on all devices import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; MaterialApp(

Angular 2+ localization (i18n) rtl support

巧了我就是萌 提交于 2019-11-30 09:40:50
What is the best practice for adding right to left (rtl) support into a localized Angular 2+ app (e.g. for Hebrew and Arabic languages)? I looked through several tutorials including Internationalization (i18n) but none seem to be covering that. I would expect, for example, the html direction property (e.g. <html dir="rtl"> ) to be added along with translations defined in 18n attributes at the build step of the app. It is possible to add i18n-dir as described in the docs . So, the best approach I found so far is to add i18n-dir dir="ltr" (where ltr is a default direction) to the root element in

What is the status of Right To Left languages on Android?

坚强是说给别人听的谎言 提交于 2019-11-30 08:30:50
I need to create an application that has strings of many languages, including RTL (right-to-left ) languages. I want to know what is the current status of RTL (Right To Left) support on Android (even on latest API), for example: is it possible to dynamically/statically check if the device's current language is RTL type? I know that it is possible to get the current locale, but i need a more general way to check if the current language is RTL. For example, for English and French it will return false, but for Arabic and Hebrew it will return true. is it possible to set a layout to automatically

How do I position the cursor on the right in EditText

北城以北 提交于 2019-11-30 08:18:14
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. When the user clicks "enter" to start a new line, the cursor moves to the left again. When I use android:gravity="right" , the cursor is OK (on the right) but as the user starts to type the text always moves to the the other side (RTL text moves left). Any ideas how I can align text to the right AND keep the text direction? Its works for me <EditText android:id="@+id/editText1" android:layout_width

Concat RTL string with LTR string in javascript

时间秒杀一切 提交于 2019-11-30 07:53:33
问题 I'm facing trouble in concatenating Arabic string with English string but their order is being messed! I tried + operator and str1.concat(..) but nothing works for me. var a = 'english' var b = 'أ.ب-000082-13' var c = '000004-ر خ-2014.xml' //var myCoolString =a + '\\' + b + '\\' + c; var myCoolString =a.concat("\\",b,"\\",c) document.getElementsByTagName('output')[0].innerHTML = myCoolString; The result was like this: english\أ.ب-000082-13\000004-ر خ-2014.xml 回答1: The characters your are

Why does this code, written backwards, print “Hello World!”

大城市里の小女人 提交于 2019-11-30 06:08:14
问题 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 Hello World! onto the screen; you can see it run here. I can clearly see public static void main written, but it is backwards. How does this code work? How does this even compile? Edit: I tried this code in IntellIJ, and it works fine. However, for some reason it doesn't work in notepad++, along with cmd

How to change navigation drawer font?

大城市里の小女人 提交于 2019-11-30 03:43:26
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 change the font and make it RTL. I searched a lot and I found how to make the drawer RTL. I use this code: getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL); and Android - Is Navigation Drawer from right hand side possible? But as you know this only works in API 17 and above. Please help! How to change the menu font? How to make the layout RTL in right way?! Edited : My font

Android : Change entire app layout directions programmatically

孤人 提交于 2019-11-30 02:58:49
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. I used to add android:supportsRtl="true" to the AndroidManifest and android:layoutDirection="rtl" for each layout but this approach have some problems like below : One problem is when I change the direction to RTL the ActionBar home icon or navigation button (when home as up is enabled) remains LRT and just move to the right. I also tried to change direction programmatically and the result was

Right to left menu items Android in NavigationView

房东的猫 提交于 2019-11-29 15:48:46
im beginer of android. i design a navigation drawer like this: as you see all items in menu are on the right Except "SubHeader". how can i move "SubHeader" item to the right of this menu? i use all properties like gravity, layout gravity, layoutDirection to the SubHeaderItem but it doesn't work. my code is <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:id="@+id/navigation_view" android:layout_gravity="end" android:fitsSystemWindows="true" android:layoutDirection="rtl" app:headerLayout="@layout/navigation_header"

How to get the “up” button used on the Toolbar?

醉酒当歌 提交于 2019-11-29 14:15:41
This is a short question: I'm trying to force the action bar (used by a Toolbar) to use LTR alignment. I've succeeded making the layout itself use LTR, but not the "up" button (as I've done here , before Toolbar was introduced) . It seems this view doesn't have an ID, and I think using getChildAt() is too risky. Can anyone help? The answer Here's one way I've found to solve this, based on this answer . I made it so that it is guarranteed to find only the "up" button, and whatever it does, it will revert back to the previous state it was before. Here's the code: @TargetApi(Build.VERSION_CODES