From: Jaakko Heinonen Date: Fri, 23 Sep 2005 15:42:11 +0000 (+0000) Subject: - merge localized boolean question patch (Cedric Duval) X-Git-Tag: upstream/0.6.1~2^2~162 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=a07d2a804360c52a8630ae22d7a123de13bc0d91;p=pkg%2Fabook.git - merge localized boolean question patch (Cedric Duval) - po update - prepare to fix ui_readline limit functionality --- diff --git a/Makefile.am b/Makefile.am index ca5490d..7e9df13 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = abook abook_SOURCES = abook.c database.c filter.c list.c misc.c \ options.c edit.c ldif.c ui.c getname.c \ - getopt.c getopt1.c abook_rl.c mbswidth.c \ + getopt.c getopt1.c gettext.c abook_rl.c mbswidth.c \ xmalloc.c \ abook.h database.h filter.h list.h misc.h help.h \ options.h edit.h ldif.h abook_curses.h ui.h getname.h \ diff --git a/Makefile.in b/Makefile.in index a14d218..e6f15ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,8 +76,8 @@ PROGRAMS = $(bin_PROGRAMS) am_abook_OBJECTS = abook.$(OBJEXT) database.$(OBJEXT) filter.$(OBJEXT) \ list.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) edit.$(OBJEXT) \ ldif.$(OBJEXT) ui.$(OBJEXT) getname.$(OBJEXT) getopt.$(OBJEXT) \ - getopt1.$(OBJEXT) abook_rl.$(OBJEXT) mbswidth.$(OBJEXT) \ - xmalloc.$(OBJEXT) + getopt1.$(OBJEXT) gettext.$(OBJEXT) abook_rl.$(OBJEXT) \ + mbswidth.$(OBJEXT) xmalloc.$(OBJEXT) abook_OBJECTS = $(am_abook_OBJECTS) abook_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. @@ -223,7 +223,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ abook_SOURCES = abook.c database.c filter.c list.c misc.c \ options.c edit.c ldif.c ui.c getname.c \ - getopt.c getopt1.c abook_rl.c mbswidth.c \ + getopt.c getopt1.c gettext.c abook_rl.c mbswidth.c \ xmalloc.c \ abook.h database.h filter.h list.h misc.h help.h \ options.h edit.h ldif.h abook_curses.h ui.h getname.h \ @@ -335,6 +335,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbswidth.Po@am__quote@ diff --git a/abook_rl.c b/abook_rl.c index 704d293..55b3039 100644 --- a/abook_rl.c +++ b/abook_rl.c @@ -166,7 +166,7 @@ abook_rl_init(bool use_completion) } char * -abook_readline(WINDOW *w, int y, int x, char *s, int limit, bool use_completion) +abook_readline(WINDOW *w, int y, int x, char *s, bool use_completion) { char *ret; diff --git a/abook_rl.h b/abook_rl.h index 22b67ba..49d59da 100644 --- a/abook_rl.h +++ b/abook_rl.h @@ -3,7 +3,7 @@ #include "abook_curses.h" -char *abook_readline(WINDOW *w, int y, int x, char *s, int limit, +char *abook_readline(WINDOW *w, int y, int x, char *s, bool use_completion); #endif diff --git a/gettext.h b/gettext.h index e548a8f..332a7f6 100644 --- a/gettext.h +++ b/gettext.h @@ -3,15 +3,18 @@ # if ENABLE_NLS # include +char *sgettext(const char *msgid); /* Strip context prefix */ # else # define gettext(Msgid) ((const char *) (Msgid)) +# define sgettext(Msgid) ((const char *) (Msgid)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) -# endif +# endif /* ENABLE_NLS */ # define _(String) gettext (String) # define gettext_noop(String) String # define N_(String) gettext_noop (String) +# define S_(String) sgettext (String) -#endif +#endif /* _GETTEXT_H */ diff --git a/po/LINGUAS b/po/LINGUAS index 8a3cb7f..dd08588 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,2 +1,2 @@ # Set of available languages -fr sv fi +fr sv diff --git a/po/Makevars b/po/Makevars index 5c45023..b1e0b76 100644 --- a/po/Makevars +++ b/po/Makevars @@ -8,7 +8,7 @@ subdir = po top_builddir = .. # These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=S_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding diff --git a/po/abook.pot b/po/abook.pot index 562373b..ccb7c97 100644 --- a/po/abook.pot +++ b/po/abook.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-09-21 19:53+0300\n" +"POT-Creation-Date: 2005-09-23 18:38+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -633,46 +633,62 @@ msgstr "" msgid "Terminal is too small. Minium terminal size for abook is %dx%d\n" msgstr "" -#: ui.c:336 +#: ui.c:256 +msgid " (Y/n)?" +msgstr "" + +#: ui.c:256 +msgid " (y/N)?" +msgstr "" + +#: ui.c:265 +msgid "keybinding for no|n" +msgstr "" + +#: ui.c:267 +msgid "keybinding for yes|y" +msgstr "" + +#: ui.c:334 msgid "help" msgstr "" -#: ui.c:345 +#: ui.c:343 msgid "Press any key to continue..." msgstr "" -#: ui.c:466 +#: ui.c:464 msgid "Remove selected item(s)" msgstr "" -#: ui.c:476 +#: ui.c:474 msgid "Clear WHOLE database" msgstr "" -#: ui.c:503 +#: ui.c:502 msgid "Search hit bottom, continuing at top" msgstr "" -#: ui.c:526 +#: ui.c:525 msgid "Your current data will be lost - Press 'y' to continue" msgstr "" -#: ui.c:545 +#: ui.c:544 msgid "Print All/Selected/Cancel (a/s/C)?" msgstr "" -#: ui.c:553 +#: ui.c:552 msgid "No selected items" msgstr "" -#: ui.c:579 +#: ui.c:578 msgid "File to open: " msgstr "" -#: ui.c:589 +#: ui.c:588 msgid "Save current database" msgstr "" -#: ui.c:597 +#: ui.c:596 msgid "Sorry, that specified file appears not to be a valid abook addressbook" msgstr "" diff --git a/po/fr.gmo b/po/fr.gmo index a7cbd58..4fda268 100644 Binary files a/po/fr.gmo and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po index be2522c..9c4a6f2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: abook\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-09-21 19:53+0300\n" +"POT-Creation-Date: 2005-09-23 18:38+0300\n" "PO-Revision-Date: 2005-09-14 22:48+0200\n" "Last-Translator: YOUR NAME \n" "Language-Team: french\n" @@ -661,47 +661,63 @@ msgstr "La taille de votre terminal est de %dx%d\n" msgid "Terminal is too small. Minium terminal size for abook is %dx%d\n" msgstr "Terminal trop petit. Taille minimale de terminal pour abook: %dx%d\n" -#: ui.c:336 +#: ui.c:256 +msgid " (Y/n)?" +msgstr "" + +#: ui.c:256 +msgid " (y/N)?" +msgstr "" + +#: ui.c:265 +msgid "keybinding for no|n" +msgstr "" + +#: ui.c:267 +msgid "keybinding for yes|y" +msgstr "" + +#: ui.c:334 msgid "help" msgstr "aide" -#: ui.c:345 +#: ui.c:343 msgid "Press any key to continue..." msgstr "Pressez n'importe quelle touche pour continuer..." -#: ui.c:466 +#: ui.c:464 msgid "Remove selected item(s)" msgstr "supprimer les entrées sélectionnées" -#: ui.c:476 +#: ui.c:474 msgid "Clear WHOLE database" msgstr "effacer entièrement la base de données" -#: ui.c:503 +#: ui.c:502 msgid "Search hit bottom, continuing at top" msgstr "La recherche a atteint la fin, poursuite au début" -#: ui.c:526 +#: ui.c:525 msgid "Your current data will be lost - Press 'y' to continue" msgstr "Vos donnée actuelles seront perdues - Pressez 'y' pour continuer" -#: ui.c:545 +#: ui.c:544 msgid "Print All/Selected/Cancel (a/s/C)?" msgstr "Afficher tout/sélectionné/annuler (a/s/C)?" -#: ui.c:553 +#: ui.c:552 msgid "No selected items" msgstr "Pas d'entrée sélectionnée" -#: ui.c:579 +#: ui.c:578 msgid "File to open: " msgstr "Fichier à ouvrir: " -#: ui.c:589 +#: ui.c:588 msgid "Save current database" msgstr "Sauvegarder la base de donnée" -#: ui.c:597 +#: ui.c:596 msgid "Sorry, that specified file appears not to be a valid abook addressbook" msgstr "" "Désolé, le fichier spécifier ne semble pas être un carnet d'adresses abook " diff --git a/po/sv.gmo b/po/sv.gmo index 98d79e7..6b60d46 100644 Binary files a/po/sv.gmo and b/po/sv.gmo differ diff --git a/po/sv.po b/po/sv.po index 93b2040..0d41a54 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: abook 0.5.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-09-21 19:53+0300\n" +"POT-Creation-Date: 2005-09-23 18:38+0300\n" "PO-Revision-Date: 2005-09-14 23:12+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -658,47 +658,63 @@ msgstr "" "Terminalfönstret är alltför litet. Den minsta tillåtna storleken för abook " "är %dx%d\n" -#: ui.c:336 +#: ui.c:256 +msgid " (Y/n)?" +msgstr "" + +#: ui.c:256 +msgid " (y/N)?" +msgstr "" + +#: ui.c:265 +msgid "keybinding for no|n" +msgstr "" + +#: ui.c:267 +msgid "keybinding for yes|y" +msgstr "" + +#: ui.c:334 msgid "help" msgstr "hjälp" -#: ui.c:345 +#: ui.c:343 msgid "Press any key to continue..." msgstr "Tryck på en tangent för att fortsätta..." -#: ui.c:466 +#: ui.c:464 msgid "Remove selected item(s)" msgstr "Ta bort valda post(er)" -#: ui.c:476 +#: ui.c:474 msgid "Clear WHOLE database" msgstr "Nollställ HELA databasen" -#: ui.c:503 +#: ui.c:502 msgid "Search hit bottom, continuing at top" msgstr "Sök nådde slutet, fortsätter från början" -#: ui.c:526 +#: ui.c:525 msgid "Your current data will be lost - Press 'y' to continue" msgstr "Nuvarande data kommer att förloras - Tryck på 'y' för att fortsätta" -#: ui.c:545 +#: ui.c:544 msgid "Print All/Selected/Cancel (a/s/C)?" msgstr "Skriv ut Alla/Valda/Avbryt (a/s/C)?" -#: ui.c:553 +#: ui.c:552 msgid "No selected items" msgstr "Inga poster valda" -#: ui.c:579 +#: ui.c:578 msgid "File to open: " msgstr "Öppna fil: " -#: ui.c:589 +#: ui.c:588 msgid "Save current database" msgstr "Spara denna databas" -#: ui.c:597 +#: ui.c:596 msgid "Sorry, that specified file appears not to be a valid abook addressbook" msgstr "" "Förlåt, men den angivna filen verkar inte vara en giltig abook-adressbok" diff --git a/ui.c b/ui.c index daf1ae6..874812d 100644 --- a/ui.c +++ b/ui.c @@ -232,7 +232,7 @@ statusline_addstr(const char *str) } char * -ui_readline(char *prompt, char *s, int limit, bool use_completion) +ui_readline(char *prompt, char *s, size_t limit, bool use_completion) { int y, x; char *ret; @@ -253,23 +253,21 @@ int statusline_ask_boolean(char *msg, int def) { int ret; - char *msg2 = strconcat(msg, def ? " (Y/n)?" : " (y/N)?", NULL); + char *msg2 = strconcat(msg, def ? _(" (Y/n)?") : _(" (y/N)?"), NULL); + char ch; statusline_addstr(msg2); free(msg2); - switch(tolower(getch())) { - case 'n': - ret = FALSE; - break; - case 'y': - ret = TRUE; - break; - default: - ret = def; - break; - } + ch = tolower(getch()); + + if(ch == *(S_("keybinding for no|n"))) + ret = FALSE; + else if(ch == *(S_("keybinding for yes|y"))) + ret = TRUE; + else + ret = def; clear_statusline(); diff --git a/ui.h b/ui.h index ba6518f..db85b59 100644 --- a/ui.h +++ b/ui.h @@ -20,7 +20,7 @@ int statusline_ask_boolean(char *msg, int def); void clear_statusline(); void display_help(int help); void statusline_addstr(const char *str); -char * ui_readline(char *prompt, char *s, int limit, bool use_completion); +char * ui_readline(char *prompt, char *s, size_t limit, bool use_completion); void refresh_statusline(); void get_commands(); void ui_remove_items();