Blender  V2.93
BLT_lang.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /* Search the path directory to the locale files, this try all
31  * the case for Linux, Win and Mac.
32  * Also dynamically builds locales and locales' menu from "languages" text file.
33  */
34 void BLT_lang_init(void);
35 
36 /* Free languages and locales_menu arrays created by BLT_lang_init. */
37 void BLT_lang_free(void);
38 
39 /* Set the current locale. */
40 void BLT_lang_set(const char *);
41 /* Get the current locale ([partial] ISO code, e.g. es_ES). */
42 const char *BLT_lang_get(void);
43 
44 /* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g.
45  * if there is no variant, *variant and *language_variant will always be NULL).
46  * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
47  * NOTE: Always available, even in non-WITH_INTERNATIONAL builds.
48  */
49 void BLT_lang_locale_explode(const char *locale,
50  char **language,
51  char **country,
52  char **variant,
53  char **language_country,
54  char **language_variant);
55 
56 /* Get EnumPropertyItem's for translations menu. */
58 
59 #ifdef __cplusplus
60 };
61 #endif
void BLT_lang_locale_explode(const char *locale, char **language, char **country, char **variant, char **language_country, char **language_variant)
Definition: blt_lang.c:318
const char * BLT_lang_get(void)
Definition: blt_lang.c:289
void BLT_lang_free(void)
Definition: blt_lang.c:243
struct EnumPropertyItem * BLT_lang_RNA_enum_properties(void)
Definition: blt_lang.c:189
void BLT_lang_init(void)
Definition: blt_lang.c:198
void BLT_lang_set(const char *)
Definition: blt_lang.c:257