Commit bf61c763 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

avoid using g_strdup_printf. It does not support positional arguments,

2001-12-30  Jody Goldberg <jody@gnome.org>

	* src/commands.c (cmd_insert_rows) : avoid using g_strdup_printf.  It
	  does not support positional arguments, which makes translation
	  difficult.
	(cmd_insert_cols) : ditto.

	* src/auto-correct.c (autocorrect_tool) : ispunct is too liberal for
	  what we want. Use a translated set of names for the capitalization.

	* src/GNOME_Gnumeric.xml : sync with non-bonobo text and fix some
	  mis-named items.  disable the combo and list until 1.0.1
parent 6bce6410
......@@ -16,6 +16,8 @@ Pending Patches
Long term breakage
------------------
- Add ... in bonobo menus for insert object* and define name
- Add dirty flags to workbook too, adding a sheet should make workbook dirty
not the new sheet.
......
2001-12-30 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_insert_rows) : avoid using g_strdup_printf. It
does not support positional arguments, which makes translation
difficult.
(cmd_insert_cols) : ditto.
* src/auto-correct.c (autocorrect_tool) : ispunct is too liberal for
what we want. Use a translated set of names for the capitalization.
* src/GNOME_Gnumeric.xml : sync with non-bonobo text and fix some
mis-named items.
mis-named items. disable the combo and list until 1.0.1
* src/cell.h : fix warning on s390
* src/collect.h : ditto.
......
2001-12-30 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_insert_rows) : avoid using g_strdup_printf. It
does not support positional arguments, which makes translation
difficult.
(cmd_insert_cols) : ditto.
* src/auto-correct.c (autocorrect_tool) : ispunct is too liberal for
what we want. Use a translated set of names for the capitalization.
* src/GNOME_Gnumeric.xml : sync with non-bonobo text and fix some
mis-named items.
mis-named items. disable the combo and list until 1.0.1
* src/cell.h : fix warning on s390
* src/collect.h : ditto.
......
2001-12-30 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_insert_rows) : avoid using g_strdup_printf. It
does not support positional arguments, which makes translation
difficult.
(cmd_insert_cols) : ditto.
* src/auto-correct.c (autocorrect_tool) : ispunct is too liberal for
what we want. Use a translated set of names for the capitalization.
* src/GNOME_Gnumeric.xml : sync with non-bonobo text and fix some
mis-named items.
mis-named items. disable the combo and list until 1.0.1
* src/cell.h : fix warning on s390
* src/collect.h : ditto.
......
2001-12-30 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_insert_rows) : avoid using g_strdup_printf. It
does not support positional arguments, which makes translation
difficult.
(cmd_insert_cols) : ditto.
* src/auto-correct.c (autocorrect_tool) : ispunct is too liberal for
what we want. Use a translated set of names for the capitalization.
* src/GNOME_Gnumeric.xml : sync with non-bonobo text and fix some
mis-named items.
mis-named items. disable the combo and list until 1.0.1
* src/cell.h : fix warning on s390
* src/collect.h : ditto.
......
......@@ -815,7 +815,6 @@
pixtype="stock" pixname="Gnumeric_Radiobutton"
_label="Radio Button"
_tip="Create a radio button" verb="CreateRadiobutton"/>
-->
<toolitem name="List"
pixtype="stock" pixname="Gnumeric_List"
......@@ -826,6 +825,7 @@
pixtype="stock" pixname="Gnumeric_Combo"
_label="Combo Box"
_tip="Create a combo box" verb="CreateCombobox"/>
-->
<toolitem name="Line"
pixtype="stock" pixname="Gnumeric_Line"
......
......@@ -11,10 +11,12 @@
#include <gnumeric-config.h>
#include "gnumeric.h"
#include "auto-correct.h"
#include "dates.h"
#include <ctype.h>
#include <string.h>
#include <libgnome/gnome-config.h>
#include <libgnome/gnome-i18n.h>
static struct {
gboolean init_caps : 1;
......@@ -104,8 +106,6 @@ autocorrect_set_exceptions (AutoCorrectFeature feature, GList *list)
};
}
/* Add the name of the days on your language if they are always capitalized.
*/
static char const * const autocorrect_day [] = {
/* English */
"monday", "tuesday", "wednesday", "thursday",
......@@ -148,9 +148,11 @@ autocorrect_tool (char const *command)
unsigned char *p;
for (s = ucommand; *s; s = p+1) {
static char const * const not_punct = "~@#$%^&*()[]{}<>,/_-+=`\'\"\\";
skip_first_letter:
/* We need to find the end of a sentence assume ',' is not */
for (p = s; *p != '\0' && !(ispunct (*p) || *p == ',') ; p++)
for (p = s; *p != '\0' &&
!(ispunct (*p) || strchr (not_punct, *p)) ; p++)
;
if (*p == '\0')
break;
......@@ -182,12 +184,17 @@ autocorrect_tool (char const *command)
}
if (autocorrect.names_of_days)
for (i = 0; autocorrect_day[i] != NULL; i++) {
do {
s = strstr (ucommand, autocorrect_day[i]);
if (s != NULL)
*s = toupper (*s);
} while (s != NULL);
for (i = 0; day_long[i] != NULL; i++) {
char const *day = _(day_long [i]) + 1;
s = ucommand;
loop :
s = strstr (s, day);
if (s != NULL) {
if (s > ucommand)
s[-1] = toupper (s[-1]);
s++;
goto loop;
}
}
return ucommand;
......
......@@ -1080,10 +1080,14 @@ gboolean
cmd_insert_cols (WorkbookControl *wbc,
Sheet *sheet, int start_col, int count)
{
char *mesg = g_strdup_printf ((count > 1)
? _("Inserting %d columns before %s")
: _("Inserting %d column before %s"),
count, col_name (start_col));
/* g_strdup_printf does not support positional args, which screws the translators.
* We control the buffer content so there is no worry of overflow
*/
char mesg[128];
snprintf (mesg, sizeof (mesg), (count > 1)
? _("Inserting %d columns before %s")
: _("Inserting %d column before %s"),
count, col_name (start_col));
return cmd_ins_del_colrow (wbc, sheet, TRUE, TRUE, mesg,
start_col, count);
}
......@@ -1092,10 +1096,14 @@ gboolean
cmd_insert_rows (WorkbookControl *wbc,
Sheet *sheet, int start_row, int count)
{
char *mesg = g_strdup_printf ((count > 1)
? _("Inserting %d rows before %s")
: _("Inserting %d row before %s"),
count, row_name (start_row));
/* g_strdup_printf does not support positional args, which screws the translators.
* We control the buffer content so there is no worry of overflow
*/
char mesg[128];
snprintf (mesg, sizeof (mesg), (count > 1)
? _("Inserting %d rows before %s")
: _("Inserting %d row before %s"),
count, row_name (start_row));
return cmd_ins_del_colrow (wbc, sheet, FALSE, TRUE, mesg,
start_row, count);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment