PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 7ms 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
Possible License(s): LGPL-2.1
  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. #ifndef __findlocale_h_
  27. #define __findlocale_h_
  28. typedef const char* FL_Lang;
  29. typedef const char* FL_Country;
  30. typedef const char* FL_Variant;
  31. struct FL_Locale {
  32. FL_Lang lang;
  33. FL_Country country;
  34. FL_Variant variant;
  35. };
  36. typedef enum {
  37. /* for some reason we failed to even guess: this should never happen */
  38. FL_FAILED = 0,
  39. /* couldn't query locale -- returning a guess (almost always English) */
  40. FL_DEFAULT_GUESS = 1,
  41. /* the returned locale type was found by successfully asking the system */
  42. FL_CONFIDENT = 2
  43. } FL_Success;
  44. typedef enum {
  45. FL_MESSAGES = 0
  46. } FL_Domain;
  47. /* This allocates/fills in a FL_Locale structure with pointers to
  48. strings (which should be treated as static), or NULL for inappropriate /
  49. undetected fields. */
  50. LL_COMMON_API FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain);
  51. /* This should be used to free the struct written by FL_FindLocale */
  52. LL_COMMON_API void FL_FreeLocale(FL_Locale **locale);
  53. #endif /*__findlocale_h_*/