From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8758 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Internationalization Date: 12 Nov 1996 23:07:03 +0100 Sender: larsi@proletcult.ifi.uio.no Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035148882 14210 80.91.224.250 (20 Oct 2002 21:21:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:21:22 +0000 (UTC) Cc: Forum of ding/Gnus users , Ulrich Drepper Return-Path: Original-Received: (qmail 7228 invoked from smtpd); 12 Nov 1996 23:37:32 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 12 Nov 1996 23:37:27 -0000 Original-Received: from proletcult.ifi.uio.no (root@ppp19.larris.ifi.uio.no [129.240.68.119]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id ; Wed, 13 Nov 1996 00:00:42 +0100 Original-Received: (from larsi@localhost) by proletcult.ifi.uio.no (8.8.2/8.8.2) id XAA11656; Tue, 12 Nov 1996 23:07:06 +0100 Original-To: pinard@iro.umontreal.ca In-Reply-To: pinard@progiciels-bpi.ca's message of (unknown date) Original-Lines: 123 X-Face: &w!^oO~dS|}-P0~ge{$c!h\ + + DEFUN ("get-text", Fget_text, Sget_text, 1, 1, "sTranslate string: ", + "Translate STRING using gettext.") + (string) + Lisp_Object string; + { + char *trans; + CHECK_STRING (string, 0); + + #ifdef USE_GETTEXT + trans = gettext (XSTRING (string)->data); + return make_string (trans, strlen(trans)); + #else + return string; + #endif + + } + + DEFUN ("set-text-domain", Fset_text_domain, Sset_text_domain, 1, 1, 0, + "Set the current translation domain to STRING.") + (string) + Lisp_Object string; + { + CHECK_STRING (string, 0); + + #ifdef USE_GETTEXT + textdomain (XSTRING (string)->data); + return Qt; + #else + return Qnil; + #endif + + } + + DEFUN ("get-text-domain", Fget_text_domain, Sget_text_domain, 0, 0, 0, + "Return the current translation domain.") + () + { + char *domain; + #ifdef USE_GETTEXT + domain = textdomain (NULL); + return make_string (domain, strlen (domain)); + #else + return Qnil; + #endif + + } + + DEFUN ("set-text-directory", Fset_text_directory, Sset_text_directory, 1, 1, 0, + "Set the current translation directory to STRING.") + (string) + Lisp_Object string; + { + CHECK_STRING (string, 0); + + #ifdef USE_GETTEXT + bindtextdomain (textdomain (NULL), XSTRING (string)->data); + return Qt; + #else + return Qnil; + #endif + + } + + DEFUN ("get-text-directory", Fget_text_directory, Sget_text_directory, 0, 0, 0, + "Return the current translation directory.") + () + { + char *dir; + #ifdef USE_GETTEXT + if (dir = bindtextdomain (textdomain (NULL), NULL)) + return make_string (dir, strlen (dir)); + else + return Qnil; + #else + return Qnil; + #endif + + } + + + void syms_of_editfns () { *************** *** 2558,2561 **** --- 2643,2652 ---- defsubr (&Snarrow_to_region); defsubr (&Ssave_restriction); defsubr (&Stranspose_regions); + + defsubr (&Sget_text); + defsubr (&Sget_text_domain); + defsubr (&Sset_text_domain); + defsubr (&Sget_text_directory); + defsubr (&Sset_text_directory); } -- (domestic pets only, the antidote for overdose, milk.) larsi@ifi.uio.no * Lars Ingebrigtsen