diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-10-25 18:23:36 +0800 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-10-25 18:23:36 +0800 |
commit | 5204507b2f326a76ed203b3fff0e4863cb6b709f (patch) | |
tree | 78952e837b492ca1f5e58fa123ad217a7e0b3b53 | |
parent | ff6c8215a82a56d8163086158a568b7a9aabafde (diff) | |
download | gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar.gz gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar.bz2 gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar.lz gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar.xz gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.tar.zst gsoc2013-evolution-5204507b2f326a76ed203b3fff0e4863cb6b709f.zip |
Fix build on platforms when ngettext is a macro
-rw-r--r-- | filter/e-filter-datespec.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c index 0ec87ad343..db251f317b 100644 --- a/filter/e-filter-datespec.c +++ b/filter/e-filter-datespec.c @@ -62,27 +62,38 @@ typedef struct { gfloat max; } timespan; -#ifdef ngettext -#undef ngettext -#endif +#if 0 + +/* Don't delete this code, since it is needed so that xgettext can extract the translations. + * Please, keep these strings in sync with the strings in the timespans array */ + + ngettext("1 second ago", "%d seconds ago", 1); + ngettext("1 second in the future", "%d seconds in the future", 1); + ngettext("1 minute ago", "%d minutes ago", 1); + ngettext("1 minute in the future", "%d minutes in the future", 1); + ngettext("1 hour ago", "%d hours ago", 1); + ngettext("1 hour in the future", "%d hours in the future", 1); + ngettext("1 day ago", "%d days ago", 1); + ngettext("1 day in the future", "%d days in the future", 1); + ngettext("1 week ago", "%d weeks ago", 1); + ngettext("1 week in the future", "%d weeks in the future", 1) + ngettext("1 month ago", "%d months ago", 1); + ngettext("1 month in the future", "%d months in the future", 1); + ngettext("1 year ago", "%d years ago", 1); + ngettext("1 year in the future", "%d years in the future", 1); -/* This is a nasty hack trying to keep both ngettext function and xgettext tool happy */ -/* It *will* cause problems if ngettext is a macro */ -#define ngettext(a, b) a, b +#endif static const timespan timespans[] = { - { 1, ngettext("1 second ago", "%d seconds ago"), ngettext("1 second in the future", "%d seconds in the future"), 59.0 }, - { 60, ngettext("1 minute ago", "%d minutes ago"), ngettext("1 minute in the future", "%d minutes in the future"), 59.0 }, - { 3600, ngettext("1 hour ago", "%d hours ago"), ngettext("1 hour in the future", "%d hours in the future"), 23.0 }, - { 86400, ngettext("1 day ago", "%d days ago"), ngettext("1 day in the future", "%d days in the future"), 31.0 }, - { 604800, ngettext("1 week ago", "%d weeks ago"), ngettext("1 week in the future", "%d weeks in the future"), 52.0 }, - { 2419200, ngettext("1 month ago", "%d months ago"), ngettext("1 month in the future", "%d months in the future"), 12.0 }, - { 31557600, ngettext("1 year ago", "%d years ago"), ngettext("1 year in the future", "%d years in the future"), 1000.0 }, + { 1, "1 second ago", "%d seconds ago", "1 second in the future", "%d seconds in the future", 59.0 }, + { 60, "1 minute ago", "%d minutes ago", "1 minute in the future", "%d minutes in the future", 59.0 }, + { 3600, "1 hour ago", "%d hours ago", "1 hour in the future", "%d hours in the future", 23.0 }, + { 86400, "1 day ago", "%d days ago", "1 day in the future", "%d days in the future", 31.0 }, + { 604800, "1 week ago", "%d weeks ago", "1 week in the future", "%d weeks in the future", 52.0 }, + { 2419200, "1 month ago", "%d months ago", "1 month in the future", "%d months in the future", 12.0 }, + { 31557600, "1 year ago", "%d years ago", "1 year in the future", "%d years in the future", 1000.0 }, }; -/* now we let the compiler see the real function call */ -#undef ngettext - #define DAY_INDEX 3 struct _EFilterDatespecPrivate { |