Commit 88ad7da2 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Control translation. (unit_name_get_short_name) : Ditto.

2000-09-28  Jody Goldberg <jgoldberg@home.com>

	* src/print-info.c (unit_name_get_name) : Control translation.
	(unit_name_get_short_name) : Ditto.
	(unit_name_to_unit) : Ditto.

2000-09-27  Jody Goldberg <jgoldberg@home.com>

	* gnumericConf.sh.in : Fix to match gnome-config's expectations.
parent c92e7484
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* src/print-info.c (unit_name_get_name) : Control translation.
(unit_name_get_short_name) : Ditto.
(unit_name_to_unit) : Ditto.
2000-09-27 Jody Goldberg <jgoldberg@home.com>
* gnumericConf.sh.in : Fix to match gnome-config's expectations.
2000-09-27 Morten Welinder <terra@diku.dk>
* src/print-info.c: Use constant expression to make factors easier
......
#
# Configuration file for using gnumeric
#
MODULE_VERSION=@gnumeric_version@
GNUMERIC_VERSION=@gnumeric_version@
GNUMERIC_PREFIX="@gnumeric_prefix@/"
GNUMERIC_EXEC_PREFIX="@gnumeric_exec_prefix@/"
GNUMERIC_VERSION=@gnumeric_version@
GNUMERIC_DATADIR="@gnumeric_datadir@"
GNUMERIC_LIBDIR="@gnumeric_libdir@"
GNUMERIC_PLUGINDIR="@gnumeric_plugindir@"
......
2000-09-28 Jody Goldberg <jgoldberg@home.com>
* dialog-printer-setup.c (add_unit) : Adjsutto api change in
unit_name_get_short_name.
2000-09-27 Morten Welinder <terra@diku.dk>
* dialog-printer-setup.c (add_unit): Avoid double translation of
......
......@@ -602,7 +602,7 @@ add_unit (GtkWidget *menu, int i, dialog_print_info_t *dpi,
{
GtkWidget *item;
item = gtk_menu_item_new_with_label (unit_name_get_short_name (i));
item = gtk_menu_item_new_with_label (unit_name_get_short_name (i), TRUE);
gtk_widget_show (item);
gtk_menu_append (GTK_MENU (menu), item);
......
......@@ -142,7 +142,7 @@ load_margin (const char *str, PrintUnit *p, char *def)
p->points = gnome_config_get_float (pts);
s = gnome_config_get_string (pts_units);
p->desired_display = unit_name_to_unit (s);
p->desired_display = unit_name_to_unit (s, FALSE);
g_free (pts_units);
g_free (pts);
g_free (s);
......@@ -321,7 +321,7 @@ save_margin (const char *prefix, PrintUnit *p)
char *x = g_strconcat (prefix, "_units", NULL);
gnome_config_set_float (prefix, p->points);
gnome_config_set_string (x, unit_name_get_name (p->desired_display));
gnome_config_set_string (x, unit_name_get_name (p->desired_display, FALSE));
g_free (x);
}
......@@ -440,20 +440,63 @@ static struct {
{ NULL, NULL, 0.0 }
};
/*
* unit_name_get_short_name :
* @unit : The unit.
* @translated : Should the name be translated
*
* Returns the optionally translated short name of the @unit.
*/
const char *
unit_name_get_short_name (UnitName name)
unit_name_get_short_name (UnitName name, gboolean translated)
{
g_assert (name >= UNIT_POINTS && name < UNIT_LAST);
return _(units [name].short_name);
return translated
? _(units [name].short_name)
: units [name].short_name;
}
/*
* unit_name_get_name :
* @unit : The unit.
* @translated : Should the name be translated
*
* Returns the optionally translated standard name of the @unit.
*/
const char *
unit_name_get_name (UnitName name)
unit_name_get_name (UnitName name, gboolean translated)
{
g_assert (name >= UNIT_POINTS && name < UNIT_LAST);
return _(units [name].full_name);
return translated
? _(units [name].full_name)
: units [name].full_name;
}
/*
* unit_name_to_unit :
* @str : A string with a unit name.
* @translated : Is @str localized.
*
* Returns the unit associated with the possiblely translated @str.
*/
UnitName
unit_name_to_unit (const char *s, gboolean translated)
{
int i;
for (i = 0; units [i].full_name != NULL; i++){
if (translated) {
if (strcmp (s, _(units [i].full_name)) == 0)
return (UnitName) i;
} else {
if (strcmp (s, units [i].full_name) == 0)
return (UnitName) i;
}
}
return UNIT_POINTS;
}
double
......@@ -477,19 +520,6 @@ unit_convert (double value, UnitName source, UnitName target)
return (units [source].factor * value) / units [target].factor;
}
UnitName
unit_name_to_unit (const char *s)
{
int i;
for (i = 0; units [i].short_name != NULL; i++){
if (strcmp (s, units [i].full_name) == 0)
return (UnitName) i;
}
return UNIT_POINTS;
}
static void
render_tab (GString *target, HFRenderInfo *info, const char *args)
{
......
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