rtl-language

How to handle mixed RTL & LTR languages in notifications?

落花浮王杯 提交于 2019-12-20 23:29:32
问题 Background Android 4.3 has added a lot of support for RTL (Right-To-Left) languages, such as Hebrew and Arabic. The problem Even though there is "textDirection", "layoutDirection" and "gravity", I can't find the equivalents for the notification builder, not even in the compatibility library. This means that if there are Hebrew and English words together, the order is wrong. For example (and I write in English for simplicity) : Instead of "X called Y" , you get "Y called X" (suppose "called"

how to turn a Persian (Farsi) paragraph into its list of words in Javascript

别等时光非礼了梦想. 提交于 2019-12-13 07:57:26
问题 I am trying to make an object out of a paragraph that shows words with their frequencies. var pattern = /\w+/g, //the farsi paragraph string = "من امروز در مورد مهر خروج مشمولین اطلاعات جدیدی از سفارت ایران در مالزی گرفتم", matchedWords = string.match( pattern ); /* The Array.prototype.reduce method assists us in producing a single value from an array. In this case, we're going to use it to output an object with results. */ var counts = matchedWords.reduce(function ( stats, word ) { /* `stats

How to handle mixed RTL & LTR languages in notifications?

偶尔善良 提交于 2019-12-03 12:22:41
Background Android 4.3 has added a lot of support for RTL (Right-To-Left) languages, such as Hebrew and Arabic. The problem Even though there is "textDirection", "layoutDirection" and "gravity", I can't find the equivalents for the notification builder, not even in the compatibility library. This means that if there are Hebrew and English words together, the order is wrong. For example (and I write in English for simplicity) : Instead of "X called Y" , you get "Y called X" (suppose "called" is a word in Hebrew), as the string is supposed to be in this format: <string name="notification">%1$s