OnTheGoSoft
OnTheGoSoft Blog
Tips, news and ideas for using our programs

Shrink Pic localization – behind the scenes

May 5th, 2009

Shrink Pic is a program that automatically resizes photos sent by email or uploaded to the web. it catches file read operations in other programs and replaces large photos with smaller versions. It’s is a C++ program, written using the excellent wxWidgets library.

We’ve recently localized it to Spanish, French, German and Japanese. This article tells the story of how Shrink Pic went multilingual.

1) Placing all strings in a resource file

A resource file is a fancy name for a file which holds some data for the program. In our case, the resource file contains all the texts that appear in Shrink Pic. Before this was done, texts appeared within the code. For example, the program’s title was set with this line of text:

SetTitle(_T("Shrink pic (running)"));

When text is found inside the program’s code, it’s difficult to translate a program. The reason is, changes must be made in many places making the localized program much different than the original one.

The seperate between the code and texts, we used the gettext framework. This makes localization as easy as it can be. Here’s the change in the line that sets the program’s title:

SetTitle(_("Shrink pic (running)"));

Did you notice the difference?

The first call uses _T(text) and the second call uses _(text). The _T() function places a Unicode string in the program. The _() function places a text which goes through gettext.

What gettext does is check if a certain string has translation to another language. If it does, it returns the translation. Otherwise, it returns the original string. So, for example, when Shrink Pic is running in Spanish and we call it with “Shrink pic (running)“, it will return “Shrink pic (activo)“.

From that point on, it’s a smooth ride. All the translation is done outside of the program. We’ll get to it in a minute.

2) Collecting the strings that need translation

So now, our program’s texts all pass through gettext, which provides their translation during run-time (when Shrink Pic executes). The next step is to provide the translations.

Gettext uses files called .po (portable object) and .mo (machine object). The .po files are actually text files that contain strings and their translation. The .mo files contain the same data but are formatted so that programs can read them faster (without parsing).

The process for providing the translation is:

  1. Create a .po (or .pot – portable object template) file with all the program’s strings.
  2. Translate all strings in that file to each language, keeping each language translation in a different .po file.
  3. Convert from .po to .mo (a program does that for us).
  4. Load the .mo files to our program (Shrink Pic) so that it can use the translations when it runs.

Much of the work required for this is done by a free program called poedit. It can scan the program and create the .po file that contains all the texts that appear in it, allows translators to translate the texts and also creates the .mo files (automatically).

Creating the .po file is a breeze with poedit. This is what you need to do (all the explanations here refer to poedit):

New poedit catalog

New poedit catalog

File->New catalog…

You will need to enter some information about your program. Most of it is optional. Do make sure you enter the program’s name and the character encoding as ‘utf-8‘.

Next, click on the Paths tab and enter the path to your program.

Last, click on Catalog->Update from source.

You’re done. The .po file should now contain all the texts in your application.

3) Translating the resource file

Translation Panel in ICanLocalize

Translation Panel in ICanLocalize

If you know translators, just send them the .po file. They’ll translate it using poedit and return the translated file to you. We took a slightly different path for the translation work.

To translate Shrink Pic, we created an account at ICanLocalize. It’s a translation service for small businesses, like us. With that, we managed to do all our translation jobs at one place, without having to deal with the translators or any technical issues (like incorrect character encodings).

Next, we created a Text resource translation project. We indicated that we’re translating from English to Spanish, French, German and Japanese and uploaded our .po file.

When the translation was done, we got an email and downloaded each of the .po files.

4) Oops – we forgot some strings…

When we built the translated Shrink Pic, we noticed that some texts are still in English. We’ve forgotten to change the _t() calls to _() calls in some places (they do look rather similar). No problema! We fixed the code and used poedit once more to recreate the .po files. Then, we uploaded the new version for translation (in the ICanLocalize project). This time, the translators only got the new strings and translated them. The completed translations came back the same day and the fully localized Shrink Pic is now online, available to download.

Shrink Pic with Proper Vista Support

March 18th, 2009

We’ve finally released Shrink Pic with support for Internet Explorer and Outlook.

A nasty bug, caused by Explorer’s privacy mode (which is a pretty good thing by itself) caused Shrink Pic not to kick in.

Another bug, which some of you might have noticed (and many reported) was crashing Outlook. Yes, Shrink Pic sadly crashed Outlook when running on Vista.

Well, all these problems are part of history now. Shrink Pic 1.7 runs perfectly on IE7, IE8, Firefox 2, Firefox 3, Opera, and a host of other programs. It runs the same on Windows XP and Vista, regardless of security settings.

Get it while it’s hot. Visit our download page.

What’s planned next for Shrink Pic?

The next version of Shrink Pic is going to speak more than just English. We’re localizing it to a host of languages. I’ll write about it when it’s ready.

Child ID Cards Working Again

January 6th, 2009
Click to see 2 minute demo

Click image to see 2 minute demo

There was a serious bug in previous versions of Passport Photo which prevented printing child ID cards. Passport Photo 2.1.1 fixes this problem and child ID card printing is working again.

We’d like to thank all of you who sent us bug reports and helped identify the source of the problem. As all bugs go, once you know about it and understand it’s a real problem, you’re 80% through to fixing it!

What are child ID cards?

Here’s a quick reminder of what child ID cards are in Passport Photo:

  • Include a photo of a child and parents (or other adults).
  • Include spaces for names, contact information and comments.
  • Credit card sized to fit into a wallet or badge holder.

How much does it cost?

You don’t need to register Passport Photo in order to print child ID cards without a watermark. Just download and install Passport Photo and you can use it right away (the program might warn you against a watermark, but you can ignore that warning if you’re printing just child ID cards).

Tell us about it

Are you using Passport Photo to print child ID cards? Tell us a bit about it!

Poll Results: Special Passport Printing Equipment Is Unnecessary

December 21st, 2008

Two weeks ago, we asked our clients what printer and paper they’re using for printing passport pictures.

Until now, 17 people responded by leaving comments in the printer and paper survey page. We summarized the results in a table, to make it easier to skim through.

It appears that people are very happy with photo printers by most major brands, including HP, Canon, Epson, Fujifilm, Lexmark and Kodak.

Many of the comments indicate that they get good prints using these printers and different types of glossary and photo paper.

Also interesting to notice is that many of the people use our Passport Photo software  to print passport pictures commercially. They report significant saving by using the software, running on their existing PC along with their photo printer. This combination replaces special purpose Polaroid equipment, which is used just for printing passport photos.

In fact, many stopped using their existing Polaroid printers and switched to regular photo printers to save on daily printing costs.

In light of these results, we’re planning to make Passport Photo the best we can for photo shops who print passport photos commercially. If you’ve got an idea about how to make it even better, let us know about it.

The survey page is going to remain open to comments and we’ll update the summary table frequently. You’re welcome to check out what others are using and leave your own feedback.

Visit the survey ┬╗

Passport Photo 2.1.0 Released

December 12th, 2008

passport_photo_with_textPassport Photo 2.1.0 adds the ability to write text on the photos.

Who needs something like this?

Identity documents, such as driver license in some countries require that names and IDs be printed on the photo. Passport Photo lets you select the position of the text and its color. Text size is calculated automatically to fit the available space.

To use this, just click on the Text Overlay heading in the image editor.

This upgrade is free to all registered users. As always, you can get it by downloading the recent version of Passport Photo from our download page.

* Of course, the text is only added when printing. The original photo is not modified.

Take Shrink Pic With You When Traveling

September 2nd, 2008

Do you like to send home photos when going on vacation?
Shrink Pic 1.6 makes it especially easy!

Shrink Pic 1.6

Shrink Pic now fully supports portable mode. This means, it can run without being installed. Shrink Pic can copy itself to any USB memory, including your digital camera or a memory stick.

Then, you can run it on any PC without installing. After it finishes running, it saves its setting back to the USB memory and leaves no trace behind.

To use this new feature:

  1. Start Shrink Pic.
  2. Connect a Flash drive to the PC (your digital camera is one too).
  3. Click on File->Copy to Flash Drive.

Shrink Pic shortcut

You’re done. Now, when you connect that camera or flash drive to any PC, you’ll find a shortcut for Shrink Pic on it. Double click on the shortcut and Shrink Pic starts, running directly from the flash drive.

Any photos you attach by email or upload (like uploads to your Yahoo! or Google album) will automatically resize. Sending photos will be about 20 times faster than for the full size photos (so you’ll have more time to enjoy your trip and lower Internet Cafe bills).

Shrink Pic is free for any personal or commercial use (provided it’s left intact). Use our download page to get it.

New planned features for Passport Photo

August 9th, 2008

Recently, we received some great feedback from Passport Photo users about features that they would find useful.

Here are some of these ideas:

  • Add support for Canadian Citizenship photos – it turns out that in order to print Canadian Citizenship photos, a 10mm white strip needs to be included under the photo. This is where the details of the person would go.
  • Add support for Chilean driver license photos – this is a bit more complicated. We’ll need to allow users to write text on top of the photo. It would include the driver’s details.

If you have other things in mind, let us know. This is the time!

Just to remind you, Passport Photo is also available in German, French, Spanish, Portuguese, Dutch and Japanese.

Last but not least
If you’re running a blog or newsletter and want to introduce Passport Photo to your readers, we can issue you a few free license codes to give away to your readers. Contact us is you’re interested.

Shrink Pic 1.5 with Vista Mail support

August 1st, 2008

We just released Shrink Pic 1.5, which now also supports Vista Mail. If you’ve been using Shrink Pic on Windows XP and can’t use it after moving to Vista Mail, this upgrade is for you!

Also included in this version is the ability to control JPEG compression quality. This value determines the trade-off between size and image quality. Setting it to 0 would produce very poor images, but also tiny (about 10Kbyte). Setting it to 100 would produce excellent photos, but too large. The default value is 85, yielding good photo quality and small sizes.

You’re more than welcome to download Shrink Pic. It’s completely free.

You probably like getting smaller photos by email, do you? Then, tell the world about Shrink Pic. If you’re running a blog, post an entry about it!

Passport Photo 2.0.0 creates child ID cards in addition to passport pictures

April 17th, 2008

We’ve just released Passport Photo 2.0.0.

This release includes, in addition to printing passport pictures, the ability to print child ID tags.

These tags include your child’s photo, your photos and any information you choose to include. They can be worn by the child when going to public places.

The child ID cards are credit-card sized, making them easy to carry with you, when not in use. They easily fit plastic badge holders that can be attached to kids’ shirts.

This new features comes standard in Passport Photo 2.0.0 at no extra cost. You can print these cards with your own printer, or in a shop – like ordinary photos.

Existing users should upgrade (for free) by downloading the recent version.

Online passport photo validator

March 29th, 2008

Most of the passport photos people take at home are just fine, and they don’t have to be perfect in order to be accepted.

The most common problems we see, with photos that people send us to review have to do with lighting conditions, shadows and reflections. So, we created an online passport photo validator which lets you see how you photo compares with good and bad samples.

It’s completely free and doesn’t require anything, besides the photo you want to check. Give it a try and let us know what you think.

This utility will also be integrated in the upcoming release of Passport Photo (version 1.6.0).