* Makefile.am, configure.in: Include gettext support.
* src/pty.c, src/reaper.c, src/trie.c, src/vte.c: Mark warnings for possible
translation.
* po/POTFILES.in, po/vte.pot: Add.
2002-06-07 nalin
+ * Makefile.am, configure.in: Include gettext support.
* src/vte.c: Center characters in their cells, caching their extents.
Finish merging otaylor's Xft2 patch (oops).
* src/vte.c, src/vte.h: Expose vte_terminal_set_encoding().
+ * src/pty.c, src/reaper.c, src/trie.c, src/vte.c: Mark warnings for
+ possible translation.
2002-06-06 nalin
* src/vte.c, src/vte.h: Add get_cursor_position(). Remove get_snapshot()
and free_shapshot().
-SUBDIRS = src termcaps
+SUBDIRS = src termcaps po
EXTRA_DIST = HACKING vte.spec vte.pc.in
pkgconfigdir = $(libdir)/pkgconfig
esac
libtoolize -f -c
+glib-gettextize -f -c
aclocal $ACLOCAL_FLAGS
# optionally feature autoheader
VERSION=`grep ^Version: $srcdir/vte.spec | awk '{print $NF}'`
AM_INIT_AUTOMAKE(vte,$VERSION)
AM_PROG_LIBTOOL
+AM_GLIB_GNU_GETTEXT
AC_EGREP_CPP(glibc,
[
#include <stdio.h>
fi
AC_DEFINE_UNQUOTED(DATADIR,"$mydatadir",
[The location where arch-independent package-specific data can be found.])
+AC_DEFINE_UNQUOTED(LOCALEDIR,"$mydatadir/locale",
+ [The location where locale data can be found.])
+
+GETTEXT_PACKAGE="$PACKAGE"
+AC_SUBST(GETTEXT_PACKAGE)
AM_CONFIG_HEADER(config.h)
-AC_OUTPUT([Makefile src/Makefile termcaps/Makefile vte.pc])
+AC_OUTPUT([Makefile src/Makefile termcaps/Makefile po/Makefile.in vte.pc])
--- /dev/null
+src/pty.c
+src/reaper.c
+src/trie.c
+src/vte.c
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2002-06-10 15:34-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/pty.c:101
+#, c-format
+msgid "Error adding `%s' to environment, continuing."
+msgstr ""
+
+#: src/reaper.c:106
+msgid "Error creating signal pipe."
+msgstr ""
+
+#: src/trie.c:386
+#, c-format
+msgid "Duplicate (%s/%s)!"
+msgstr ""
+
+#: src/vte.c:780
+#, c-format
+msgid "Error compiling regular expression \"%s\"."
+msgstr ""
+
+#: src/vte.c:4082
+#, c-format
+msgid "Got unexpected (key?) sequence `%s'."
+msgstr ""
+
+#: src/vte.c:4683
+#, c-format
+msgid "Character %5ld is %d columns wide, guessing 1."
+msgstr ""
+
+#: src/vte.c:4876
+#, c-format
+msgid "No handler for control sequence `%s' defined."
+msgstr ""
+
+#. Be conservative about discarding data.
+#: src/vte.c:5090
+#, c-format
+msgid "Invalid multibyte sequence detected. Munging up %d bytes of data."
+msgstr ""
+
+#: src/vte.c:5504
+#, c-format
+msgid "Error reading from child: %s."
+msgstr ""
+
+#: src/vte.c:5672
+#, c-format
+msgid "Error (%s) converting data for child, dropping."
+msgstr ""
+
+#: src/vte.c:7158
+#, c-format
+msgid ""
+"Warning: using fontset \"%s\", which is missing these character sets: %s."
+msgstr ""
+
+#: src/vte.c:7523
+#, c-format
+msgid "Failed to load Xft font pattern \"%s\", falling back to default font."
+msgstr ""
+
+#: src/vte.c:7536
+msgid "Failed to load default Xft font."
+msgstr ""
+
+#: src/vte.c:7575
+msgid "Error allocating Xft font, disabling Xft."
+msgstr ""
+
+#: src/vte.c:7599
+#, c-format
+msgid "Failed to load font set \"%s\", falling back to default font."
+msgstr ""
+
+#: src/vte.c:7611
+msgid "Failed to load default font, crashing or behaving abnormally."
+msgstr ""
+
+#: src/vte.c:7692
+#, c-format
+msgid "Error reading PTY size, using defaults: %s."
+msgstr ""
+
+#: src/vte.c:7713
+#, c-format
+msgid "Error setting PTY size: %s."
+msgstr ""
+
+#: src/vte.c:9537
+msgid "Error allocating layout, disabling Pango."
+msgstr ""
+
+#: src/vte.c:9547
+msgid "Error allocating draw, disabling Xft."
+msgstr ""
+
+#. Aaargh. We're screwed.
+#: src/vte.c:10729
+msgid "g_iconv_open() failed setting word characters"
+msgstr ""
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef caps_h
-#define caps_h
+#ifndef vte_caps_h_included
+#define vte_caps_h_included
#ident "$Id$"
#ident "$Id$"
-#ifndef debug_h
-#define debug_h
+#ifndef vte_debug_h_included
+#define vte_debug_h_included
typedef enum {
VTE_DEBUG_MISC = 1 << 0,
#include "debug.h"
#include "pty.h"
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(String) dgettext(PACKAGE, String)
+#else
+#define _(String) String
+#endif
+
/* Open the named PTY slave, fork off a child (storing its PID in child),
* and exec the named command in its own session as a process group leader */
static int
/* Set any environment variables. */
for (i = 0; (env_add != NULL) && (env_add[i] != NULL); i++) {
if (putenv(g_strdup(env_add[i])) != 0) {
- g_warning("Error adding `%s' to environment, "
- "continuing.", env_add[i]);
+ g_warning(_("Error adding `%s' to environment, "
+ "continuing."), env_add[i]);
}
#ifdef VTE_DEBUG
if (vte_debug_on(VTE_DEBUG_MISC)) {
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef pty_h_included
-#define pty_h_included
+#ifndef vte_pty_h_included
+#define vte_pty_h_included
#ident "$Id$"
#include "marshal.h"
#include "reaper.h"
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#else
+#define bindtextdomain(package,dir)
+#endif
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(String) dgettext(PACKAGE, String)
+#else
+#define _(String) String
+#endif
+
static VteReaper *singleton_reaper = NULL;
struct reaper_info {
int signum;
int ret;
ret = pipe(reaper->iopipe);
if (ret == -1) {
- g_error("Error creating signal pipe.");
+ g_error(_("Error creating signal pipe."));
}
action.sa_handler = vte_reaper_signal_handler;
sigemptyset(&action.sa_mask);
static void
vte_reaper_class_init(VteReaperClass *klass, gpointer data)
{
+ bindtextdomain(PACKAGE, LOCALEDIR);
klass->child_exited_signal = g_signal_new("child-exited",
G_OBJECT_CLASS_TYPE(klass),
G_SIGNAL_RUN_LAST,
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef ring_h_included
-#define ring_h_included
+#ifndef vte_ring_h_included
+#define vte_ring_h_included
#ident "$Id$"
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef termcap_h
-#define termcap_h
+#ifndef vte_termcap_h_included
+#define vte_termcap_h_included
#ident "$Id$"
#include "debug.h"
#include "trie.h"
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(String) dgettext(PACKAGE, String)
+#else
+#define _(String) String
+#endif
+
#ifndef TRIE_MAYBE_STATIC
#define TRIE_MAYBE_STATIC
#endif
} else {
#ifdef VTE_DEBUG
if (vte_debug_on(VTE_DEBUG_PARSE)) {
- g_warning("Duplicate (%s/%s)!",
+ g_warning(_("Duplicate (%s/%s)!"),
result, trie->result);
}
#endif
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef trie_h
-#define trie_h
+#ifndef vte_trie_h_included
+#define vte_trie_h_included
#ident "$Id$"
#include <X11/Xft/Xft.h>
#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#else
+#define bindtextdomain(package,dir)
+#endif
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(String) dgettext(PACKAGE, String)
+#else
+#define _(String) String
+#endif
+
#define VTE_TAB_WIDTH 8
#define VTE_LINE_WIDTH 1
#define VTE_COLOR_SET_SIZE 8
memset(®ex, 0, sizeof(regex));
ret = regcomp(®ex.reg, match, REG_EXTENDED);
if (ret != 0) {
- g_warning("Error compiling regular expression \"%s\".", match);
+ g_warning(_("Error compiling regular expression \"%s\"."),
+ match);
return -1;
}
regex.tag = terminal->pvt->match_regexes->len;
GValueArray *params)
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
- g_warning("Got unexpected (key?) sequence `%s'.\n",
+ g_warning(_("Got unexpected (key?) sequence `%s'."),
match ? match : "???");
}
/* FIXME: find why this can happen, and stop it. */
if (columns < 0) {
- g_warning("Character %5ld is %d columns wide, guessing 1.\n",
+ g_warning(_("Character %5ld is %d columns wide, guessing 1."),
c, columns);
columns = 1;
}
/* Let the handler handle it. */
handler(terminal, match_s, match, params);
} else {
- g_warning("No handler for control sequence `%s' defined.\n",
+ g_warning(_("No handler for control sequence `%s' defined."),
match_s);
}
}
}
/* Be conservative about discarding data. */
- g_warning("Invalid multibyte sequence detected. Munging up %d bytes of data.", end - start);
+ g_warning(_("Invalid multibyte sequence detected. Munging up %d bytes of data."), end - start);
/* Remove the offending bytes. */
for (i = start; i < end; i++) {
#ifdef VTE_DEBUG
leave_open = TRUE;
break;
default:
- g_warning("Error reading from child: "
- "%s.\n", strerror(errno));
+ g_warning(_("Error reading from child: "
+ "%s."), strerror(errno));
leave_open = TRUE;
break;
}
obuf = obufptr = g_malloc0(ocount);
if (g_iconv(*conv, &ibuf, &icount, &obuf, &ocount) == -1) {
- g_warning("Error (%s) converting data for child, dropping.\n",
+ g_warning(_("Error (%s) converting data for child, dropping."),
strerror(errno));
} else {
n_outgoing = terminal->pvt->n_outgoing + (obuf - obufptr);
charsets = tmp;
tmp = NULL;
}
- g_warning("Warning: using fontset \"%s\", which is missing "
- "these character sets: %s.\n", font, charsets);
+ g_warning(_("Warning: using fontset \"%s\", which is missing "
+ "these character sets: %s."), font, charsets);
g_free(charsets);
}
}
if (new_font == NULL) {
name = vte_unparse_xft_pattern(matched_pattern);
- g_warning("Failed to load Xft font pattern \"%s\", "
- "falling back to default font.", name);
+ g_warning(_("Failed to load Xft font pattern \"%s\", "
+ "falling back to default font."), name);
free(name);
/* Try to use the default font. */
0);
}
if (new_font == NULL) {
- g_warning("Failed to load default Xft font.");
+ g_warning(_("Failed to load default Xft font."));
}
g_assert (pattern != new_font->pattern);
strlen(VTE_REPRESENTATIVE_CHARACTERS));
/* width = terminal->pvt->ftfont->max_advance_width; */
} else {
- g_warning("Error allocating Xft font, disabling Xft.");
+ g_warning(_("Error allocating Xft font, disabling Xft."));
terminal->pvt->use_xft = FALSE;
}
}
vte_terminal_font_complain(xlfds, missing_charset_list,
missing_charset_count);
} else {
- g_warning("Failed to load font set \"%s\", "
- "falling back to default font.", xlfds);
+ g_warning(_("Failed to load font set \"%s\", "
+ "falling back to default font."), xlfds);
if (missing_charset_list != NULL) {
XFreeStringList(missing_charset_list);
missing_charset_list = NULL;
&missing_charset_count,
&def_string);
if (terminal->pvt->fontset == NULL) {
- g_warning("Failed to load default font, "
- "crashing or behaving abnormally.\n");
+ g_warning(_("Failed to load default font, "
+ "crashing or behaving abnormally."));
} else {
vte_terminal_font_complain(xlfds,
missing_charset_list,
if (terminal->pvt->pty_master != -1) {
/* Use an ioctl to read the size of the terminal. */
if (ioctl(terminal->pvt->pty_master, TIOCGWINSZ, &size) != 0) {
- g_warning("Error reading PTY size, using defaults: "
- "%s.", strerror(errno));
+ g_warning(_("Error reading PTY size, using defaults: "
+ "%s."), strerror(errno));
} else {
terminal->row_count = size.ws_row;
terminal->column_count = size.ws_col;
size.ws_col = columns;
/* Try to set the terminal size. */
if (ioctl(terminal->pvt->pty_master, TIOCSWINSZ, &size) != 0) {
- g_warning("Error setting PTY size: %s.",
- strerror(errno));
+ g_warning(_("Error setting PTY size: %s."),
+ strerror(errno));
}
} else {
terminal->row_count = rows;
layout = terminal->pvt->layout;
if (layout == NULL) {
- g_warning("Error allocating layout, disabling Pango.");
+ g_warning(_("Error allocating layout, disabling Pango."));
terminal->pvt->use_pango = FALSE;
}
}
if (terminal->pvt->use_xft) {
ftdraw = XftDrawCreate(display, drawable, visual, colormap);
if (ftdraw == NULL) {
- g_warning("Error allocating draw, disabling Xft.");
+ g_warning(_("Error allocating draw, disabling Xft."));
terminal->pvt->use_xft = FALSE;
}
}
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
+ bindtextdomain(PACKAGE, LOCALEDIR);
+
gobject_class = G_OBJECT_CLASS(klass);
widget_class = GTK_WIDGET_CLASS(klass);
conv = g_iconv_open("WCHAR_T", "UTF-8");
if (conv == NULL) {
/* Aaargh. We're screwed. */
- g_warning("g_iconv_open() failed setting word characters");
+ g_warning(_("g_iconv_open() failed setting word characters"));
return;
}
ilen = strlen(spec);
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef vte_h_included
-#define vte_h_included
+#ifndef vte_vte_h_included
+#define vte_vte_h_included
#ident "$Id$"
#include "vte.h"
#include "vteaccess.h"
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#else
+#define bindtextdomain(package,dir)
+#endif
+
#define VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA "VteTerminalAccessiblePrivateData"
typedef struct _VteTerminalAccessiblePrivate {
gboolean snapshot_invalid; /* This data needs to be refreshed. */
{
GObjectClass *gobject_class;
+ bindtextdomain(PACKAGE, LOCALEDIR);
+
gobject_class = G_OBJECT_CLASS(klass);
/* Override the finalize method. */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef vteaccess_h_included
-#define vteaccess_h_included
+#ifndef vte_vteaccess_h_included
+#define vte_vteaccess_h_included
#ident "$Id$"