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.
|A Project to Guarantee Better Security for Open-Source Projects||Aug 27, 2015|
|Concerning Containers' Connections: on Docker Networking||Aug 26, 2015|
|My Network Go-Bag||Aug 24, 2015|
|Doing Astronomy with Python||Aug 19, 2015|
|Build a “Virtual SuperComputer” with Process Virtualization||Aug 18, 2015|
|Firefox Security Exploit Targets Linux Users and Web Developers||Aug 17, 2015|
- A Project to Guarantee Better Security for Open-Source Projects
- Concerning Containers' Connections: on Docker Networking
- My Network Go-Bag
- Problems with Ubuntu's Software Center and How Canonical Plans to Fix Them
- Doing Astronomy with Python
- Firefox Security Exploit Targets Linux Users and Web Developers
- Build a “Virtual SuperComputer” with Process Virtualization
- diff -u: What's New in Kernel Development
- Three More Lessons
- August 2015 Issue of Linux Journal: Programming