English and Arabic Language Switching in Single BB 10 Cascades - qml

I have developed a BB 10 Application where I need to provide English and Arabic Language Switching.Now App is working good in English,when the user selects Arabic Language,Total Application is need to be converted into Arabic Language. My App Contains more than 18 Qmls.
each Qml has more than 10 containers.
If it is English, we provide containers Orientation from LeftToRight,If it is Arabic RightToLeft and Label Alignments etc.I have tried to change the Orientation based on User Selection.But I think, it is not a good method to do so.
now my App should switch b/w English and Arabic Languages.What is the best way to do it?
Guide me,
Thanks !!!

I think you are going on right way...
You can save current language in persistant storage and use this value in all QML.
Get current language from persistant storage in every QML and applied orientation according to language..
Some days ago I given you this answer. Just follow this for all QML..

Related

Multiple text Alignments in UITextView (iOS 4 compatible)

I need to use Multiple textAlignments in single UITextView i.e. one para LeftAligned and other Para Right.
I achieved this using NSMutableAttributedString but that's only for iOS 6 as it's crashing on devices with older OS. I am looking for some solution which works on previous iOS versions too. Ideally iOS4.3 compatible solutions. I had checked several solutions uploaded on SO here but couldn't find which does set multiple alignments to be exact. May be due to my little knowledge regarding core text, I am unable to use it. Some specific help with sample code will help much.
Thanks
If you are only displaying the text (without editing), you could use a UIWebView and CSS for text styling.

How can I allow the user to style font in NSTextView using interface buttons in xcode?

In short:
I am trying to find information about text styling inside an NSTextView. Bold, italics, indentation, making a word completely uppercase and setting backdrop colors to certain lines.
Any and all info is welcome. I've been looking around the web for docs on the subject and only managed to find a few things that seem to be part of an iphone framework. I'm sure there must be something out there and that I'm just searching for the wrong words.
A few details:
I am not a developer. I am a motion graphics artist and screenwriter. I do know html, php, javascript, css and several scripting languages (all very similar to javascript) used by different graphics apps.
I am not very proficient in objective-c but I've taken up writing a screenwriting app as a bit of a side project. I've been teaching myself objective-c from a book call Cocoa Programming for Mac OSX and using the code I've created from the examples in the book to create my app using Xcode. Styling text was not covered and I am at a loss as to how to approach it.
Screenplays have very specific formats. Using css I could create this format easily so my first thought was to find out if text inside a NSTextview can have css applied to it. I've not found anything that could answer this. Of course I am probably way off with this approach.
Again, any help or anyone who can point me in the right direction would be extremely appreciated.
Thanks!
-Omar
You can't do this because it only accept one style.
You have to deal with UIWebView Tutorial for this and use your CSS.
Or you can use some code like EGOTextView. I do not test this but I think it will be the easiest way for you.

Setting parts of a String to Bold in UIView

I'm parsing an XML file an get a string as NSMutableString.
Now I want to show this string as text in my UIView.
So, I created a TextView and set its value to my string. The result was that I have the text with HTML Tags shown up in the TextView.
There is no problem removing the tags from the string, but some of the text needs to appear as bold.
Is there any way to display parts of a string as bold programmatically?
I replaced <br> Elements with \n and it works fine for line-break.
But I still don't know what I can do to display words between strong tags as bold in the UIView.
There are two ways. The first is by displaying them in UIWebViews; prior to iOS 4.1 this was effectively the only way. Because you already have HTML codes in the text, it would certainly be easy.
If you're ok with your app running only on iOS 4.1 and up you can use Core Text, which provides very rich formatting.
EDIT
Apple provides some good resources:
About Text, Web, and Editing Support in iOS
Core Text Programming Guide
WWDC 2010 Session Videos -- follow the link to iTunes and grab session 110: Advanced Text Handling for iPhone OS
(Apple Developer login required)
You may use UIWebView and load your content from an NSString object.
Anyway if you want to stick to Cocoa, have a look to NSAttributedString.

Search and Highlight text in PDF for IPad

I am working on the PDF App for iPad and facing an issue: how to search a text in PDF and also how to highlight that text?
Yours is the same big problem I'm having. My understanding is that, currently on iOS 4.0, the main public API is CGPDF . It allows us to parse PDF, and with it we can search strings in it. See also this Quartz 2D document. It also allows us to render it on the screen using CGContextDrawPage. However, it's not yet possible to get the position of a text in the rendered image. (On OS X it's possible using PDFKit.)
So, I'm afraid that you need to implement the PDF spec yourself to get that info. I think GoodReader etc. is working very very hard to implement these.
I had the same trouble recently and then I found FastPDFKit. Have tested the package and it's working great.
http://mobfarm.eu/fastpdfkit

Current Text Direction (BiDi support) in Cocoa?

I recently received an Arabic translation for my app, but would like to do more than simply replace the strings. I can re-layout most of the NIBs with Interface builder, but there are a few things that I need to do programmatically.
Is there some way in Cocoa to figure out if the current locale is a RightToLeft locale, or do I just have to check to see if the current locale is Arabic or Hebrew?
I have been searching for any "Bidi" articles or information for Cocoa apps for a while now, but without much luck. Any suggestions?
Thanks.
In 10.6, see -[NSApplication userInterfaceLayoutDirection]. For earlier releases, no explicit support, so yeah, you could just look for specific locales.
You can do a respondsToSelector check to use -userInterfaceLayoutDirection on any system on which it is available.
See the AppKit release notes for this and other changes.