1 /*
2  * Information about natural languages, in particular if the language
3  * has spaces between words.
4  *
5  * Copyright © 1994-2012 World Wide Web Consortium
6  * See http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
7  *
8  * Created 9 May 1998
9  * Bert Bos <bert@w3.org>
10  * $Id: langinfo.c,v 1.2 2019/10/05 23:25:46 bbos Exp $
11  */
12 #include "config.h"
13 #ifdef HAVE_STRING_H
14 #  include <string.h>
15 #elif HAVE_STRINGS_H
16 #  include <strings.h>
17 #endif
18 #include <assert.h>
19 #include <stdbool.h>
20 #include "export.h"
21 #include "types.e"
22 
23 
24 /* with_spaces -- return true if the language has spaces between words */
with_spaces(const conststring lang)25 EXPORT bool with_spaces(const conststring lang)
26 {
27   if (!lang) return true;	/* Default is with spaces */
28   if (eq(lang, "ja") || hasprefix(lang, "ja-")) return false; /* Japanese */
29   if (eq(lang, "zh") || hasprefix(lang, "zh-")) return false; /* Chinese */
30   if (eq(lang, "ko") || hasprefix(lang, "ko-")) return false; /* Korean */
31   if (eq(lang, "km") || hasprefix(lang, "km-")) return false; /* Khmer */
32   if (eq(lang, "th") || hasprefix(lang, "th-")) return false; /* Thai */
33 #if 0
34   if (eq(lang, "lo") || hasprefix(lang, "lo-")) return false; /* Lao */
35   if (eq(lang, "my") || hasprefix(lang, "my-")) return false; /* Myanmar */
36 #endif
37   return true;			/* Other languages are with spaces */
38 }
39