Add localization support to "Jamfile-engine" CLI developer helpers.
completed by: Peter Poláčik
mentors: Siarhei Zharski, Ryan Leavengood
The 'Jamfile-engine' helpers propose an easy way to create simple project for new Haiku applications, add-ons and libraries. It include two files you can found in /boot/develop/etc directory. The "Jamfile-engine" one is a working horse, performing most of functionality. The second file is the template for projects Jamfile, that should be copied in the local project directory and customized.
Your task is:
- Install Haiku in Virtual Machine or on real hardware;
- Create simple "Hello, World!" project using any sample available in the internet and Jamfile template from /boot/develop/etc/makefile;
- Adjust the local copy of Jamfile and force the program compile and work. In case of problems - ask your mentor for help;
- Add the localization into your sample by changing your program in the following manner:
#include <Catalog.h>
....
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "HelloWorld"
...
// replace the string literal with B_TRANSLATE()-ed one
B_TRANSLATE("Hello, World!")
and compile it; - Investigate the implementation of locilization support in the makefile-engine that is the "brother" project in the same directory. Take attention on realization of targets "catkeys", "catalogs", "catalogsinstall", "bindcatalogs" and implement the same functionality in the Jamfile-engine;
- Provide the modified Jamfile-engine with localization implementation as result of completing the task.
Implementation Notes:
- Application MIME signature should be defined in the Jamfile as variable APP_MIME_SIG;
- List of supported locales should be defined in the Jamfile as variable LOCALES;
- target "catkeys" should collect all localized strings from the project sources, create sub-directory "locales" and put collection results in "locales/en.catkeys" file;
- target "catalogs" should create catalogs for every language in the LOCALES list;
- target "catalogsinstall" should copy generated "xx.catalogs" files into the following directory: ~/config/data/locale/catalogs/$(APP_MIME_SIG);
- target "bindcatalogs" should link catalogs to main application module resources;
- target dependencies should be adjusted in usual way - so issueing for example "bindcatalogs" on clean sources should invoke all dependent targets and make a ready application with linked localization resources in it.
Skills:
- Basic knowledge of makefiles, command-line building and Perforce Jam syntax is looking like requred for this task;
Links:
- http://www.perforce.com/documentation/jam - documentation for Jam build tool;
- https://www.haiku-os.org/guides/building/jam - Haiku page about using Jam;
Good luck!