Commit 01bd19eb authored by Melissa Zhang's avatar Melissa Zhang Committed by Commit Bot

[Sharesheet] Provide translation for title label.

This CL adds a strings file for Sharesheet UI. It also changes the
target display label to be multi-line if there is no secondary
label.

Bug: 1097623
Change-Id: Id75f9fa0de851de58707fa6b730098d472038599
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2395135Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805163}
parent 853da7ec
...@@ -27,6 +27,8 @@ per-file media_router_strings.grdp=file://chrome/browser/media/router/OWNERS ...@@ -27,6 +27,8 @@ per-file media_router_strings.grdp=file://chrome/browser/media/router/OWNERS
per-file nearby_share_strings.grdp=file://chrome/browser/nearby_sharing/OWNERS per-file nearby_share_strings.grdp=file://chrome/browser/nearby_sharing/OWNERS
per-file sharesheet_strings.grdp=file://chrome/browser/sharesheet/OWNERS
per-file welcome_strings.grdp=file://chrome/browser/ui/webui/welcome/OWNERS per-file welcome_strings.grdp=file://chrome/browser/ui/webui/welcome/OWNERS
per-file printing_strings.grdp=file://printing/OWNERS per-file printing_strings.grdp=file://printing/OWNERS
......
...@@ -291,6 +291,7 @@ are declared in tools/grit/grit_rule.gni. ...@@ -291,6 +291,7 @@ are declared in tools/grit/grit_rule.gni.
<part file="chromeos_strings.grdp" /> <part file="chromeos_strings.grdp" />
<part file="os_settings_strings.grdp" /> <part file="os_settings_strings.grdp" />
<part file="os_settings_search_tag_strings.grdp" /> <part file="os_settings_search_tag_strings.grdp" />
<part file="sharesheet_strings.grdp" />
</if> </if>
<!-- Settings specific strings --> <!-- Settings specific strings -->
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Sharesheet specific strings (included from generated_resources.grd). -->
<grit-part>
<!-- Common strings -->
<message name="IDS_SHARESHEET_TITLE_LABEL" desc="The label to be shown as the title of the sharesheet bubble when a user clicks on the share button.">
Share
</message>
</grit-part>
7fd2644cc63074887c4dbb2ffa0933cd9272c66d
\ No newline at end of file
file://chrome/browser/sharesheet/OWNERS
# COMPONENT: Platform>Apps>Foundation
This directory of image SHA-1 hashes is used to improve translations of UI
strings through context images for translators.
See also: [Chrome Translation Screenshots - Instructions & FAQ
](https://docs.google.com/document/d/1nwYWDny20icMSpLUuV_LgrlbWKrYpbXOERUIZNH636o/edit#heading=h.2t7lc4cxo2au)
...@@ -8,14 +8,15 @@ ...@@ -8,14 +8,15 @@
#include <utility> #include <utility>
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sharesheet/sharesheet_metrics.h" #include "chrome/browser/sharesheet/sharesheet_metrics.h"
#include "chrome/browser/sharesheet/sharesheet_service_delegate.h" #include "chrome/browser/sharesheet/sharesheet_service_delegate.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/app_window_registry.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h" #include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
...@@ -54,7 +55,6 @@ constexpr int kShortSpacing = 20; ...@@ -54,7 +55,6 @@ constexpr int kShortSpacing = 20;
constexpr int kSpacing = 24; constexpr int kSpacing = 24;
constexpr int kTitleLineHeight = 24; constexpr int kTitleLineHeight = 24;
constexpr char kTitle[] = "Share";
constexpr char kTitleFont[] = "GoogleSans, Medium, 16px"; constexpr char kTitleFont[] = "GoogleSans, Medium, 16px";
constexpr char kButtonLabelFont[] = "Roboto, Medium, 14px"; constexpr char kButtonLabelFont[] = "Roboto, Medium, 14px";
constexpr char kButtonSecondaryLabelFont[] = "Roboto, Regular, 13px"; constexpr char kButtonSecondaryLabelFont[] = "Roboto, Regular, 13px";
...@@ -109,6 +109,10 @@ class ShareSheetTargetButton : public views::Button { ...@@ -109,6 +109,10 @@ class ShareSheetTargetButton : public views::Button {
secondary_label->SetFontList(gfx::FontList(kButtonSecondaryLabelFont)); secondary_label->SetFontList(gfx::FontList(kButtonSecondaryLabelFont));
secondary_label->SetEnabledColor(kShareTargetSecondaryTitleColor); secondary_label->SetEnabledColor(kShareTargetSecondaryTitleColor);
SetLabelProperties(secondary_label); SetLabelProperties(secondary_label);
} else {
// If there is no secondary label, let the initial label stretch across
// multiple lines.
label->SetMultiLine(true);
} }
AddChildView(std::move(label_view)); AddChildView(std::move(label_view));
...@@ -184,7 +188,7 @@ void SharesheetBubbleView::ShowBubble(std::vector<TargetInfo> targets, ...@@ -184,7 +188,7 @@ void SharesheetBubbleView::ShowBubble(std::vector<TargetInfo> targets,
main_layout->StartRow(views::GridLayout::kFixedSize, COLUMN_SET_ID_TITLE, main_layout->StartRow(views::GridLayout::kFixedSize, COLUMN_SET_ID_TITLE,
kTitleLineHeight); kTitleLineHeight);
auto* title = main_layout->AddView(std::make_unique<views::Label>( auto* title = main_layout->AddView(std::make_unique<views::Label>(
base::UTF8ToUTF16(base::StringPiece(kTitle)))); l10n_util::GetStringUTF16(IDS_SHARESHEET_TITLE_LABEL)));
title->SetFontList(gfx::FontList(kTitleFont)); title->SetFontList(gfx::FontList(kTitleFont));
title->SetLineHeight(kTitleLineHeight); title->SetLineHeight(kTitleLineHeight);
title->SetEnabledColor(kShareTitleColor); title->SetEnabledColor(kShareTitleColor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment