How to load Key values in Dynamically Localizable.strings file objective c - ios

Any one help me at runtime, How to load key message value in Localizable.strings file objective C?

No way to do this.
Currently iOS supports the localized (.strings) files from Bundle. Bundle is read-only, so you can't change it's content.
Your requirement is possible if the localized (.strings) file is writable, for that it should be in document directory. But currently there is no way to read localized (.strings) files from document directory.
I don't know whether it can be a alternative for your solution or not: You can use NSLocalizedStringFromTableInBundle() for reading the localized content from other bundle.

Related

Can I programmatically change the text of the Localizable.strings file? [duplicate]

I want to be able to update localized strings by code from the app. What I actually want to do is to make changes to the localization on a server and then let the iPhone application fetch updated localization strings from a server and then save them to the localizable.strings file.
You can't ! Those files are part of the bundle and can't be updated. You will have to setup the whole translation framework by yourself (which is not that much work) and implement caching using either core data or serialized dictionaries (one for each language I suppose).
You won't be able to modify the Localizable.strings file in your app bundle because the app bundle is read-only on iOS devices. To grab localized strings from a strings file in your app's Library directory, you could programmatically create a bundle at that location, put a Localizable.strings file in it and then grab the localized strings with NSLocalizedStringFromTableInBundle(). (I haven't tried this but it should work.)
There's service (Get Localization) that allows you to upload those .strings files to server and fetch them via API. However there's no client for iPhone yet but it would be quite simple to do. You can contribute one or then wait that there's official available.

iOS - fastlane deliver, localized App Store description from strings file?

I'm getting ready to have my app localized into other languages.
I'm using NSLocalizedStringWithDefaultValue to provide default English text within code, although I guess none of that maybe relevant.
I'm not adding localized text directly to nib or storyboards, everything is in my strings file.
I'll probably end up uploading those to a localization site.
So I'd like to use fastlane deliver to upload screenshots and meta data.
However I'd like to find a method where I can pickup values from my strings files.
So I guess my question is, how can I get my strings value into my deliver text file?
Or is there a better / quicker approach I should use?

mergExt - localizing app with mergSettings on iOS

I'm localizing my iOS app and having difficulty translating strings in the mergSettings extension for LiveCode. I setup a new folder - ja.lproj. Then, I made a new file called "Localizable.strings" inside of that folder. I then created "key" = "value"; pairs. I loaded the app and the strings were not translated.
Any ideas on what to try next? Monte?
The settings bundle has it's own localized resources folders so ja.lproj needs to be inside Settings.bundle. Also I'm assuming when you loaded the app the locale was set to ja?
EDIT
The file should be named Root.strings

C FOpen() Open Documents Directory iOS

I need help getting access to the documents directory using only C on iOS.
I have my .c file looking for a specific file in the application bundle. I have no problem accessing this file. It looks like this: fopen("filename",
Unfortunately, if I want to move that file to the documents directory, appending "/Documents/filename" doesn't work.
I know how to access the file using an objective-c class, easily, using filesystemrepresentation. But I don't know how to do it only in C. Any help would be greatly appreciated!
Thanks!
Fopen defaults to the directory that the executable file is in, ".app/" - on iOS.
I was able to get to the documents directory by making a char of the Current Working Directory and then removing the last couple characters of the char to get out of the ".app/" bundle and then appending the Documents path to the end of it.

Custom file types with iOS Document Interaction Programming

I understand the basic of Document Interaction Programming and UIDocumentInteractionController and I've got it working in my app. However I'm having trouble with specific details of using custom file types. I can't find this addressed in the Apple docs anywhere.
My app uses it's own file types with unique extensions. The files themselves are just plists (xml), but I want the device to treat the files as only openable in my app. Originally I implemented the Document Interaction stuff to treat them as XML while I got it working, but now I want it to treat them as binary files that it needs to hand off to my app.
At the moment, if you have one of my files in an email attachment, iOS first shows the QuickLook (which just spews all the text content of the xml out) before you can choose to Open In. Similarly if one of my files is opened with Safari, Safari just shows the XML and doesn't give you the option to show it in my app at all.
So how do I get iOS to not treat my files as XML? I've changed the "Conforms to UTI" value and "public.mime-type" value in the info.plist, but it seems to have no effect.
Any tips greatly appreciated.
As far as i understand the UIT concept of Apple you cannot just change the file extension to change a potential UIT of the file. If the file contains XML-Data, other apps as well as internal apps might recognize your content and show it internally as XML.
Try to store your Plists with NSPropertyListSerialization NSPropertyListBinaryFormat_v1_0 (then you readble XML)
When you did that without success, why not trying this:
use zlib to compress the XML plists afterwards to a zipped file.
make a "unique" file extensions (<file>.myappname)
this should "hide" other apps and quick view.
Tell me if one of the ways did work for you.

Resources