Renaissance—A Cross-Platform Development Tool for Linux and Mac OS X
Listing 7. French.lproj/Localizable.strings
"File" = "Fichier"; "Hide" = "Cacher"; "Hide TiffViewer" = "Cacher TiffViewer"; "Load Image" = "Charger l'image"; "Quit" = "Quitter"; "Quit TiffViewer" = "Quitter TiffViewer";
We use the same file for both GNUstep and Mac OS X. Under GNUstep, modify the GNUmakefile to add instructions so that our translation resource gets installed. The following two lines need to be added to the GNUmakefile: TiffViewer_LOCALIZED_RESOURCE_FILES = ... and TiffViewer_LANGUAGES = ....
Listing 8. GNUmakefile Changes Required to Support Localization
... TiffViewer_RESOURCE_FILES = TiffViewer.gsmarkup \ GNUstep-Menu.gsmarkup TiffViewer_LOCALIZED_RESOURCE_FILES = \ Localizable.strings TiffViewer_LANGUAGES = French ADDITIONAL_GUI_LIBS += -lRenaissance ...
Finally, under GNUstep, recompile the application in order to copy the resource file properly and launch it using its French translation, like this:
# make # openapp TiffViewer.app -NSLanguages '(French)'
On Mac OS X, you also have to create the French.lproj directory and the Localizable.strings file (or reuse the ones created for GNUstep) with the content shown in Listing 5. Once they have been created, follow these steps to activate the French localization in Project Builder:
Select the Resources node and from the Project menu, choose Add Files... and add the French.lproj/Localizable.strings file.
From the Build menu, click on Build.
To run the application in French under Mac OS X, from the System Preferences, click on the International icon. Then, drag Français before English and quit the application. From Project Builder's Debug menu, click on Run Executable. The application should start in French.
The Renaissance framework provides valuable innovations to help develop truly portable applications. Eventually, Renaissance will have a complete graphical editor, allowing you to create gsmarkup files graphically, as you can do now with Gorm, the Graphical Object Relationship Modeler for GNUstep, or with Interface Builder under Mac OS X.
In a future GNUstep article, we will enhance our simple TIFF viewer application to work with the GNUstep Database Library (GDL), an excellent free implementation of the NeXT's Enterprise Objects Framework (EOF).
GNUstep Build Guide for UNIX Systems: documents.made-it.com/GNUstep/Build
Objective-C Programming Language: developer.apple.com/techpubs/macosx/Cocoa/ObjectiveC
“Programming under GNUstep—An Introduction” by Ludovic Marcotte: /article/6418
Source code of the application from the previous article: ftp.linuxjournal.com/pub/lj/listings/issue108/6418.tgz
Ludovic Marcotte (firstname.lastname@example.org) holds a Bachelor's degree in Computer Science from the University of Montréal. He is currently a software architect for Inverse, Inc., a small IT consulting company located in downtown Montréal.
- Is the Private Cloud a Real Cloud?
- Give new life to old phones and tablets with these tips!
- Readers' Choice Awards 2014 Poll
- rsync, Part II
- Tech Tip: Really Simple HTTP Server with Python
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- Memory Ordering in Modern Microprocessors, Part I