diff --git a/po/en_AU.po b/po/en_AU.po index 379cffd..af72255 100644 --- a/po/en_AU.po +++ b/po/en_AU.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: trader 7.3\n" "Report-Msgid-Bugs-To: J.Zaitseff@zap.org.au\n" -"POT-Creation-Date: 2011-08-30 09:08+1000\n" -"PO-Revision-Date: 2011-08-30 08:26+1000\n" +"POT-Creation-Date: 2011-08-30 12:38+1000\n" +"PO-Revision-Date: 2011-08-30 12:42+1000\n" "Last-Translator: John Zaitseff \n" "Language-Team: English (Australian)\n" "Language: en_AU\n" @@ -1409,7 +1409,7 @@ msgstr "Page %d of %d" #. TRANSLATORS: The reason the user is not asked "Press any #. key to continue" is historical: many, many people used to #. ask "where is the key?" :-) -#: src/help.c:473 src/intf.c:3025 +#: src/help.c:473 src/intf.c:3035 msgid "[ Press to continue ] " msgstr "[ Press to continue ] " @@ -1451,7 +1451,17 @@ msgstr "mkchstr_conv: NUL" msgid "mkchstr: `%s'" msgstr "mkchstr: ‘%s’" -#: src/intf.c:2025 src/intf.c:2070 +#. TRANSLATORS: This string specifies the keycodes used to insert the +#. default value into the input string, if entered as the very first +#. character. Ideally, it should contain an easily-accessible +#. keycode that would NOT be used in ordinary input. Digits, ".", +#. ",", "+" and "-" are definitely NOT acceptable. +#: src/intf.c:2020 +msgctxt "input|DefaultValue" +msgid "=;" +msgstr "=;" + +#: src/intf.c:2034 src/intf.c:2079 #, c-format msgid "gettxline: illegal character in string: `%ls'" msgstr "gettxline: illegal character in string: ‘%ls’" @@ -1460,12 +1470,12 @@ msgstr "gettxline: illegal character in string: ‘%ls’" #. "input|No" contain the keycodes used to determine whether a #. user is answering "Yes" or "No" in response to some question. #. Both upper and lower-case versions should be present. -#: src/intf.c:2942 +#: src/intf.c:2952 msgctxt "input|Yes" msgid "Yy" msgstr "Yy" -#: src/intf.c:2944 +#: src/intf.c:2954 msgctxt "input|No" msgid "Nn" msgstr "Nn" @@ -1473,12 +1483,12 @@ msgstr "Nn" #. TRANSLATORS: The strings "Yes" and "No" are printed as a #. response to user input in answer to questions like "Are you #. sure? [Y/N] " -#: src/intf.c:2995 +#: src/intf.c:3005 msgctxt "answer" msgid "Yes" msgstr "Yes" -#: src/intf.c:2997 +#: src/intf.c:3007 msgctxt "answer" msgid "No" msgstr "No" diff --git a/po/en_CA.po b/po/en_CA.po index a14c344..a70d8d8 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: trader 7.3\n" "Report-Msgid-Bugs-To: J.Zaitseff@zap.org.au\n" -"POT-Creation-Date: 2011-08-30 09:08+1000\n" -"PO-Revision-Date: 2011-08-30 08:26+1000\n" +"POT-Creation-Date: 2011-08-30 12:38+1000\n" +"PO-Revision-Date: 2011-08-30 12:43+1000\n" "Last-Translator: John Zaitseff \n" "Language-Team: English (Canadian)\n" "Language: en_CA\n" @@ -1409,7 +1409,7 @@ msgstr "Page %d of %d" #. TRANSLATORS: The reason the user is not asked "Press any #. key to continue" is historical: many, many people used to #. ask "where is the key?" :-) -#: src/help.c:473 src/intf.c:3025 +#: src/help.c:473 src/intf.c:3035 msgid "[ Press to continue ] " msgstr "[ Press to continue ] " @@ -1451,7 +1451,17 @@ msgstr "mkchstr_conv: NUL" msgid "mkchstr: `%s'" msgstr "mkchstr: ‘%s’" -#: src/intf.c:2025 src/intf.c:2070 +#. TRANSLATORS: This string specifies the keycodes used to insert the +#. default value into the input string, if entered as the very first +#. character. Ideally, it should contain an easily-accessible +#. keycode that would NOT be used in ordinary input. Digits, ".", +#. ",", "+" and "-" are definitely NOT acceptable. +#: src/intf.c:2020 +msgctxt "input|DefaultValue" +msgid "=;" +msgstr "=;" + +#: src/intf.c:2034 src/intf.c:2079 #, c-format msgid "gettxline: illegal character in string: `%ls'" msgstr "gettxline: illegal character in string: ‘%ls’" @@ -1460,12 +1470,12 @@ msgstr "gettxline: illegal character in string: ‘%ls’" #. "input|No" contain the keycodes used to determine whether a #. user is answering "Yes" or "No" in response to some question. #. Both upper and lower-case versions should be present. -#: src/intf.c:2942 +#: src/intf.c:2952 msgctxt "input|Yes" msgid "Yy" msgstr "Yy" -#: src/intf.c:2944 +#: src/intf.c:2954 msgctxt "input|No" msgid "Nn" msgstr "Nn" @@ -1473,12 +1483,12 @@ msgstr "Nn" #. TRANSLATORS: The strings "Yes" and "No" are printed as a #. response to user input in answer to questions like "Are you #. sure? [Y/N] " -#: src/intf.c:2995 +#: src/intf.c:3005 msgctxt "answer" msgid "Yes" msgstr "Yes" -#: src/intf.c:2997 +#: src/intf.c:3007 msgctxt "answer" msgid "No" msgstr "No" diff --git a/po/en_GB.po b/po/en_GB.po index 4d2403e..688b242 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: trader 7.3\n" "Report-Msgid-Bugs-To: J.Zaitseff@zap.org.au\n" -"POT-Creation-Date: 2011-08-30 09:08+1000\n" -"PO-Revision-Date: 2011-08-30 08:26+1000\n" +"POT-Creation-Date: 2011-08-30 12:38+1000\n" +"PO-Revision-Date: 2011-08-30 12:43+1000\n" "Last-Translator: John Zaitseff \n" "Language-Team: English (British)\n" "Language: en_GB\n" @@ -1409,7 +1409,7 @@ msgstr "Page %d of %d" #. TRANSLATORS: The reason the user is not asked "Press any #. key to continue" is historical: many, many people used to #. ask "where is the key?" :-) -#: src/help.c:473 src/intf.c:3025 +#: src/help.c:473 src/intf.c:3035 msgid "[ Press to continue ] " msgstr "[ Press to continue ] " @@ -1451,7 +1451,17 @@ msgstr "mkchstr_conv: NUL" msgid "mkchstr: `%s'" msgstr "mkchstr: ‘%s’" -#: src/intf.c:2025 src/intf.c:2070 +#. TRANSLATORS: This string specifies the keycodes used to insert the +#. default value into the input string, if entered as the very first +#. character. Ideally, it should contain an easily-accessible +#. keycode that would NOT be used in ordinary input. Digits, ".", +#. ",", "+" and "-" are definitely NOT acceptable. +#: src/intf.c:2020 +msgctxt "input|DefaultValue" +msgid "=;" +msgstr "=;" + +#: src/intf.c:2034 src/intf.c:2079 #, c-format msgid "gettxline: illegal character in string: `%ls'" msgstr "gettxline: illegal character in string: ‘%ls’" @@ -1460,12 +1470,12 @@ msgstr "gettxline: illegal character in string: ‘%ls’" #. "input|No" contain the keycodes used to determine whether a #. user is answering "Yes" or "No" in response to some question. #. Both upper and lower-case versions should be present. -#: src/intf.c:2942 +#: src/intf.c:2952 msgctxt "input|Yes" msgid "Yy" msgstr "Yy" -#: src/intf.c:2944 +#: src/intf.c:2954 msgctxt "input|No" msgid "Nn" msgstr "Nn" @@ -1473,12 +1483,12 @@ msgstr "Nn" #. TRANSLATORS: The strings "Yes" and "No" are printed as a #. response to user input in answer to questions like "Are you #. sure? [Y/N] " -#: src/intf.c:2995 +#: src/intf.c:3005 msgctxt "answer" msgid "Yes" msgstr "Yes" -#: src/intf.c:2997 +#: src/intf.c:3007 msgctxt "answer" msgid "No" msgstr "No" diff --git a/po/en_US.po b/po/en_US.po index 5ca50be..f9bceb9 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: trader 7.3\n" "Report-Msgid-Bugs-To: J.Zaitseff@zap.org.au\n" -"POT-Creation-Date: 2011-08-30 09:08+1000\n" -"PO-Revision-Date: 2011-08-30 08:27+1000\n" +"POT-Creation-Date: 2011-08-30 12:38+1000\n" +"PO-Revision-Date: 2011-08-30 12:43+1000\n" "Last-Translator: John Zaitseff \n" "Language-Team: English\n" "Language: en_US\n" @@ -1409,7 +1409,7 @@ msgstr "Page %d of %d" #. TRANSLATORS: The reason the user is not asked "Press any #. key to continue" is historical: many, many people used to #. ask "where is the key?" :-) -#: src/help.c:473 src/intf.c:3025 +#: src/help.c:473 src/intf.c:3035 msgid "[ Press to continue ] " msgstr "[ Press to continue ] " @@ -1451,7 +1451,17 @@ msgstr "mkchstr_conv: NUL" msgid "mkchstr: `%s'" msgstr "mkchstr: ‘%s’" -#: src/intf.c:2025 src/intf.c:2070 +#. TRANSLATORS: This string specifies the keycodes used to insert the +#. default value into the input string, if entered as the very first +#. character. Ideally, it should contain an easily-accessible +#. keycode that would NOT be used in ordinary input. Digits, ".", +#. ",", "+" and "-" are definitely NOT acceptable. +#: src/intf.c:2020 +msgctxt "input|DefaultValue" +msgid "=;" +msgstr "=;" + +#: src/intf.c:2034 src/intf.c:2079 #, c-format msgid "gettxline: illegal character in string: `%ls'" msgstr "gettxline: illegal character in string: ‘%ls’" @@ -1460,12 +1470,12 @@ msgstr "gettxline: illegal character in string: ‘%ls’" #. "input|No" contain the keycodes used to determine whether a #. user is answering "Yes" or "No" in response to some question. #. Both upper and lower-case versions should be present. -#: src/intf.c:2942 +#: src/intf.c:2952 msgctxt "input|Yes" msgid "Yy" msgstr "Yy" -#: src/intf.c:2944 +#: src/intf.c:2954 msgctxt "input|No" msgid "Nn" msgstr "Nn" @@ -1473,12 +1483,12 @@ msgstr "Nn" #. TRANSLATORS: The strings "Yes" and "No" are printed as a #. response to user input in answer to questions like "Are you #. sure? [Y/N] " -#: src/intf.c:2995 +#: src/intf.c:3005 msgctxt "answer" msgid "Yes" msgstr "Yes" -#: src/intf.c:2997 +#: src/intf.c:3007 msgctxt "answer" msgid "No" msgstr "No" diff --git a/src/intf.c b/src/intf.c index e8eb0af..d1730ae 100644 --- a/src/intf.c +++ b/src/intf.c @@ -1993,6 +1993,7 @@ int gettxline (WINDOW *win, wchar_t *restrict buf, int bufsize, const wchar_t *allowed, bool stripspc, int y, int x, int width, chtype attr) { + wchar_t *keycode_defval; bool done, redraw, mod; int len, pos, st; int clen, cpos; @@ -2010,6 +2011,14 @@ int gettxline (WINDOW *win, wchar_t *restrict buf, int bufsize, chbuf = xmalloc(BUFSIZE * sizeof(chtype)); + keycode_defval = xmalloc(BUFSIZE * sizeof(wchar_t)); + /* TRANSLATORS: This string specifies the keycodes used to insert the + default value into the input string, if entered as the very first + character. Ideally, it should contain an easily-accessible + keycode that would NOT be used in ordinary input. Digits, ".", + ",", "+" and "-" are definitely NOT acceptable. */ + xmbstowcs(keycode_defval, pgettext("input|DefaultValue", "=;"), BUFSIZE); + keypad(win, true); meta(win, true); wtimeout(win, -1); @@ -2055,8 +2064,8 @@ int gettxline (WINDOW *win, wchar_t *restrict buf, int bufsize, if (rcode == OK) { // Ordinary wide character - if ((key == CHAR_DEFVAL1 || key == CHAR_DEFVAL2) - && defaultval != NULL && len == 0) { + if (defaultval != NULL && len == 0 + && wcschr(keycode_defval, key) != NULL) { // Initialise buffer with the default value wcsncpy(buf, defaultval, bufsize - 1); @@ -2705,6 +2714,7 @@ int gettxline (WINDOW *win, wchar_t *restrict buf, int bufsize, } free(chbuf); + free(keycode_defval); return ret; } diff --git a/src/intf.h b/src/intf.h index db73c8a..a7d5b01 100644 --- a/src/intf.h +++ b/src/intf.h @@ -101,10 +101,6 @@ typedef enum curs_type { #define KEY_CTRL(x) ((x) - 0100) // ASCII control character -// Keycodes for inserting the default value in input routines -#define CHAR_DEFVAL1 L'=' -#define CHAR_DEFVAL2 L';' - // Control-arrow key combinations, as returned by Ncurses #ifndef KEY_CDOWN # define KEY_CDOWN 01007 // CTRL + Down Arrow