PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llfindlocale.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 60 lines | 21 code | 7 blank | 32 comment | 0 complexity | fc31421c986ba9d7cf0654bb66d84e55 MD5 | raw file
 1/** 
 2 * @file llfindlocale.h
 3 * @brief Detect system language setting
 4 *
 5 * $LicenseInfo:firstyear=2008&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef __findlocale_h_
28#define __findlocale_h_
29
30typedef const char* FL_Lang;
31typedef const char* FL_Country;
32typedef const char* FL_Variant;
33
34struct FL_Locale {
35  FL_Lang    lang;
36  FL_Country country;
37  FL_Variant variant;
38};
39
40typedef enum {
41  /* for some reason we failed to even guess: this should never happen */
42  FL_FAILED        = 0,
43  /* couldn't query locale -- returning a guess (almost always English) */
44  FL_DEFAULT_GUESS = 1,
45  /* the returned locale type was found by successfully asking the system */
46  FL_CONFIDENT     = 2
47} FL_Success;
48
49typedef enum {
50  FL_MESSAGES = 0
51} FL_Domain;
52
53/* This allocates/fills in a FL_Locale structure with pointers to
54   strings (which should be treated as static), or NULL for inappropriate /
55   undetected fields. */
56LL_COMMON_API FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain);
57/* This should be used to free the struct written by FL_FindLocale */
58LL_COMMON_API void FL_FreeLocale(FL_Locale **locale);
59
60#endif /*__findlocale_h_*/