BLT_lang.h 2.2 KB

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