diff options
author | nalin <nalin> | 2001-08-03 21:40:10 +0000 |
---|---|---|
committer | nalin <nalin> | 2001-08-03 21:40:10 +0000 |
commit | eb2df6b3526650313865e1c2138ebaff9477ddd0 (patch) | |
tree | b3d909ed933235058380b42ac04df29dfd02e230 | |
parent | dd727748a4614723aec9b4ada1e8a4e7e9bcdeac (diff) | |
download | pomatic-eb2df6b3526650313865e1c2138ebaff9477ddd0.tar.gz pomatic-eb2df6b3526650313865e1c2138ebaff9477ddd0.tar.xz pomatic-eb2df6b3526650313865e1c2138ebaff9477ddd0.zip |
update for newer gettextpomatic-1-0-1
-rw-r--r-- | pomatic.spec | 5 | ||||
-rw-r--r-- | pomatic.x | 33 |
2 files changed, 34 insertions, 4 deletions
diff --git a/pomatic.spec b/pomatic.spec index 1817da0..9a72e95 100644 --- a/pomatic.spec +++ b/pomatic.spec @@ -1,5 +1,5 @@ Name: pomatic -Version: 1.0 +Version: 1.0.1 Release: 1 Source: %{name}-%{version}.tar.gz Summary: pomatic @@ -30,5 +30,8 @@ rm -fr $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Fri Aug 3 2001 Nalin Dahyabhai <nalin@redhat.com> +- fixup empty-string translation to include actual header information + * Mon Apr 2 2001 Nalin Dahyabhai <nalin@redhat.com> - initial CVS checkin @@ -1,11 +1,15 @@ %{ -#include <stdio.h> -#include <unistd.h> +#include <sys/time.h> +#include <sys/wait.h> #include <errno.h> +#include <pwd.h> +#include <stdio.h> #include <string.h> +#include <time.h> +#include <unistd.h> -char message[32768]; +char message[65536]; enum {id, str} string = id, mode = id; char *msgid = NULL, *msgstr = NULL; char *filter = "cat"; @@ -17,12 +21,35 @@ char *filter = "cat"; [ \t]+ {}; ^#.* {}; ^msgid { + struct passwd *pwd; + time_t now; + struct tm tm; if(string == str) { if(msgid) { printf("msgid %s", msgid); } else { printf("msgid \"\"\n"); } + if(strcmp(msgid, "\"\"\n") == 0) { + pwd = getpwuid(getuid()); + now = time(NULL); + tm = *(gmtime(&now)); + if(pwd) { + if(strchr(pwd->pw_gecos, ',')) { + char *p = strchr(pwd->pw_gecos, ','); + *p = '\0'; + } + } + printf("msgstr \"\"\n"); + printf("\"Project-Id-Version: PACKAGE\\n\"\n"); + printf("\"POT-Creation-Date: %04d-%02d-%02d %02d:%02d-0000\\n\"\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min); + printf("\"PO-Revision-Date: %04d-%02d-%02d %02d:%02d-0000\\n\"\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min); + printf("\"Last-Translator: %s\\n\"\n", pwd ? pwd->pw_gecos : "the unknown translator"); + printf("\"Language-Team: en_US.%s\\n\"\n", filter); + printf("\"MIME-Version: 1.0\\n\"\n"); + printf("\"Content-Type: text/plain; charset=ISO-8859-1\\n\"\n"); + printf("\"Content-Transfer-Encoding: 8bit\\n\"\n\n"); + } else if ( ((mode == id) && msgid) || ((mode == str) && msgstr) ) { int i, ipipe[2], opipe[2]; pid_t childpid; |