From 2f9aee8d7f0d164412a459d26970ea3151f875be Mon Sep 17 00:00:00 2001 From: Robert Brady Date: Sun, 22 Oct 2000 13:00:13 +0000 Subject: [PATCH] Check for bind_textdomain_codeset 2000-10-22 Robert Brady * configure.in: Check for bind_textdomain_codeset * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset present, make use of it. Add a translatable string "default:LTR" which, if translated to "default:RTL", will cause the default direction to be Right-to-Left. * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget direction if marked as flippable. * gtk/gtkhscale.c: Mark widget as flippable. --- ChangeLog | 16 ++++++++ ChangeLog.pre-2-0 | 16 ++++++++ ChangeLog.pre-2-10 | 16 ++++++++ ChangeLog.pre-2-2 | 16 ++++++++ ChangeLog.pre-2-4 | 16 ++++++++ ChangeLog.pre-2-6 | 16 ++++++++ ChangeLog.pre-2-8 | 16 ++++++++ configure.in | 2 +- gtk/gtkhscale.c | 2 + gtk/gtkmain.c | 19 +++++++++- gtk/gtkrange.c | 12 +++++- gtk/gtkrange.h | 1 + po/ChangeLog | 4 ++ po/POTFILES.in | 1 + po/fa.po | 61 +++++++++++++++++++++++------ po/he.po | 95 ++++++++++++++++++++++++++++++---------------- 16 files changed, 261 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7193b0aae5..a0cec02c89 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,19 @@ +2000-10-22 Robert Brady + + * configure.in: Check for bind_textdomain_codeset + + * gtk/gtkmain.c (gtk_init_check): If bind_textdomain_codeset + present, make use of it. + + Add a translatable string "default:LTR" which, if translated + to "default:RTL", will cause the default direction to be + Right-to-Left. + + * gtk/gtkrange.h, gtk/gtkrange.c: Take into account the widget + direction if marked as flippable. + + * gtk/gtkhscale.c: Mark widget as flippable. + 2000-10-04 Havoc Pennington * gtk/testgtk.c (create_buttons): create some stock buttons diff --git a/configure.in b/configure.in index 2987f97a93..1abcf8c006 100644 --- a/configure.in +++ b/configure.in @@ -194,7 +194,7 @@ if test "x$enable_rebuilds" = "xyes" && \ fi AC_SUBST(REBUILD) -AC_CHECK_FUNCS(lstat mkstemp sigsetjmp) +AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset) AC_MSG_CHECKING(whether make is GNU Make) STRIP_BEGIN= diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c index b3c7eb2490..c8442fb70c 100644 --- a/gtk/gtkhscale.c +++ b/gtk/gtkhscale.c @@ -185,6 +185,8 @@ gtk_hscale_new (GtkAdjustment *adjustment) "adjustment", adjustment, NULL); + GTK_RANGE (hscale) -> flippable = 1; + return hscale; } diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 7a690d2acd..98d74c926f 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -393,9 +393,12 @@ gtk_init_check (int *argc, } #ifdef ENABLE_NLS -#ifndef G_OS_WIN32 +# ifndef G_OS_WIN32 bindtextdomain(GETTEXT_PACKAGE, GTK_LOCALEDIR); -#else +# ifdef HAVE_BIND_TEXTDOMAIN_CODSET + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); +# endif +# else /* !G_OS_WIN32 */ { /* GTk+ locale dir is %WinDir%\gtk+\locale */ bindtextdomain (GETTEXT_PACKAGE, @@ -407,6 +410,18 @@ gtk_init_check (int *argc, #endif #endif + { + /* Translate to default:RTL if you want your widgets + * to be RTL, otherwise translate to default:LTR + */ + char *e = _("default:LTR"); + if (strcmp (e, "default:RTL")==0) { + gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); + } else if (strcmp (e, "default:LTR")) { + g_warning ("Whoever translated default:LTR did so wrongly.\n"); + } + } + /* Initialize the default visual and colormap to be * used in creating widgets. (We want to use the system * defaults so as to be nice to the colormap). diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 92ff0c0dc8..595a8a9bdc 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -237,6 +237,7 @@ gtk_range_init (GtkRange *range) range->click_child = 0; range->need_timer = FALSE; range->timer = 0; + range->flippable = 0; range->old_value = 0.0; range->old_lower = 0.0; range->old_upper = 0.0; @@ -457,6 +458,9 @@ gtk_range_default_hslider_update (GtkRange *range) else if (x > right) x = right; + if (range->flippable && gtk_widget_get_direction (range) == GTK_TEXT_DIR_RTL) + x = right - (x - left); + move_and_update_window (range->slider, x, GTK_WIDGET (range)->style->ythickness); } } @@ -521,7 +525,10 @@ gtk_range_default_htrough_click (GtkRange *range, gtk_range_trough_hdims (range, &left, &right); gdk_window_get_size (range->slider, &slider_length, NULL); right += slider_length; - + + if (range->flippable && gtk_widget_get_direction (range) == GTK_TEXT_DIR_RTL) + x = (right - x) + left; + if ((x > left) && (y > ythickness)) { gdk_window_get_size (range->trough, &trough_width, &trough_height); @@ -616,6 +623,9 @@ gtk_range_default_hmotion (GtkRange *range, new_pos = slider_x + xdelta; + if (range->flippable && gtk_widget_get_direction (range) == GTK_TEXT_DIR_RTL) + new_pos = (right - new_pos) + left; + if (new_pos < left) new_pos = left; else if (new_pos > right) diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h index 2799904581..3842ab44dc 100644 --- a/gtk/gtkrange.h +++ b/gtk/gtkrange.h @@ -68,6 +68,7 @@ struct _GtkRange guint in_child : 3; guint click_child : 3; guint need_timer : 1; + guint flippable : 1; guint32 timer; diff --git a/po/ChangeLog b/po/ChangeLog index d73df863d2..9adf23c002 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,7 @@ +2000-10-22 Robert Brady + + * fa.po, he.po: Default to right-to-left. + 2000-10-19 Christian Rose * sv.po: Updated Swedish translation. diff --git a/po/POTFILES.in b/po/POTFILES.in index f3bb18e243..2f4d1a59e8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -7,6 +7,7 @@ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkgamma.c gtk/gtkinputdialog.c +gtk/gtkmain.c gtk/gtknotebook.c gtk/gtkrc.c gtk/gtkthemes.c diff --git a/po/fa.po b/po/fa.po index 3fa0f149c2..f8e7853e91 100644 --- a/po/fa.po +++ b/po/fa.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+ 1.3.1\n" -"POT-Creation-Date: 2000-10-12 20:58+0100\n" +"POT-Creation-Date: 2000-10-22 01:23+0100\n" "PO-Revision-Date: 2000-10-13 15:00+0330\n" "Last-Translator: Roozbeh Pournader \n" "Language-Team: Persian \n" @@ -13,6 +13,32 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: gdk-pixbuf/io-gif.c:426 +msgid "GIF file was missing some data (perhaps it was truncated somehow?)" +msgstr "" + +#: gdk-pixbuf/io-gif.c:435 +#, c-format +msgid "Internal error in the GIF loader (%s)" +msgstr "" + +#: gdk-pixbuf/io-gif.c:584 +msgid "Circular table entry in GIF file" +msgstr "" + +#: gdk-pixbuf/io-gif.c:921 +msgid "File does not appear to be a GIF file" +msgstr "" + +#: gdk-pixbuf/io-gif.c:933 +#, c-format +msgid "Version %s of the GIF file format is not supported" +msgstr "" + +#: gdk-pixbuf/io-gif.c:985 +msgid "GIF animation contained a frame with an incorrect size" +msgstr "" + #: gtk/gtkcolorsel.c:1422 msgid "Hue:" msgstr "پرده:" @@ -239,13 +265,13 @@ msgstr "انحنای Y" #: gtk/gtkinputdialog.c:476 msgid "Wheel" msgstr "چرخ" -# farmaan +# farmaan #: gtk/gtkinputdialog.c:516 msgid "none" msgstr "هیچ‌کدام" -# hich-yek, hich-kodaam, be-hich-vajh, aslan +# hich-yek, hich-kodaam, be-hich-vajh, aslan #: gtk/gtkinputdialog.c:550 gtk/gtkinputdialog.c:586 msgid "(disabled)" msgstr "(از کار افتاده)" @@ -253,35 +279,46 @@ msgstr "(از کار افتاده)" #: gtk/gtkinputdialog.c:579 msgid "(unknown)" msgstr "(نامعلوم)" -# naashenaakhte, naashenaas, naama'loom, naamoshakhkhas +# naashenaakhte, naashenaas, naama'loom, naamoshakhkhas #. and clear button #: gtk/gtkinputdialog.c:664 msgid "clear" msgstr "پاک شود" -# paak kardan, rad kardan, tamiz kardan, door rikhtan, rowshan kardan, towzih daadan +#. Translate to default:RTL if you want your widgets +#. to be RTL, otherwise translate to default:LTR +#: gtk/gtkmain.c:416 +msgid "default:LTR" +msgstr "default:RTL" + +# paak kardan, rad kardan, tamiz kardan, door rikhtan, rowshan kardan, towzih daadan #: gtk/gtknotebook.c:2059 gtk/gtknotebook.c:4131 #, c-format msgid "Page %u" msgstr "صفحه‌ی %u" -#: gtk/gtkrc.c:1945 +#: gtk/gtkrc.c:1978 #, c-format msgid "Unable to locate image file in pixmap_path: \"%s\" line %d" -msgstr "پرونده‌ی تصویری در pixmap_path مقابل یافت نشد: \"%s\" سطر %d" +msgstr "" +"پرونده‌ی تصویری در pixmap_path مقابل یافت نشد: " +"\"%s\" سطر %d" -#: gtk/gtkrc.c:1948 +#: gtk/gtkrc.c:1981 #, c-format msgid "Unable to locate image file in pixmap_path: \"%s\"" -msgstr "پرونده‌ی تصویری در pixmap_path مقابل یافت نشد: \"%s\"" +msgstr "" +"پرونده‌ی تصویری در pixmap_path مقابل یافت نشد: " +"\"%s\"" -#: gtk/gtkthemes.c:65 +#: gtk/gtkthemes.c:117 #, c-format msgid "Unable to locate loadable module in module_path: \"%s\"," -msgstr "واحد بارشونده در module_path مقابل یافت نشد: \"%s\"," +msgstr "" +"واحد بارشونده در module_path مقابل یافت نشد: " +"\"%s\"," #: gtk/gtktipsquery.c:180 msgid "--- No Tip ---" msgstr "--- کمک بی کمک ---" - diff --git a/po/he.po b/po/he.po index b0ea8bf018..71c3b9f874 100644 --- a/po/he.po +++ b/po/he.po @@ -2,11 +2,10 @@ # Copyright (C) 2000 Free Software Foundation, Inc. # Tzafrir Cohen , 2000. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-08-10 21:20-0400\n" +"POT-Creation-Date: 2000-10-22 02:04+0100\n" "PO-Revision-Date: 2000-07-26 HO:MI+ZONE\n" "Last-Translator: Tzafrir Cohen \n" "Language-Team: LANGUAGE \n" @@ -14,55 +13,81 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: gtk/gtkcolorsel.c:1420 -msgid "Hue:" +#: gdk-pixbuf/io-gif.c:426 +msgid "GIF file was missing some data (perhaps it was truncated somehow?)" msgstr "" -#: gtk/gtkcolorsel.c:1421 -msgid "Saturation:" +#: gdk-pixbuf/io-gif.c:435 +#, c-format +msgid "Internal error in the GIF loader (%s)" +msgstr "" + +#: gdk-pixbuf/io-gif.c:584 +msgid "Circular table entry in GIF file" +msgstr "" + +#: gdk-pixbuf/io-gif.c:921 +msgid "File does not appear to be a GIF file" +msgstr "" + +#: gdk-pixbuf/io-gif.c:933 +#, c-format +msgid "Version %s of the GIF file format is not supported" +msgstr "" + +#: gdk-pixbuf/io-gif.c:985 +msgid "GIF animation contained a frame with an incorrect size" msgstr "" #: gtk/gtkcolorsel.c:1422 +msgid "Hue:" +msgstr "" + +#: gtk/gtkcolorsel.c:1423 +msgid "Saturation:" +msgstr "" + +#: gtk/gtkcolorsel.c:1424 msgid "Value:" msgstr "ערך:" -#: gtk/gtkcolorsel.c:1423 +#: gtk/gtkcolorsel.c:1425 msgid "Red:" msgstr "אדום:" -#: gtk/gtkcolorsel.c:1424 +#: gtk/gtkcolorsel.c:1426 msgid "Green:" msgstr "אדום:" -#: gtk/gtkcolorsel.c:1425 +#: gtk/gtkcolorsel.c:1427 msgid "Blue:" msgstr "כחול:" -#: gtk/gtkcolorsel.c:1428 +#: gtk/gtkcolorsel.c:1430 msgid "Opacity:" msgstr "" -#: gtk/gtkcolorsel.c:1443 +#: gtk/gtkcolorsel.c:1445 msgid "Hex Value:" msgstr "ערך הקס':" -#: gtk/gtkcolorsel.c:1464 +#: gtk/gtkcolorsel.c:1466 msgid "Custom Palette" msgstr "" -#: gtk/gtkcolorsel.c:1469 +#: gtk/gtkcolorsel.c:1471 msgid "Set Color" msgstr "" #. The OK button -#: gtk/gtkcolorseldialog.c:105 gtk/gtkfilesel.c:567 gtk/gtkfontsel.c:952 +#: gtk/gtkcolorseldialog.c:105 gtk/gtkfilesel.c:565 gtk/gtkfontsel.c:952 #: gtk/gtkgamma.c:415 msgid "OK" msgstr "אישור" #. The Cancel button -#: gtk/gtkcolorseldialog.c:111 gtk/gtkfilesel.c:574 gtk/gtkfilesel.c:963 -#: gtk/gtkfilesel.c:1067 gtk/gtkfilesel.c:1182 gtk/gtkfontsel.c:965 +#: gtk/gtkcolorseldialog.c:111 gtk/gtkfilesel.c:572 gtk/gtkfilesel.c:968 +#: gtk/gtkfilesel.c:1077 gtk/gtkfilesel.c:1201 gtk/gtkfontsel.c:965 #: gtk/gtkgamma.c:423 msgid "Cancel" msgstr "ביטול" @@ -72,31 +97,31 @@ msgid "Help" msgstr "עזרה" #. The directories clist -#: gtk/gtkfilesel.c:514 +#: gtk/gtkfilesel.c:512 msgid "Directories" msgstr "תיקיות" # hebrew note: "תיקיה" is "folder", but there is no better word for # "directory" #. The files clist -#: gtk/gtkfilesel.c:534 +#: gtk/gtkfilesel.c:532 msgid "Files" msgstr "קבצים" -#: gtk/gtkfilesel.c:605 gtk/gtkfilesel.c:1621 +#: gtk/gtkfilesel.c:603 gtk/gtkfilesel.c:1639 #, c-format msgid "Directory unreadable: %s" msgstr "תיקיה לא קריאה: %s" -#: gtk/gtkfilesel.c:637 +#: gtk/gtkfilesel.c:635 msgid "Create Dir" msgstr "יצירת תיקיה" -#: gtk/gtkfilesel.c:648 gtk/gtkfilesel.c:1036 +#: gtk/gtkfilesel.c:646 gtk/gtkfilesel.c:1046 msgid "Delete File" msgstr "מחיקת קובץ" -#: gtk/gtkfilesel.c:659 gtk/gtkfilesel.c:1140 +#: gtk/gtkfilesel.c:657 gtk/gtkfilesel.c:1159 msgid "Rename File" msgstr "שינוי שם קובץ" @@ -105,39 +130,39 @@ msgstr "שינוי שם קובץ" #. (GtkSignalFunc) gtk_file_selection_fileop_destroy, #. (gpointer) fs); #. -#: gtk/gtkfilesel.c:828 +#: gtk/gtkfilesel.c:827 msgid "Error" msgstr "שגיאה" #. close button -#: gtk/gtkfilesel.c:851 gtk/gtkinputdialog.c:338 +#: gtk/gtkfilesel.c:850 gtk/gtkinputdialog.c:338 msgid "Close" msgstr "סגירה" -#: gtk/gtkfilesel.c:927 +#: gtk/gtkfilesel.c:932 msgid "Create Directory" msgstr "יצירת תיקיב" -#: gtk/gtkfilesel.c:941 +#: gtk/gtkfilesel.c:946 msgid "Directory name:" msgstr "שם תיקיה:" #. buttons -#: gtk/gtkfilesel.c:954 +#: gtk/gtkfilesel.c:959 msgid "Create" msgstr "יצירה" #. buttons -#: gtk/gtkfilesel.c:1058 +#: gtk/gtkfilesel.c:1068 msgid "Delete" msgstr "מחיקה" #. buttons -#: gtk/gtkfilesel.c:1173 +#: gtk/gtkfilesel.c:1192 msgid "Rename" msgstr "שינוי שם" -#: gtk/gtkfilesel.c:1600 +#: gtk/gtkfilesel.c:1618 msgid "Selection: " msgstr "בחירה:" @@ -261,19 +286,25 @@ msgstr "(לא ידוע)" msgid "clear" msgstr "" +#. Translate to default:RTL if you want your widgets +#. to be RTL, otherwise translate to default:LTR +#: gtk/gtkmain.c:416 +msgid "default:LTR" +msgstr "default:RTL" + #: gtk/gtknotebook.c:2059 gtk/gtknotebook.c:4131 #, c-format msgid "Page %u" msgstr "דף %u" -#: gtk/gtkrc.c:1872 +#: gtk/gtkrc.c:1978 #, c-format msgid "Unable to locate image file in pixmap_path: \"%s\" line %d" msgstr "" "לא מצליח לאתר את קובץ התמונה ב-pixmap_path: \"%s\" " "שורה %d" -#: gtk/gtkrc.c:1875 +#: gtk/gtkrc.c:1981 #, c-format msgid "Unable to locate image file in pixmap_path: \"%s\"" msgstr ""