1 /* 2 * i18n.c - internationalization support for Speech-dispatcher 3 * 4 * Copyright (C) 2010 Brailcom, o.p.s. 5 * 6 * This is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2, or (at your option) 9 * any later version. 10 * 11 * This software is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <https://www.gnu.org/licenses/>. 18 * 19 */ 20 21 #if HAVE_CONFIG_H 22 #include <config.h> 23 #endif 24 25 #include <i18n.h> 26 #include <locale.h> /* For setlocale. */ 27 #include <stdio.h> 28 #include <stdlib.h> 29 i18n_init(void)30void i18n_init(void) 31 { 32 if (setlocale(LC_ALL, "") == NULL) { 33 perror("setlocale"); 34 exit(1); 35 } 36 37 if (bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR) == NULL) { 38 perror("bindtextdomain"); 39 exit(1); 40 } 41 42 if (textdomain(GETTEXT_PACKAGE) == NULL) { 43 perror("textdomain"); 44 exit(1); 45 } 46 } 47