/* $NoKeywords: $ */ /* // // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved. // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert // McNeel & Associates. // // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF // MERCHANTABILITY ARE HEREBY DISCLAIMED. // // For complete openNURBS copyright information see . // //////////////////////////////////////////////////////////////// */ #if !defined(OPENNURBS_LOCALE_INC_) #define OPENNURBS_LOCALE_INC_ typedef #if defined(ON_RUNTIME_WIN) _locale_t #elif defined(ON_RUNTIME_APPLE) locale_t #elif defined(ON_RUNTIME_ANDROID) locale_t #else ON__UINT_PTR #endif ON_CRT_locale_t; class ON_CLASS ON_Locale { public: enum WindowsLCID : unsigned int { OrdinalLCID = 0, // not a real Windows LCID InvariantCultureLCID = 0x0027, // 39 decimal // Windows LCID for languages Rhino supports // "cs-CZ" Czech, ???? script implied cs_CZ_LCID = 0x0405, //1029 decimal // "de-DE" German, Germany, Latn script implied de_DE_LCID = 0x0407, // 1031 decimal // "en-US" English, US, Latn script implied en_US_LCID = 0x0409, // 1033 decimal // "en-CA" English, Canada, Latn script implied en_CA_LCID = 0x1009, // 4105 decimal // "es-ES_tradnl" Spanish, Spain, Latn script implied, traditional sort es_ES_tradnl_LCID = 0x040A, // 1034 decimal // "es-ES" Spanish, Spain, Latn script implied, modern sort es_ES_LCID = 0x0c0a, // 3082 decimal // "fr-FR" French, France, Latn script implied fr_FR_LCID = 0x040c, // 1036 decimal // "it-IT" Italian, Italy, Latn script implied it_IT_LCID = 0x0410, // 1040 decimal // "ja-JP" Japanese, Japan, ???? script implied ja_JP_LCID = 0x0411, // 1041 decimal // Korean, Republic of Korea, ???? script implied ko_KR_LCID = 0x0412, // 1042 decimal // Polish, Poland, ???? script implied pl_PL_LCID = 0x0415, // 1045 decimal // Portuguese, Portugal, Latn script implied pt_PT_LCID = 0x0816, // 2070 decimal // According to https://en.wikipedia.org/wiki/Chinese_language, Chinese is a family of language // varieties, often mutually unintelligible. Specifying both Script and REGION // (zh-Hans-CN or zh-Hant-TW) doesn't narrow things down nearly enough. // // Basically we have to hope the string collate and mapping functions supplied by the OS and // the translations supplied by our staff work well for our customers who select from the // two types of "Chinese" Rhino offers. // // Standard Chinese (Mandarin), Peoples Republic of China, Hans script implied (simplified characters) zh_CN_LCID = 0x0804, // 2052 decimal // Standard Chinese (Mandarin), Taiwan, Hant script implied (traditional characters) zh_TW_LCID = 0x0404 // 1028 decimal }; // The ordinal locale. // String compares use ordinal element values. // The decimal point is a period. static const ON_Locale Ordinal; // The invariant culture locale. // The decimal point is a period. static const ON_Locale InvariantCulture; private: static ON_Locale m_CurrentCulture; public: // Reference to ON_Locale::m_CurrentCulture. // The value is set by calling ON_Locale::SetCurrentCulture(); // The default is a copy of ON_Locale::Ordinal. static const ON_Locale& CurrentCulture; /* Description: Set the current culture locale Parameters: current_culture_locale - [in] */ static bool SetCurrentCulture( const ON_Locale& current_culture_locale ); // Default construction creates a copy of ON_Local::Ordinal ON_Locale() ON_NOEXCEPT; ~ON_Locale() = default; ON_Locale(const ON_Locale&) = default; ON_Locale& operator=(const ON_Locale&) = default; // Maximum buffer capacity for any ON_Locale functions // that return string information in a buffer. enum { BUFFER_MAXIMUM_CAPACITY = 128 }; /* Description: Get the language id. Parameters: buffer - [out] A null terminated string containing the language id is returned in this buffer. The string has the form: [-