summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:43:21 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:43:21 +0000
commit87727c2b30fc8c5d85c7656262ff77a3d495c8c8 (patch)
tree099596c47541c82f24b6aff993be08debd94280c
parent475dae86bdffadd6136bafe47f10963257e6987c (diff)
downloadchromium_src-87727c2b30fc8c5d85c7656262ff77a3d495c8c8.zip
chromium_src-87727c2b30fc8c5d85c7656262ff77a3d495c8c8.tar.gz
chromium_src-87727c2b30fc8c5d85c7656262ff77a3d495c8c8.tar.bz2
sync i18n support for gaia_login.html and merge_and_sync.htmlMove resources in generated_resources.grd.Move the google logo depending of the order of words in the translation of "Google Account"Add support for rtl locales
BUG=19896 TEST=Make sure the layout of gaia_login.html and merge_and_sync.html is correct in ltr and rtl Patch by Bruno Calvignac, http://codereview.chromium.org/195082. Review URL: http://codereview.chromium.org/244024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27426 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd67
-rw-r--r--chrome/browser/sync/resources/gaia_login.html93
-rw-r--r--chrome/browser/sync/resources/merge_and_sync.html30
-rw-r--r--chrome/browser/views/sync/sync_setup_flow.h2
-rw-r--r--chrome/browser/views/sync/sync_setup_wizard.cc64
-rw-r--r--chrome/browser/views/toolbar_view.cc2
6 files changed, 169 insertions, 89 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index dfad4ed2..cb52907 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -309,6 +309,9 @@ each locale. aa1 -->
<message name="IDS_LEARN_MORE" desc="Learn more text">
Learn more
</message>
+ <message name="IDS_ABORT" desc="Abort operation">
+ Abort
+ </message>
<!-- content area context menus -->
<if expr="not pp_ifdef('use_titlecase')">
@@ -5128,15 +5131,67 @@ Keep your key file in a safe place. You will need it to create new versions of y
View in Google Docs
</message>
- <!-- Sync menu item strings -->
- <message name="IDS_SYNC_MENU_LABEL" desc="Text to show in the menu item for bookmark sync.">
- Sync my bookmarks...
- </message>
-
<!-- Login dialog strings -->
- <message name="IDS_SYNC_LOGIN_DIALOG_TITLE" desc="The title of the sync login dialog.">
+ <message name="IDS_SYNC_MY_BOOKMARKS_LABEL" desc="Text to show for the sync login dialog.">
Sync my bookmarks
</message>
+ <message name="IDS_SYNC_LOGIN_INTRODUCTION" desc="The message to display at the top of the Login dialog">
+ Google Chrome can store your bookmark data with your Google account.
+ Bookmarks that you create on this computer will instantly be made
+ available on all the computers synced to this account.
+ </message>
+ <message name="IDS_SYNC_LOGIN_SIGNIN_PREFIX" desc="The first part of the sentence that is displayed after the login info">
+ Sign in with your
+ </message>
+ <message name="IDS_SYNC_LOGIN_SIGNIN_SUFFIX" desc="The second part of the sentence. Google will be replaced by the Google logo. The translation of 'Account' will be display in bold">
+ Google Account
+ </message>
+ <message name="IDS_SYNC_LOGIN_EMAIL" desc="The user Email address of the Google account">
+ Email:
+ </message>
+ <message name="IDS_SYNC_LOGIN_PASSWORD" desc="The user password of the Google account">
+ Password:
+ </message>
+ <message name="IDS_SYNC_SIGNIN" desc="The label of the button to log to your Google account">
+ Sign in
+ </message>
+ <message name="IDS_SYNC_CANNOT_ACCESS_ACCOUNT" desc="The text of a hyperlink">
+ I cannot access my account
+ </message>
+ <message name="IDS_SYNC_CREATE_ACCOUNT" desc="The text of a hyperlink to create a Google account">
+ Create a Google account
+ </message>
+ <message name="IDS_SYNC_CANNOT_BE_BLANK" desc="The input error message when the user hasn't entered a username or password">
+ Required field cannot be left blank
+ </message>
+ <message name="IDS_SYNC_LOGIN_COULD_NOT_CONNECT" desc="The connect error message">
+ Could not connect to the server
+ </message>
+ <message name="IDS_SYNC_LOGIN_SETTING_UP_SYNC" desc="For the connect error message">
+ Setting up Bookmarks Sync
+ </message>
+ <message name="IDS_SYNC_LOGIN_SETTING_UP" desc="A progress message">
+ Setting up...
+ </message>
+ <message name="IDS_SYNC_LOGIN_SUCCESS" desc="Operation successful">
+ Success!
+ </message>
+
+ <!-- Merge and Sync dialog strings -->
+ <message name="IDS_SYNC_MERGE_INTRODUCTION" desc="The header at the top of the merge and sync dialog.">
+ Your bookmarks will be merged.
+ </message>
+ <message name="IDS_SYNC_MERGE_AND_SYNC_LABEL" desc="The label of the button to actually merge your profile">
+ Merge and sync
+ </message>
+ <message name="IDS_SYNC_MERGE_WARNING" desc="The footer at the bottom of the merge and sync dialog.">
+ Your existing online bookmarks will be merged with the
+ bookmarks on this machine. You can use the Bookmark Manager to organize
+ your bookmarks after the merge.
+ </message>
+ <message name="IDS_SYNC_MERGE_ALL_DONE" desc="Operation finished">
+ All done!
+ </message>
<!-- Bookmarks bar strings -->
<message name="IDS_SYNC_BOOKMARK_BAR_ERROR" desc="The text to display on the bookmark bar button which indicates a sync error.">
diff --git a/chrome/browser/sync/resources/gaia_login.html b/chrome/browser/sync/resources/gaia_login.html
index a3ee2df..478dce7 100644
--- a/chrome/browser/sync/resources/gaia_login.html
+++ b/chrome/browser/sync/resources/gaia_login.html
@@ -1,4 +1,4 @@
-<html>
+<html i18n-values="dir:textdirection;">
<style type="text/css"><!--
body,td,div,p,a,font,span {font-family: arial,sans-serif;}
body { bgcolor:"#ffffff" }
@@ -12,10 +12,18 @@
.body { margin-left: 3em;
margin-right: 5em;
font-family: arial,sans-serif; }
+ .endaligned {
+ text-align: right;
+ }
+ html[dir='rtl'] .endaligned {
+ text-align: left;
+ }
+ #gaia_account_text { font-weight: bold; }
div.errorbox-good {}
div.errorbox-bad {}
div.errormsg { color: red; font-size: smaller;
- font-family: arial,sans-serif;}
+ font-family: arial,sans-serif;
+ display: none;}
font.errormsg { color: red; font-size: smaller;
font-family: arial,sans-serif;}
hr {
@@ -28,7 +36,8 @@
}
--></style>
</head>
- <body dir="ltr" bgcolor="#ffffff" vlink="#666666"
+ <body bgcolor="#ffffff" vlink="#666666"
+ i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"
style="margin-bottom: 0" onload="initForm();">
<table width="100%" align="center" cellpadding="1" cellspacing="1">
<tr>
@@ -63,7 +72,6 @@
if (f) {
f.Email.value = args.user;
}
- resetErrorVisibility();
if (1 == args.error) {
setElementDisplay("errormsg_1_Password", 'table-row');
setBlurbError();
@@ -81,15 +89,29 @@
}
function showGaiaSuccessAndClose() {
- document.getElementById("signIn").value = "Success!";
+ document.getElementById("signIn").value = templateData['success'];
setTimeout(CloseDialog, 1600);
}
function showGaiaSuccessAndSettingUp() {
- document.getElementById("signIn").value = "Setting up...";
+ document.getElementById("signIn").value = templateData['settingup'];
}
function initForm() {
+ var acct_text = document.getElementById("gaia_account_text");
+ var translated_text = acct_text.textContent;
+ var posGoogle = translated_text.indexOf('Google');
+ if (posGoogle != -1) {
+ var ltr = templateData['textdirection'] == 'ltr';
+ var googleIsAtEndOfSentence = posGoogle != 0;
+ if (googleIsAtEndOfSentence == ltr) {
+ // We're in ltr and in the translation the word 'Google' is AFTER the
+ // word 'Account' OR we're in rtl and 'Google' is BEFORE 'Account'.
+ var logo_td = document.getElementById('gaia_logo');
+ logo_td.parentNode.appendChild(logo_td);
+ }
+ acct_text.textContent = translated_text.replace('Google','');
+ }
setInterval(advanceThrobber, 30);
var args = JSON.parse(chrome.dialogArguments);
showGaiaLogin(args);
@@ -178,17 +200,17 @@
cellspacing="0">
<tr>
<td colspan="2" align="center">
- <font size="-1"><span i18n-content="signinwithyour"></span></font>
+ <font size="-1"><span i18n-content="signinprefix"></span></font>
<table>
<tr>
- <td valign="top">
+ <td valign="top" id="gaia_logo">
<img src="google_transparent.png" alt="Google">
</img>
</td>
<td valign="middle">
- <font size="+0"><b>
- <span i18n-content="accountlabel"></span>
- </b></font>
+ <font size="+0">
+ <span id="gaia_account_text" i18n-content="signinsuffix"></span>
+ </font>
</td>
</tr>
</table>
@@ -209,9 +231,9 @@
<tr>
<td colspan="2" align="center"> </td>
</tr>
- <tr>
- <td nowrap="nowrap">
- <div align="right">
+ <tr>
+ <td nowrap="nowrap">
+ <div class="endaligned">
<span class="gaia le lbl" i18n-content="emaillabel">
</span>
</div>
@@ -223,18 +245,18 @@
</tr>
<tr>
<td></td>
- <td align="left">
+ <td>
<div class="errormsg" id="errormsg_0_Email"
i18n-content="cannotbeblank">
</div>
</td>
</tr>
<tr>
- <td></td>
- <td align="left"> </td>
- </tr>
- <tr>
- <td align="right">
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="endaligned">
<span class="gaia le lbl" i18n-content="passwordlabel">
</span>
</td>
@@ -245,7 +267,7 @@
</tr>
<tr>
<td></td>
- <td align="left">
+ <td>
<div class="errormsg" id="errormsg_0_Password"
i18n-content="cannotbeblank">
</div>
@@ -254,16 +276,16 @@
<tr>
<td>
</td>
- <td align="left">
+ <td>
<div class="errormsg" id="errormsg_1_Password">
<span i18n-content="invalidcredentials"></span>[<a href="http://www.google.com/support/accounts/bin/answer.py?ctx=ch&answer=27444">?</a>]
</div>
</td>
</tr>
- <tr>
- <td>
- </td>
- <td align="left">
+ <tr>
+ <td>
+ </td>
+ <td>
<div class="errormsg" id="errormsg_0_Connection"
i18n-content="couldnotconnect">
</div>
@@ -271,14 +293,14 @@
</tr>
<tr>
<td>
- </td>
- <td align="left">
- </td>
+ </td>
+ <td>
+ </td>
</tr>
<tr>
<td>
</td>
- <td align="left">
+ <td>
<table>
<tr>
<td>
@@ -290,7 +312,7 @@
</td>
<td>
<input id="signIn" type="button" class="gaia le button"
- name="signIn" value="Sign in"
+ name="signIn" i18n-values="value:signin"
onclick="sendCredentialsAndClose();" />
</td>
</tr>
@@ -322,10 +344,9 @@
</form>
</td>
</tr>
- </table>
- <div align="right">
- <input type="button" name="cancel" value="Cancel" onclick="CloseDialog();"/>
- </div>
- </table>
+</table>
+<div class="endaligned">
+ <input type="button" name="cancel" i18n-values="value:cancel" onclick="CloseDialog();"/>
+</div>
</body>
</html>
diff --git a/chrome/browser/sync/resources/merge_and_sync.html b/chrome/browser/sync/resources/merge_and_sync.html
index 6864c7f..8a890d5 100644
--- a/chrome/browser/sync/resources/merge_and_sync.html
+++ b/chrome/browser/sync/resources/merge_and_sync.html
@@ -1,6 +1,6 @@
-<HTML>
-<HEAD>
-<TITLE></TITLE>
+<html i18n-values="dir:textdirection;">
+<head>
+<title></title>
<style type="text/css">
body,td,div,p,a,font,span {font-family: arial,sans-serif;}
body { bgcolor:"#ffffff" }
@@ -27,10 +27,9 @@
function showMergeAndSyncDone() {
var throbber = document.getElementById('throbber_container');
throbber.style.display = "none";
- document.getElementById("header").style.display = "none";
- document.getElementById("header_done").style.display = "block";
- var closebutton = document.getElementById("close");
- closebutton.value = document.getElementById("close_txt").innerHTML;
+ document.getElementById("header").innerHTML =
+ "<font size='-1'><b>" + templateData['alldone'] + "</b></font>";
+ document.getElementById("close").value = templateData['closelabel'];
setTimeout(Close, 1600);
}
@@ -42,15 +41,10 @@
}
</script>
-</HEAD>
-<BODY onload="setInterval(advanceThrobber, 30);">
+</head>
+<body onload="setInterval(advanceThrobber, 30);">
<div id="header">
- <p><font size="-1"><b><span i18n-content="titlewarning"></span></b>
- </font></p>
-</div>
-<div id="header_done" style="display:none">
- <p><font size="-1">
- <b><span i18n-content="alldone"></span></b>
+ <p><font size="-1"><b><span i18n-content="introduction"></span></b>
</font></p>
</div>
<br />
@@ -75,10 +69,8 @@
<td>
<input id="close" type="button" i18n-values="value:abortlabel"
onclick="Close();"/>
- <span id="close_txt" i18n-content="closelabel" style="display:none">
- </span>
</td>
</tr>
</table>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/chrome/browser/views/sync/sync_setup_flow.h b/chrome/browser/views/sync/sync_setup_flow.h
index 346163f..32caae1 100644
--- a/chrome/browser/views/sync/sync_setup_flow.h
+++ b/chrome/browser/views/sync/sync_setup_flow.h
@@ -68,7 +68,7 @@ class SyncSetupFlow : public HtmlDialogUIDelegate {
// HtmlDialogUIDelegate implementation.
virtual std::wstring GetDialogTitle() const {
- return l10n_util::GetString(IDS_SYNC_LOGIN_DIALOG_TITLE);
+ return l10n_util::GetString(IDS_SYNC_MY_BOOKMARKS_LABEL);
}
// HtmlDialogUIDelegate implementation.
diff --git a/chrome/browser/views/sync/sync_setup_wizard.cc b/chrome/browser/views/sync/sync_setup_wizard.cc
index e952af3..f89fe12 100644
--- a/chrome/browser/views/sync/sync_setup_wizard.cc
+++ b/chrome/browser/views/sync/sync_setup_wizard.cc
@@ -52,50 +52,62 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
if (path_raw == chrome::kSyncGaiaLoginPath) {
DictionaryValue localized_strings;
localized_strings.SetString(L"settingupsync",
- "Setting up Bookmarks Sync");
- localized_strings.SetString(L"errorsigningin", "Error signing in");
+ l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP_SYNC));
localized_strings.SetString(L"introduction",
- "Google Chrome can store your bookmark data with your Google account."
- "Bookmarks that you create on this computer will instantly be made"
- "available on all the computers synced to this account.");
- localized_strings.SetString(L"signinwithyour", "Sign in with your");
- localized_strings.SetString(L"accountlabel", "Account");
+ l10n_util::GetString(IDS_SYNC_LOGIN_INTRODUCTION));
+ localized_strings.SetString(L"signinprefix",
+ l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_PREFIX));
+ localized_strings.SetString(L"signinsuffix",
+ l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_SUFFIX));
localized_strings.SetString(L"cannotbeblank",
- "Required field cannot be left blank");
- localized_strings.SetString(L"passwordlabel", "Password:");
- localized_strings.SetString(L"emaillabel", "Email:");
+ l10n_util::GetString(IDS_SYNC_CANNOT_BE_BLANK));
+ localized_strings.SetString(L"emaillabel",
+ l10n_util::GetString(IDS_SYNC_LOGIN_EMAIL));
+ localized_strings.SetString(L"passwordlabel",
+ l10n_util::GetString(IDS_SYNC_LOGIN_PASSWORD));
localized_strings.SetString(L"invalidcredentials",
- "Username and password do not match.");
+ l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS));
+ localized_strings.SetString(L"signin",
+ l10n_util::GetString(IDS_SYNC_SIGNIN));
localized_strings.SetString(L"couldnotconnect",
- "Could not connect to the server");
+ l10n_util::GetString(IDS_SYNC_LOGIN_COULD_NOT_CONNECT));
localized_strings.SetString(L"cannotaccessaccount",
- "I cannot access my account");
+ l10n_util::GetString(IDS_SYNC_CANNOT_ACCESS_ACCOUNT));
localized_strings.SetString(L"createaccount",
- "Create a Google Account");
-
+ l10n_util::GetString(IDS_SYNC_CREATE_ACCOUNT));
+ localized_strings.SetString(L"cancel",
+ l10n_util::GetString(IDS_CANCEL));
+ localized_strings.SetString(L"settingup",
+ l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP));
+ localized_strings.SetString(L"success",
+ l10n_util::GetString(IDS_SYNC_LOGIN_SUCCESS));
+ localized_strings.SetString(L"errorsigningin",
+ l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN));
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_GAIA_LOGIN_HTML));
-
+ SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
} else if (path_raw == chrome::kSyncMergeAndSyncPath) {
DictionaryValue localized_strings;
+ localized_strings.SetString(L"introduction",
+ l10n_util::GetString(IDS_SYNC_MERGE_INTRODUCTION));
+ localized_strings.SetString(L"mergeandsynclabel",
+ l10n_util::GetString(IDS_SYNC_MERGE_AND_SYNC_LABEL));
+ localized_strings.SetString(L"abortlabel",
+ l10n_util::GetString(IDS_ABORT));
+ localized_strings.SetString(L"closelabel",
+ l10n_util::GetString(IDS_CLOSE));
+ localized_strings.SetString(L"alldone",
+ l10n_util::GetString(IDS_SYNC_MERGE_ALL_DONE));
localized_strings.SetString(L"mergeandsyncwarning",
- "Your existing online bookmarks will be merged with the "
- "bookmarks on this machine. You can use the Bookmark Manager to "
- "organize your bookmarks after the merge.");
- localized_strings.SetString(L"titlewarning",
- "Your bookmarks will be merged.");
- localized_strings.SetString(L"mergeandsynclabel", "Merge and sync");
- localized_strings.SetString(L"abortlabel", "Abort");
- localized_strings.SetString(L"alldone", "All Done!");
- localized_strings.SetString(L"closelabel", "Close");
+ l10n_util::GetString(IDS_SYNC_MERGE_WARNING));
localized_strings.SetString(L"setuperror",
l10n_util::GetString(IDS_SYNC_SETUP_ERROR));
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_MERGE_AND_SYNC_HTML));
-
+ SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
} else if (path_raw == chrome::kSyncSetupFlowPath) {
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index d917804..bff1dc6 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -1075,7 +1075,7 @@ void ToolbarView::CreateAppMenu() {
#ifdef CHROME_PERSONALIZATION
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSync)) {
app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS,
- l10n_util::GetString(IDS_SYNC_MENU_LABEL));
+ l10n_util::GetString(IDS_SYNC_MY_BOOKMARKS_LABEL) + L"...");
app_menu_contents_->AddSeparator();
}
#endif