MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / setLanguageFromLCID

Method setLanguageFromLCID

astyle/src/ASLocalizer.cpp:155–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153};
154
155void ASLocalizer::setLanguageFromLCID(size_t lcid)
156// Windows get the language to use from the user locale.
157// NOTE: GetUserDefaultLocaleName() gets nearly the same name as Linux.
158// But it needs Windows Vista or higher.
159// Same with LCIDToLocaleName().
160{
161 m_lcid = lcid;
162 m_langID == "en"; // default to english
163
164 size_t lang = PRIMARYLANGID(LANGIDFROMLCID(m_lcid));
165 size_t sublang = SUBLANGID(LANGIDFROMLCID(m_lcid));
166 // find language in the wlc table
167 size_t count = sizeof(wlc) / sizeof(wlc[0]);
168 for (size_t i = 0; i < count; i++ )
169 {
170 if (wlc[i].winLang == lang)
171 {
172 m_langID = wlc[i].canonicalLang;
173 break;
174 }
175 }
176 if (m_langID == "zh")
177 {
178 if (sublang == SUBLANG_CHINESE_SIMPLIFIED || sublang == SUBLANG_CHINESE_SINGAPORE)
179 m_subLangID = "CHS";
180 else
181 m_subLangID = "CHT"; // default
182 }
183 setTranslationClass();
184}
185
186#endif // _win32
187

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected