intl.c revision 90075
1178825Sdfr/* Message translation utilities.
2233294Sstas   Copyright (C) 2001 Free Software Foundation, Inc.
3233294Sstas
4233294SstasThis file is part of GCC.
5178825Sdfr
6233294SstasGCC is free software; you can redistribute it and/or modify it under
7233294Sstasthe terms of the GNU General Public License as published by the Free
8233294SstasSoftware Foundation; either version 2, or (at your option) any later
9178825Sdfrversion.
10233294Sstas
11233294SstasGCC is distributed in the hope that it will be useful, but WITHOUT ANY
12178825SdfrWARRANTY; without even the implied warranty of MERCHANTABILITY or
13233294SstasFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14233294Sstasfor more details.
15233294Sstas
16178825SdfrYou should have received a copy of the GNU General Public License
17233294Sstasalong with GCC; see the file COPYING.  If not, write to the Free
18233294SstasSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA
19233294Sstas02111-1307, USA.  */
20178825Sdfr
21233294Sstas#include "config.h"
22233294Sstas#include "system.h"
23233294Sstas#include "intl.h"
24233294Sstas
25233294Sstas#ifdef ENABLE_NLS
26233294Sstas
27233294Sstas/* Initialize the translation library for GCC.  This performs the
28233294Sstas   appropriate sequence of calls - setlocale, bindtextdomain,
29233294Sstas   textdomain.  LC_CTYPE determines the character set used by the
30233294Sstas   terminal, so it has be set to output messages correctly.  */
31233294Sstas
32178825Sdfrvoid
33178825Sdfrgcc_init_libintl ()
34233294Sstas{
35178825Sdfr#ifdef HAVE_LC_MESSAGES
36233294Sstas  setlocale (LC_CTYPE, "");
37178825Sdfr  setlocale (LC_MESSAGES, "");
38178825Sdfr#else
39178825Sdfr  setlocale (LC_ALL, "");
40178825Sdfr#endif
41178825Sdfr
42178825Sdfr  (void) bindtextdomain ("gcc", LOCALEDIR);
43178825Sdfr  (void) textdomain ("gcc");
44178825Sdfr}
45178825Sdfr
46178825Sdfr#endif
47178825Sdfr