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

Unified Diff: Shared/PluginClientBase.cpp

Issue 9843129: Always use the system language for the UI (Closed)
Patch Set: Created March 22, 2013, 2:59 p.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 | « no previous file | Shared/PluginUserSettings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Shared/PluginClientBase.cpp
===================================================================
--- a/Shared/PluginClientBase.cpp
+++ b/Shared/PluginClientBase.cpp
@@ -89,33 +89,18 @@
void CPluginClientBase::SetLocalization()
{
- CPluginDictionary* dic = CPluginDictionary::GetInstance();
-
CPluginSystem* system = CPluginSystem::GetInstance();
-
CString browserLanguage = system->GetBrowserLanguage();
+ CPluginDictionary* dic = CPluginDictionary::GetInstance();
+ dic->SetLanguage(browserLanguage);
+
CPluginSettings* settings = CPluginSettings::GetInstance();
-
- if (settings->IsMainProcess() && settings->IsMainThread())
+ if (settings->IsMainProcess() && settings->IsMainThread() && !settings->Has(SETTING_LANGUAGE))
{
- if (browserLanguage != settings->GetString(SETTING_LANGUAGE))
- {
- if (dic->IsLanguageSupported(browserLanguage))
- {
- // settings->SetString(SETTING_LANGUAGE, browserLanguage);
- }
- }
-
- if (!settings->Has(SETTING_LANGUAGE))
- {
- settings->SetString(SETTING_LANGUAGE, "en");
- }
-
+ settings->SetString(SETTING_LANGUAGE, browserLanguage);
Oleksandr 2013/03/22 16:04:14 What if we don't have the browser's version in the
Felix Dahlke 2013/03/22 16:09:18 Hehe, I've wondered quite a bit about this actuall
Oleksandr 2013/03/22 16:15:28 It isn't related, but it's not like we can have on
settings->Write();
}
-
- dic->SetLanguage(settings->GetString(SETTING_LANGUAGE));
}
« no previous file with comments | « no previous file | Shared/PluginUserSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld