Created attachment 2057 [details]
Introduced 'localization.h' files across R-devel
I would like to propose changes to R-devel on the subject of including localization macros (e.g. '_()' and 'ngettext()').
In the attachment you'll find changes to R's code which results in:
1. Moving 'ifdef NLS ...' from Defn.h file to new one called 'Localization.h'
2. Introducing 'localization.h' files for each R-core package.
3. For core packages, adding "localization.h" header in these *.c files where it is necessary (i.e. messages are translatable).
4. For the rest of the code, adding <Localization.h> in these *.c files where it is necessary.
5. Changing 'translations.R' file since I've introduced 'n_()' as a short name for 'dngettext(domain, S, P)'
By applying this diff file:
1. There will be one definition of '_()' (or 'n_()' aka dngettext) per each package, and one definition for the rest of the code. It'll be easier to change them if needed.
2. You'll get consistent macros: _() for dgettext, and n_() for dngettext.
3. There will be no use for "NO_NLS" or "undef _" since if somebody wants to localize messages he/she only has to include "localization.h" (or <Localization.h>)
I succesfully compiled R-devel with these changes both on Ubuntu and Windows 7 (both x86_64). I ran check-devel tests on both platforms and all was ok. I check with my own eyes that messages that were previously translated are still translated.