MCPcopy Create free account
hub / github.com/KDE/kdevelop / ASLocalizer

Method ASLocalizer

plugins/astyle/3rdparty/libastyle/ASLocalizer.cpp:84–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82//----------------------------------------------------------------------------
83
84ASLocalizer::ASLocalizer()
85// Set the locale information.
86{
87 // set language default values to english (ascii)
88 // this will be used if a locale or a language cannot be found
89 m_localeName = "UNKNOWN";
90 m_langID = "en";
91 m_lcid = 0;
92 m_subLangID.clear();
93 m_translation = nullptr;
94
95 // Not all compilers support the C++ function locale::global(locale(""));
96 char* localeName = setlocale(LC_ALL, "");
97 if (localeName == nullptr) // use the english (ascii) defaults
98 {
99 fprintf(stderr, "\n%s\n\n", "Cannot set native locale, reverting to English");
100 setTranslationClass();
101 return;
102 }
103 // set the class variables
104#ifdef _WIN32
105 size_t lcid = GetUserDefaultLCID();
106 setLanguageFromLCID(lcid);
107#else
108 setLanguageFromName(localeName);
109#endif
110}
111
112ASLocalizer::~ASLocalizer()
113// Delete dynamically allocated memory.

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected