diff options
author | idana@chromium.org <idana@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 20:05:07 +0000 |
---|---|---|
committer | idana@chromium.org <idana@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 20:05:07 +0000 |
commit | 7ec7b442ebfb19101cde295a35342c56530558cd (patch) | |
tree | 66ed73addbf2bc261152747f30e0e0063f3aab4e /chrome/browser/sync | |
parent | 08ccead5e716d672110f94d3f336708c1f15fbe1 (diff) | |
download | chromium_src-7ec7b442ebfb19101cde295a35342c56530558cd.zip chromium_src-7ec7b442ebfb19101cde295a35342c56530558cd.tar.gz chromium_src-7ec7b442ebfb19101cde295a35342c56530558cd.tar.bz2 |
Removed personalization_strings.h and moved all the strings into generated_resources.grd.
I'll take care of the Setup Wizard strings/resources in my next patch.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/173069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/personalization_strings.h | 74 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 7 | ||||
-rw-r--r-- | chrome/browser/sync/sync_status_ui_helper.cc | 39 |
3 files changed, 26 insertions, 94 deletions
diff --git a/chrome/browser/sync/personalization_strings.h b/chrome/browser/sync/personalization_strings.h deleted file mode 100644 index 08204a0..0000000 --- a/chrome/browser/sync/personalization_strings.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Contains all string resources usec by the personalization module. - -// TODO(munjal): This file should go away once the personalization module -// becomes public. At that point, we have to put all the strings below in the -// generated resources file. - -#ifdef CHROME_PERSONALIZATION - -// TODO(timsteele): Rename this file; 'personalization' is deprecated. -#ifndef CHROME_BROWSER_SYNC_PERSONALIZATION_STRINGS_H_ -#define CHROME_BROWSER_SYNC_PERSONALIZATION_STRINGS_H_ - -// Options dialog strings. -static const wchar_t kSyncGroupName[] = L"Bookmark Sync:"; -static const wchar_t kSyncNotSetupInfo[] = - L"You are not set up to sync your bookmarks with your other computers."; -static const wchar_t kStartSyncButtonLabel[] = L"Synchronize my bookmarks..."; -static const wchar_t kSyncAccountLabel[] = L"Synced to "; -static const wchar_t kLastSyncedLabel[] = L"Last synced: "; -static const wchar_t kSyncCredentialsNeededLabel[] = - L"Account login details are not yet entered."; -static const wchar_t kSyncAuthenticatingLabel[] = L"Authenticating..."; -static const wchar_t kSyncInvalidCredentialsError[] = - L"Invalid user name or password."; -static const wchar_t kSyncOtherLoginErrorLabel[] = - L"Error signing in."; -static const wchar_t kSyncExpiredCredentialsError[] = - L"Login details are out of date."; -static const wchar_t kSyncServerNotReachableError[] = - L"Sync server is not reachable. Retrying..."; -static const wchar_t kSyncReLoginLinkLabel[] = L"Login again"; -static const wchar_t kStopSyncButtonLabel[] = L"Stop syncing this account"; - -// Sync status messages. -static const wchar_t kLastSyncedTimeNever[] = L"Never."; -static const wchar_t kLastSyncedTimeWithinLastMinute[] = L"Just now."; - -// Various strings for the new tab page personalization. -static const char kSyncSectionTitle[] = "Bookmark Sync"; -static const char kSyncErrorSectionTitle[] = "Bookmark Sync Error!"; -static const char kSyncPromotionMsg[] = - "You can sync your bookmarks across computers using your Google account."; -static const wchar_t kSyncServerUnavailableMsg[] = - L"Google Chrome could not sync your bookmarks because it could not connect " - L"to the sync server. Retrying..."; -static const char kStartNowLinkText[] = "Start now"; -static const char kSettingUpText[] = "Setup in progress..."; - -// TODO(idana): when we get rid of this file and move all the strings into -// generated_resources.grd, we should probably move these into a pref of some -// sort to allow third party sync providers to control which URL to use for the -// sync web UI. We should also make it possible for the sync provider to hide -// the link altogether if they don't provide web UI for their users. -static const char kSyncViewOnlineLinkUrl[] = "http://docs.google.com"; -static const char kSyncViewOnlineLinkLabel[] = "View in Google Docs"; - -// Sync menu item strings. -static const wchar_t kMenuLabelStartSync[] = L"Sync my bookmarks..."; - -// Login dialog strings. -static const wchar_t kLoginDialogTitle[] = L"Sync my bookmarks"; - -// Bookmark bar strings. -static const wchar_t kBookmarkBarSyncErrorButtonText[] = L"Sync Error"; -static const wchar_t kBookmarkBarErrorTooltip[] = - L"Your login details are out of date. Click to re-enter your password."; - -#endif // CHROME_BROWSER_SYNC_PERSONALIZATION_STRINGS_H_ - -#endif // CHROME_PERSONALIZATION diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 0690273..9eb2acc 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -8,6 +8,7 @@ #include <stack> #include <vector> +#include "app/l10n_util.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/file_path.h" @@ -22,13 +23,13 @@ #include "chrome/browser/history/history_types.h" #include "chrome/browser/profile.h" #include "chrome/browser/sync/engine/syncapi.h" -#include "chrome/browser/sync/personalization_strings.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/time_format.h" +#include "grit/generated_resources.h" #include "views/window/window.h" using browser_sync::ChangeProcessor; @@ -308,12 +309,12 @@ std::wstring ProfileSyncService::BuildSyncStatusSummaryText( std::wstring ProfileSyncService::GetLastSyncedTimeString() const { if (last_synced_time_.is_null()) - return kLastSyncedTimeNever; + return l10n_util::GetString(IDS_SYNC_TIME_NEVER); base::TimeDelta last_synced = base::Time::Now() - last_synced_time_; if (last_synced < base::TimeDelta::FromMinutes(1)) - return kLastSyncedTimeWithinLastMinute; + return l10n_util::GetString(IDS_SYNC_TIME_JUST_NOW); return TimeFormat::TimeElapsed(last_synced); } diff --git a/chrome/browser/sync/sync_status_ui_helper.cc b/chrome/browser/sync/sync_status_ui_helper.cc index d16068f..0e7f721 100644 --- a/chrome/browser/sync/sync_status_ui_helper.cc +++ b/chrome/browser/sync/sync_status_ui_helper.cc @@ -6,10 +6,12 @@ #include "chrome/browser/sync/sync_status_ui_helper.h" +#include "app/l10n_util.h" #include "base/string_util.h" #include "chrome/browser/sync/auth_error_state.h" -#include "chrome/browser/sync/personalization_strings.h" #include "chrome/browser/sync/profile_sync_service.h" +#include "grit/chromium_strings.h" +#include "grit/generated_resources.h" // Given an authentication state, this helper function returns the appropriate // status message and, if necessary, the text that should appear in the @@ -18,23 +20,27 @@ static void GetLabelsForAuthError(AuthErrorState auth_error, ProfileSyncService* service, std::wstring* status_label, std::wstring* link_label) { if (link_label) - link_label->assign(kSyncReLoginLinkLabel); + link_label->assign(l10n_util::GetString(IDS_SYNC_RELOGIN_LINK_LABEL)); if (auth_error == AUTH_ERROR_INVALID_GAIA_CREDENTIALS) { // If the user name is empty then the first login failed, otherwise the // credentials are out-of-date. if (service->GetAuthenticatedUsername().empty()) - status_label->append(kSyncInvalidCredentialsError); + status_label->assign( + l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS)); else - status_label->append(kSyncExpiredCredentialsError); + status_label->assign( + l10n_util::GetString(IDS_SYNC_LOGIN_INFO_OUT_OF_DATE)); } else if (auth_error == AUTH_ERROR_CONNECTION_FAILED) { // Note that there is little the user can do if the server is not // reachable. Since attempting to re-connect is done automatically by // the Syncer, we do not show the (re)login link. - status_label->append(kSyncServerUnavailableMsg); + status_label->assign( + l10n_util::GetStringF(IDS_SYNC_SERVER_IS_UNREACHABLE, + l10n_util::GetString(IDS_PRODUCT_NAME))); if (link_label) link_label->clear(); } else { - status_label->append(kSyncOtherLoginErrorLabel); + status_label->assign(l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); } } @@ -47,12 +53,8 @@ static std::wstring GetSyncedStateStatusLabel(ProfileSyncService* service) { if (user_name.empty()) return label; - label += kSyncAccountLabel; - label += user_name; - label += L"\n"; - label += kLastSyncedLabel; - label += service->GetLastSyncedTimeString(); - return label; + return l10n_util::GetStringF(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, + user_name, service->GetLastSyncedTimeString()); } // static @@ -72,7 +74,7 @@ SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( status_label->assign(GetSyncedStateStatusLabel(service)); DCHECK_EQ(auth_error, AUTH_ERROR_NONE); } else if (service->UIShouldDepictAuthInProgress()) { - status_label->assign(kSyncAuthenticatingLabel); + status_label->assign(l10n_util::GetString(IDS_SYNC_AUTHENTICATING_LABEL)); result_type = PRE_SYNCED; } else if (auth_error != AUTH_ERROR_NONE) { GetLabelsForAuthError(auth_error, service, status_label, link_label); @@ -85,18 +87,21 @@ SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( if (service->SetupInProgress()) { ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); AuthErrorState auth_error(service->GetAuthErrorState()); - status_label->assign(UTF8ToWide(kSettingUpText)); + status_label->assign( + l10n_util::GetString(IDS_SYNC_NTP_SETUP_IN_PROGRESS)); if (service->UIShouldDepictAuthInProgress()) { - status_label->assign(kSyncAuthenticatingLabel); + status_label->assign( + l10n_util::GetString(IDS_SYNC_AUTHENTICATING_LABEL)); } else if (auth_error != AUTH_ERROR_NONE) { status_label->clear(); GetLabelsForAuthError(auth_error, service, status_label, NULL); result_type = SYNC_ERROR; } else if (!status.authenticated) { - status_label->assign(kSyncCredentialsNeededLabel); + status_label->assign( + l10n_util::GetString(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED)); } } else { - status_label->assign(kSyncNotSetupInfo); + status_label->assign(l10n_util::GetString(IDS_SYNC_NOT_SET_UP_INFO)); } } return result_type; |