Mac App Development: How to select app language while installing? - c++

I am currently developing a Mac app using C++.
In this app, we have provided language selections for users.
But for some resource files, users can change it while using the app. So I want the the language version of the resource files to be chosen during installation and can not be changed after installation.
I have tried to package the app as a .pkg file using packagemaker and iceberg, but I can not find a way to provide a dialog to let users choose language.
For example, when I use iceberg to package a Mac App, it provides those options:
Settings/Documents/Scripts/plugins/Files
I can not find any way to give a language selection for end users.
So, my question is, how can I implement this requirement?

As a rule, this just is not done. On the Mac, and within iOS, there is a nearly thirty-year history of supporting a single binary with multiple user interface languages. The reason that there are few, if any, tools that support installation of just one is that it is considered to be against e way the platform is supposed to work.
Consider, just as an example, a computer in a lab in Quebec where it is not uncommon to have a mix if students speaking English and French. In is case, lab computers installed with just French would be useful only to users who speak Frennche, as changing the language to English for a new user (at login for example) would result in your application continuing to run in French.
With few exceptions, Applications should contain all languages available and gracefully handle language changes during use (often waiting until they are restarted to change the interface language, but your tactic may very).

Related

Link C++ library to html front end

I do computational research with a C++/CUDA library that does intensive number crunching. Recently I was thinking to set up a little showcase of my library on my webpage where people could work interactively with the library and see the results (plots, animations, etc.) in real time.
I have very limited html and website creating expertise. Are there libraries out there to link the html front-end to the C++/CUDA back-end? I'm developing in Linux environment but obviously I'd like my webpage to be accessed by anyone independent of their OS and/or browser.
So after a little bit of research I found the Wt library which is written in C++ and used for webpage development. Based on the information on their homepage, it seems to be exactly what I'm looking for:
Typical use scenarios:
High performance, complex web applications which are fully personalized (and thus cannot benefit from caching), fully Ajax enabled and at the same time entirely accessible and Search Engine Optimized.
Web-based GUIs for embedded systems benefit from the low footprint of a C++ web application server.
Web-based GUIs that require integration with (existing) C++ libraries, for example for scientific or engineering applications, or existing C++ desktop applications
I did something like this. To do this, I used a simple library I wrote called jrb_node at https://github.com/kennethho/jrb_node
There are other libraries like cppnetlib http://cpp-netlib.org/
Basically you make a small http server that based on the request will perform some computation and return the results as an http response. You can then combine that with javascript and Ajax if you want to make it more interactive.
An alternative to consider is to use WebCL. CUDA is pretty similar to OpenCL and it should be pretty easy to convert your code to the latter. If you have other C++ code, that might be a bit of problem though.
Do you want to run CUDA on server (e.g. the users will input the parameters, push a button and your server will do number crunching) or on client (e.g. it will be user GPU that does computations)?
For server-side you should be able to use pretty much any server technology - PHP, JSP, etc. They all provide a way to integrate to "native code".
For client-side you will not be able to do with just HTML - you need to use some "fat client" technology - e.g. ActiveX, Java applet. I do not know if Silverlight or Flash have access to native code. IMHO, you might as well just write a Qt application and put a download link on your site.

How can I keep my cross-platform GUI application up to date?

I'm writing a GUI application in C++ using wxWidgets. As I develop this, I would like to roll out updates to my customers in a reasonably light-weight and customer-friendly way.
My first thoughts were the traditional: go check a URL for a version number and if it's different from the current one, tell the user there's a new version to download (maybe present them with a download link).
Is there a more intelligent/customer-friendly way to do this?
See http://winsparkle.org/ (it's Windows-only but for Mac you have the original Sparkle and under Linux you usually rely on the packaging system for the updates instead of doing it yourself).
I found a potential cross-platform solution:
WebUpdate is a complete, open source, cross-platform update solution for any type of application. It provides an easily-integrable, small application which connects to a web server and shows the updated packages to the user (supports multiple packages) and let him download and install them.
Reliable downloads are granted using MD5 checksums. Local updates (for example, updates to be taken from a CD-ROM or any other device) are supported, too. The program is highly configurable using XML and XRC files. For a complete list of the features of WebUpdate, look at the WebUpdate documentation.

Generic tool for checking software prerequisites

Do you know any generic tool that can be used to check custom software-hardware prerequisites on a local machine? I mean, I'd like to have a tool which I can easily configure to check if the machine has, say .NET version this and this, and if SQL server 2005 is installed, and if IIS 6 or later is installed etc. then send it to somebody and he would start the tool and immediately know if a machine meets all defined conditions.
I imagine endless plugin possibilities for such tool: checking for python, java, ruby, php, all components, app servers, database servers, etc. It could do basic checks (e.g. only find if say Python 2.5 is installed) or more advanced (if installed - check if it's configured in this and this way). It could then check for hardware prerequisites like CPU, memory, hard drives, etc.
I'm saying 'tool' but this could be some low-level C or C++ library with documented methods. It would be possible to build higher-level tools around it, use it in the installation wizards etc etc. Is there anything like this out there? Would be nice and saved a lot of effort sometimes.
I'm not quite sure it is what you need, but you might want to take a look at NSIS (it's an installer framework).
There is a number of plugins and scripts already written for it that check for such prerequisites, and even offer a way to install those with your application.

How to go about a platform independent E-Book Reader in C/C++?

I'm trying to develop an ebook reader(for mobile devices) which is platform independent. Currently my focus is epub only.
As a proof of concept, we were able to make a basic epub reader for android platform, using the functionalities provided by the platform itself(using webview, Xml Parser, Unzipper etc). But now we want to make it platform independent and we want to do it in C/C++. I know we have unzippers and xml parsers in C/C++, its the rendering part I'm worried about. My questions are...
1.How can I do the rendering, without using any of the inbuilt android views, so that it will work on other platforms also?
2.Is it better to stick to webkit for epub(the platforms which we're considering all have webkit)?
As of now I'm clueless. Any pointers on where to start?
BR,
Rajeev
Most likely you will have to split your application into the cross-platform backend and a platform specific front-end.
If you want to implement indexing and searching of all e-pubs in your app, this could be part of the cross-platform part. If the epub reader contains a catalogue of downloaded/transferred epubs, the database including its access methods could probably be cross-platform as well (at least partially).
However, the presentation layer, i.e., the user interface, will probably have to be platform-specific. The best case scenario is that you can come up with an intermediate UI description language that can be automatically translated into Android / iPhone user interfaces. That is a daunting task however, and it's probably not even worth trying if you don't want to create many cross-platform apps.
The only C/C++ development environment i found was MoSync.

Choosing Cross-Platform GUI Toolkit for Desktop App With WebServices

For a current project, we're designing a client desktop application that parses text files and interfaces with a web based database.
So far we've split the project into parts:
(Third-Party Program) -> (Our Desktop Client) -> (Our Parsing Library #1 and #2) -> (Our Web Server) -> (Our Verification Library) -> (Our Database)
We've hit confusion when it comes to choosing the correct way (and the best language) to make these pieces work together.
The third-party program's output is a simple text file, and we're just parsing it into a SQL-esque format for insertion into our database after verifying the numbers are in a certain range.
The first question we have is regarding the client language itself. We're planning on writing the parser libraries in C++ as they're just mostly text management. Our desktop client needs to be cross-platform for Windows and Mac. Currently we're leaning towards writing this in Java using Swing and the JNI. However, we realize there's a lot of hate for Java and that we'd have to worry about bundling in the JRE.
Is Java a good choice in this situation? Our other options seem to be writing this also in C++ using something like Qt for the GUI, or going platform specific and writing the windows version in .NET and then a Mac specific version. Our Windows community is the vast majority of users.
Our second issue is connecting this client with our web server. Originally we were just going to use an http POST to upload the file. We could also FTP the file which seems like overkill. We started to explore web services but were not sure if a web service could handle large amounts of text data.
Is there an easier way to do this? Everything is text, so it's no problem to send them in chunks or one giant string. If we go the web services route, will that effect our language choice for the desktop client?
There are definitely hundreds of ways to handle something like this, but most of these concepts are new for us. Any suggestions would be greatly appreciated.
Qt is an excellent choice and as it's native C++ it will be easy to integrate with your parsers too. Why write two versions when a single Qt version will run fine on both platforms with native look and feel? Depending on the license you choose you can even statically link Qt if you're concerned about deployment complexity.
A web service would generally have no problem handling large amounts of text and pretty much any language will interact with it easily assuming basic network I/O functionality. Depending on the language you will probably be able to find libraries that do most of the work for you, assuming it's not already supported natively.
As you say, there are many different ways to do what you want to achieve. There is no right or wrong way but obviously some designs will suit your needs better than others.