OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 #include "PluginStdAfx.h" | 18 #include "PluginStdAfx.h" |
19 #include "PluginSystem.h" | 19 #include "PluginSystem.h" |
20 #include "PluginClient.h" | 20 #include "PluginClientBase.h" |
21 #include <array> | 21 #include <array> |
22 | 22 |
23 std::wstring GetBrowserLanguage() | 23 std::wstring GetBrowserLanguage() |
24 { | 24 { |
25 LANGID lcid = GetUserDefaultLangID(); | 25 LANGID lcid = GetUserDefaultLangID(); |
26 std::wstring lang; | 26 std::wstring lang; |
27 // According to http://msdn.microsoft.com/en-us/library/windows/desktop/dd3738
48(v=vs.85).aspx | 27 // According to http://msdn.microsoft.com/en-us/library/windows/desktop/dd3738
48(v=vs.85).aspx |
28 // The maximum number of characters allowed for this string is nine, including
a terminating null character. | 28 // The maximum number of characters allowed for this string is nine, including
a terminating null character. |
29 { | 29 { |
30 std::array<wchar_t, 9> localeLanguage; | 30 std::array<wchar_t, 9> localeLanguage; |
(...skipping 15 matching lines...) Expand all Loading... |
46 { | 46 { |
47 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSIN
FO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); | 47 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSIN
FO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); |
48 } | 48 } |
49 else | 49 else |
50 { | 50 { |
51 lang += localeCountry.data(); | 51 lang += localeCountry.data(); |
52 } | 52 } |
53 } | 53 } |
54 return lang; | 54 return lang; |
55 } | 55 } |
OLD | NEW |