intl.c revision 96489
1/* Message translation utilities. 2 Copyright (C) 2001 Free Software Foundation, Inc. 3 4This file is part of GCC. 5 6GCC is free software; you can redistribute it and/or modify it under 7the terms of the GNU General Public License as published by the Free 8Software Foundation; either version 2, or (at your option) any later 9version. 10 11GCC is distributed in the hope that it will be useful, but WITHOUT ANY 12WARRANTY; without even the implied warranty of MERCHANTABILITY or 13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14for more details. 15 16You should have received a copy of the GNU General Public License 17along with GCC; see the file COPYING. If not, write to the Free 18Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1902111-1307, USA. */ 20 21#include "config.h" 22#include "system.h" 23#include "intl.h" 24 25#ifdef ENABLE_NLS 26 27/* Initialize the translation library for GCC. This performs the 28 appropriate sequence of calls - setlocale, bindtextdomain, 29 textdomain. LC_CTYPE determines the character set used by the 30 terminal, so it has be set to output messages correctly. */ 31 32void 33gcc_init_libintl () 34{ 35#ifdef HAVE_LC_MESSAGES 36 setlocale (LC_CTYPE, ""); 37 setlocale (LC_MESSAGES, ""); 38#else 39 setlocale (LC_ALL, ""); 40#endif 41 42 (void) bindtextdomain ("gcc", LOCALEDIR); 43 (void) textdomain ("gcc"); 44} 45 46#endif 47