I'm facing problem in formatting my strings for RTL & LTR Languages, following is the code
let nameEn = "English"
let obtained = 40
let offStr = "Out of"
var messageOne = String.localizedStringWithFormat("%@ %d %@ %d",nameEn,obtained,offStr,obtained+10)
let nameAr = "الإنجليزية"
let offStr2 = "بعيدا عن المكان"
let messageTwo = String.localizedStringWithFormat("%@ %d %@ %d",nameAr,obtained,offStr2,obtained+10)
result in messageOne
English 40 Out of 50
but expected output is
الإنجليزية 40 من أصل 50
Any guess how Can I achieve that? I tried using unicode for RTL \u{200F}, it fixes problem for RTL but LTR gets disturbed by this, Is there a generic way to do this ?