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 (email@example.com) 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.
|Non-Linux FOSS: Screenshotting for Fun and Profit!||Oct 20, 2016|
|Nasdaq Selects Drupal 8||Oct 19, 2016|
|Canonical Ltd.'s Ubuntu Core||Oct 19, 2016|
|Build Your Own Raspberry Pi Camera||Oct 18, 2016|
|Netlist, Inc.'s HybriDIMM Storage Class Memory||Oct 17, 2016|
|Secure Desktops with Qubes: Compartmentalization||Oct 13, 2016|
- Non-Linux FOSS: Screenshotting for Fun and Profit!
- Build Your Own Raspberry Pi Camera
- Nasdaq Selects Drupal 8
- Canonical Ltd.'s Ubuntu Core
- Secure Desktops with Qubes: Compartmentalization
- Linux Journal October 2016
- Netlist, Inc.'s HybriDIMM Storage Class Memory
- Polishing the wegrep Wrapper Script
- A New Mental Model for Computers and Networks
- The Peculiar Case of Email in the Cloud