diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 05:38:32 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 05:38:32 +0000 |
commit | 64d7a42850c7b5fd2890f436573ebec5b9ce949e (patch) | |
tree | f3078d43421ec8eab6d1ee9c5b2212753229a87e | |
parent | 0651394b24e570ad101b617e15c251535d791ae0 (diff) | |
download | chromium_src-64d7a42850c7b5fd2890f436573ebec5b9ce949e.zip chromium_src-64d7a42850c7b5fd2890f436573ebec5b9ce949e.tar.gz chromium_src-64d7a42850c7b5fd2890f436573ebec5b9ce949e.tar.bz2 |
The translation lead requested that this sentence be a single
string, otherwise it will likely be grammatically incorrect.
This is a hack until http://crbug.com/3295 is implemented.
Review URL: http://codereview.chromium.org/7396
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3512 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chromium_strings.grd | 5 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/app/google_chrome_strings.grd | 5 | ||||
-rw-r--r-- | chrome/browser/views/about_chrome_view.cc | 55 |
4 files changed, 43 insertions, 28 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index f948d6b..a900675 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -93,10 +93,7 @@ be available for now. --> Copyright © 2006-2008 The Chromium Authors. All Rights Reserved. </message> <message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs."> - Chromium is made possible by the <ph name="PROJECT_LINK">$1<ex>Chromium</ex></ph> open source project and other <ph name="OPEN_SOURCE_LINK">$2<ex>open source software</ex></ph>. - </message> - <message name="IDS_ABOUT_OPEN_SOURCE_SOFTWARE" desc="The link text on the About box that links to open source software. Used in IDS_ABOUT_VERSION_LICENSE."> - open source software + Chromium is made possible by the <ph name="BEGIN_LINK_CHROMIUM">BEGIN_LINK_CHR</ph>Chromium<ph name="END_LINK_CHROMIUM">END_LINK_CHR</ph> open source project and other <ph name="BEGIN_LINK_OSS">BEGIN_LINK_OSS</ph>open source software<ph name="END_LINK_OSS">END_LINK_OSS</ph>. </message> <message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box."> Not used in Chromium. Placeholder to keep resource maps in synch. diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index d3563d6..c0c1b9c 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3134,12 +3134,6 @@ each locale. --> <message name="IDS_BLOCKED_POPUP" desc="Text on a blocked popup's window titlebar."> Blocked Pop-up </message> - - <!-- Chromium related strings --> - <message name="IDS_OPEN_SOURCE_PROJECT_NAME" desc="The name of the open source version of Google Chrome"> - Chromium - </message> - </messages> </release> </grit> diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 70d27f2..f1e21bf 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -132,10 +132,7 @@ Chrome supports. --> Copyright © 2006-2008 Google Inc. All Rights Reserved. </message> <message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs."> - Google Chrome is made possible by the <ph name="PROJECT_LINK">$1<ex>Chromium</ex></ph> open source project and other <ph name="OPEN_SOURCE_LINK">$2<ex>open source software</ex></ph>. - </message> - <message name="IDS_ABOUT_OPEN_SOURCE_SOFTWARE" desc="The link text on the About box that links to open source software. Used in IDS_ABOUT_VERSION_LICENSE."> - open source software + Google Chrome is made possible by the <ph name="BEGIN_LINK_CHROMIUM">BEGIN_LINK_CHR</ph>Chromium<ph name="END_LINK_CHROMIUM">END_LINK_CHR</ph> open source project and other <ph name="BEGIN_LINK_OSS">BEGIN_LINK_OSS</ph>open source software<ph name="END_LINK_OSS">END_LINK_OSS</ph>. </message> <message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box."> Google Chrome <ph name="TERMS_OF_SERVICE_LINK">$1<ex>Terms of Service</ex></ph> diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index f7e6b1b..7802025 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -30,6 +30,7 @@ #include "chromium_strings.h" #include "generated_resources.h" +namespace { // The pixel width of the version text field. Ideally, we'd like to have the // bounds set to the edge of the icon. However, the icon is not a view but a // part of the background, so we have to hard code the width to make sure @@ -37,10 +38,28 @@ const int kVersionFieldWidth = 195; // The URLs that you navigate to when clicking the links in the About dialog. -const wchar_t* const kChromiumUrl = L"http://www.chromium.org"; +const wchar_t* const kChromiumUrl = L"http://www.chromium.org/"; const wchar_t* const kAcknowledgements = L"about:credits"; const wchar_t* const kTOS = L"about:terms"; +// These are used as placeholder text around the links in the text in the about +// dialog. +const wchar_t* kBeginLink = L"BEGIN_LINK"; +const wchar_t* kEndLink = L"END_LINK"; +const wchar_t* kBeginLinkChr = L"BEGIN_LINK_CHR"; +const wchar_t* kBeginLinkOss = L"BEGIN_LINK_OSS"; +const wchar_t* kEndLinkChr = L"END_LINK_CHR"; +const wchar_t* kEndLinkOss = L"END_LINK_OSS"; + +// Returns a substring from |text| between start and end. +std::wstring StringSubRange(const std::wstring& text, size_t start, + size_t end) { + DCHECK(end > start); + return text.substr(start, end - start); +} + +} // namespace + //////////////////////////////////////////////////////////////////////////////// // AboutChromeView, public: @@ -143,33 +162,41 @@ void AboutChromeView::Init() { main_text_label_ = new views::Label(L""); // Figure out what to write in the main label of the About box. - std::vector<size_t> url_offsets; - std::wstring text = l10n_util::GetStringF(IDS_ABOUT_VERSION_LICENSE, - std::wstring(), - std::wstring(), - &url_offsets); - chromium_url_appears_first_ = url_offsets[0] < url_offsets[1]; - int link1 = std::min(url_offsets[0], url_offsets[1]); - int link2 = std::max(url_offsets[0], url_offsets[1]); + std::wstring text = l10n_util::GetString(IDS_ABOUT_VERSION_LICENSE); + + chromium_url_appears_first_ = + text.find(kBeginLinkChr) < text.find(kBeginLinkOss); + + size_t link1 = text.find(kBeginLink); + DCHECK(link1 != std::wstring::npos); + size_t link1_end = text.find(kEndLink, link1); + DCHECK(link1_end != std::wstring::npos); + size_t link2 = text.find(kBeginLink, link1_end); + DCHECK(link2 != std::wstring::npos); + size_t link2_end = text.find(kEndLink, link2); + DCHECK(link1_end != std::wstring::npos); main_label_chunk1_ = text.substr(0, link1); - main_label_chunk2_ = text.substr(link1, link2 - link1); - main_label_chunk3_ = text.substr(link2); + main_label_chunk2_ = StringSubRange(text, link1_end + wcslen(kEndLinkOss), + link2); + main_label_chunk3_ = text.substr(link2_end + wcslen(kEndLinkOss)); // The Chromium link within the main text of the dialog. chromium_url_ = new views::Link( - l10n_util::GetString(IDS_OPEN_SOURCE_PROJECT_NAME)); + StringSubRange(text, text.find(kBeginLinkChr) + wcslen(kBeginLinkChr), + text.find(kEndLinkChr))); AddChildView(chromium_url_); chromium_url_->SetController(this); // The Open Source link within the main text of the dialog. open_source_url_ = new views::Link( - l10n_util::GetString(IDS_ABOUT_OPEN_SOURCE_SOFTWARE)); + StringSubRange(text, text.find(kBeginLinkOss) + wcslen(kBeginLinkOss), + text.find(kEndLinkOss))); AddChildView(open_source_url_); open_source_url_->SetController(this); #if defined(GOOGLE_CHROME_BUILD) - url_offsets.clear(); + std::vector<size_t> url_offsets; text = l10n_util::GetStringF(IDS_ABOUT_TERMS_OF_SERVICE, std::wstring(), std::wstring(), |