Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: Shared/PluginSystem.cpp

Issue 9451102: Filterlists downloads changes (Closed)
Patch Set: Created Feb. 28, 2013, 10:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Shared/PluginSettings.cpp ('k') | Shared/PluginUserSettings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Shared/PluginSystem.cpp
===================================================================
--- a/Shared/PluginSystem.cpp
+++ b/Shared/PluginSystem.cpp
@@ -61,12 +61,15 @@
CString CPluginSystem::GetBrowserLanguage() const
{
- CString browserLanguage;
-
LANGID lcid = ::GetUserDefaultLangID();
TCHAR language[128];
memset(language, 0, sizeof(language));
+ TCHAR country[128];
+ memset(language, 0, sizeof(country));
+
+ CString lang;
+
int res = ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, language, 127);
if (res == 0)
{
@@ -74,10 +77,23 @@
}
else
{
- browserLanguage = language;
+ lang.Append(language);
}
- return browserLanguage;
+ lang.Append(L"-");
+
+
+ res = ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, country, 127);
+ if (res == 0)
+ {
+ DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country");
+ }
+ else
+ {
+ lang.Append(country);
+ }
+
+ return lang;
}
« no previous file with comments | « Shared/PluginSettings.cpp ('k') | Shared/PluginUserSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld