I'm interested in creating lproj localization files for iOS/Mac apps programmatically. Ideally using .NET. From what I can gather, they're just zipped XML files. Is there any sane way of creating these or something which may give me a headsatart like an lproj equivalent of .NET's ResxWriter?
Related
I need to maintain a project that produces two applications.
I've created two targets that share all the view Controller and Models. The only difference in these targets are storyboards and a couple of configuration files.
For Localizable.strings file I don't see any problem, as I said View Controllers and Models are shared and I've used NSLocalizedString function in these files. My doubts are related to the .storyboard files translation. Since the storyboards are really similar (they differ for the most for colors, position of some elements and for a couple of label text) I feel that is useless to maintain different strings file that contains almost the same data.
Any suggestion? Is there a way to use the same translation file for different storyboards?
If your strings are identical, I would move to Base Internationalization and keep the text in .strings files rather than in localized .storyboard files.
I have an IOS project that has a es.lproj folder with a string file inside it. Now within the project I have a sub project (feedback system) that has its own es.lproj folder with a string file inside.
The problem is that the app when testing is choosing to translate the text based upon only one of the string files and is ignoring the other.
I want to keep the localisation for the feedback system separate so is it possible to have two of the same language files within the project?
All you need to do is use NSLocalizedStringFromTable instead of NSLocalizedString.
In your subproject, specify a table name for all of your strings.
I have a larger project with about 20 strings files using this approach.
You will probably need to use the genstrings command-line tool to generate the strings files from your code.
I have (quite a bit of) static files that I need to deploy with my application that is built on top of a legacy .NET library. These include several XML and config files, and a read-only database in the 10's of Megabytes.
Most forums I have seen indicate that the best way to accomplish this is to reference the needed files in a project, and set them to Content and "Copy to Output Directory".
I have two issues/questions dealing with this:
Adding these files, and setting them to "Content" seems to not only copy the files over, but embed them into the .dll as well. In other words, I have 40 MB worth of files, and a 40MB dll (this project's only goal is to import these files, there is no substantial code).
How can I prevent this extremely large dll from being made?
Is there an alternative way to get files into the App bundle? I would love to use a custom build command, and although I can copy files into the target directory ${AppDirectory}, but this does not result in these files ending up in the app bundle. Is this approach possible?
Any help is appreciated in advance.
You need to include your files from the main .exe project. You do this by using MonoDevelop's Build Action to Content on each file. They should be copied to the .app without being included inside an .dll (or the .exe).
An alternative (for development) is to use iTunes sharing to copy once your files to your device. This allows you much faster deployment times while developing.
Of course you can't submit such build to the app store (unless the files are not required to make the application work, unlikely). What I do (for my nearly 80MB read-only database) is to use this hack (loading from /Documents) inside #if DEBUG. The release build load the files from the normal location.
I have not automated the process (still debugging the app ;-) but it should be possible to script this so modifying the project options (for each file) is not required when switching from Debug and Release builds.
I'm using a binary framework in my iOS project. This project is only available in english, but I would like to localize it. Assuming the original author used NSLocalizedString everywhere, is it possible to localize this framework "from the outside"?
It should be possible putting the translations in the Localizable.strings file. It should be easy to try...
If it does not work, sometimes libraries include a localizable strings file in a bundle. Then you should put your translations there.
I'm working on a iOS application that will contain around ~6000 mp3 of sounds files.
Each one is around 1 second (2 max) long and rather low quality (24K bitrate) weighting in at around 2-3KB each. (Please do not comment on the quality, it's as it should be)
Since this is a large amount of files I was wondering what we be the best approach for packing these into the bundle? Should I just throw them together in a group? Is there someway of storing them in a single "package" file then reading them out separately as needed?
Also, what would be the best place to place them: Library/ ? Documents/?
As I'm rather new to iOS development and kick in the right direction will be greatly appreciated.
Thanks in advance,
Ken.
You can create a bundle which will contain all your mp3 files. Your files will be in the ressources of your application, no need to store them in the Documents or Library path of your application sandbox.
The way to create and access a bundle is illustrated here.
Hope this helps
There is no package type that were meant for resource files. There are ones for static and dynamic libraries, custom frameworks and so on, but purely for resources I know of none.
Instead of adding them in bulk into a Group in Xcode's project hierarchy, you should add the containing folder as a folder reference to the project. (Appears in the file navigator in blue.) This way any external modifications you make to the contents of the folder, like adding/removing files will automatically be picked up when you next compile your project.
You can do this by dragging the folder from within Finder to the project browser in Xcode and when asked choose "Create folder references for any added folders".