Commit bcc53bbd authored by Jana Grill's avatar Jana Grill Committed by Commit Bot

Adjust IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY for FlexOrgs

Add the device type placeholders to IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY
and IDS_ASH_ENTERPRISE_DEVICE_MANAGED, replacing them with the actual
device type in code. Additioanlly adjust the domain placeholder name and
description and add screenshots to make it easier for the translators to
understand the usage of the texts.

Bug: b:172676875
Test: Manual
Change-Id: Ia2b0f20e10c2e5ecb6f3908e50588ac7f5c8532e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538839Reviewed-by: default avatarBrian Malcolm <bmalcolm@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Jana Grill <janagrill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830928}
parent 3805470b
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chromeos/strings/grit/chromeos_strings.h" #include "chromeos/strings/grit/chromeos_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
...@@ -63,7 +64,7 @@ void ManagedDeviceTrayItemView::Update() { ...@@ -63,7 +64,7 @@ void ManagedDeviceTrayItemView::Update() {
SetVisible(true); SetVisible(true);
if (!enterprise_domain_manager.empty()) { if (!enterprise_domain_manager.empty()) {
image_view()->SetTooltipText(l10n_util::GetStringFUTF16( image_view()->SetTooltipText(l10n_util::GetStringFUTF16(
IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(enterprise_domain_manager))); base::UTF8ToUTF16(enterprise_domain_manager)));
} else { } else {
image_view()->SetTooltipText(base::string16()); image_view()->SetTooltipText(base::string16());
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chromeos/strings/grit/chromeos_strings.h" #include "chromeos/strings/grit/chromeos_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
...@@ -96,9 +97,11 @@ void UnifiedManagedDeviceView::Update() { ...@@ -96,9 +97,11 @@ void UnifiedManagedDeviceView::Update() {
base::string16 managed_string = base::string16 managed_string =
enterprise_domain_manager.empty() enterprise_domain_manager.empty()
? l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED) ? l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED,
ui::GetChromeOSDeviceName())
: l10n_util::GetStringFUTF16( : l10n_util::GetStringFUTF16(
IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(enterprise_domain_manager)); base::UTF8ToUTF16(enterprise_domain_manager));
label_->SetText(managed_string); label_->SetText(managed_string);
SetAccessibleName(managed_string); SetAccessibleName(managed_string);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "chromeos/strings/grit/chromeos_strings.h" #include "chromeos/strings/grit/chromeos_strings.h"
#include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_enums.mojom.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop_highlight.h" #include "ui/views/animation/ink_drop_highlight.h"
...@@ -350,11 +351,11 @@ void EnterpriseManagedView::Update() { ...@@ -350,11 +351,11 @@ void EnterpriseManagedView::Update() {
!model->enterprise_domain_manager().empty()); !model->enterprise_domain_manager().empty());
if (model->active_directory_managed()) { if (model->active_directory_managed()) {
SetTooltipText( SetTooltipText(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED,
l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED)); ui::GetChromeOSDeviceName()));
} else if (!model->enterprise_domain_manager().empty()) { } else if (!model->enterprise_domain_manager().empty()) {
SetTooltipText(l10n_util::GetStringFUTF16( SetTooltipText(l10n_util::GetStringFUTF16(
IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(model->enterprise_domain_manager()))); base::UTF8ToUTF16(model->enterprise_domain_manager())));
} }
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "ui/base/ime/chromeos/input_method_manager.h" #include "ui/base/ime/chromeos/input_method_manager.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/chromeos/devicetype_utils.h"
namespace em = enterprise_management; namespace em = enterprise_management;
...@@ -239,7 +240,8 @@ IN_PROC_BROWSER_TEST_F(LoginScreenButtonsLocalePolicy, UnifiedTrayLabelsText) { ...@@ -239,7 +240,8 @@ IN_PROC_BROWSER_TEST_F(LoginScreenButtonsLocalePolicy, UnifiedTrayLabelsText) {
// Text on EnterpriseManagedView tooltip in current locale. // Text on EnterpriseManagedView tooltip in current locale.
base::string16 expected_text = l10n_util::GetStringFUTF16( base::string16 expected_text = l10n_util::GetStringFUTF16(
IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, base::UTF8ToUTF16(kDomain)); IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(kDomain));
EXPECT_EQ(expected_text, actual_text); EXPECT_EQ(expected_text, actual_text);
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/bluetooth_adapter_factory.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/devicetype_utils.h"
namespace chromeos { namespace chromeos {
...@@ -154,9 +155,9 @@ void VersionInfoUpdater::SetEnterpriseInfo( ...@@ -154,9 +155,9 @@ void VersionInfoUpdater::SetEnterpriseInfo(
// Update the notification about device status reporting. // Update the notification about device status reporting.
if (delegate_ && !enterprise_display_domain.empty()) { if (delegate_ && !enterprise_display_domain.empty()) {
std::string enterprise_info; std::string enterprise_info;
enterprise_info = enterprise_info = l10n_util::GetStringFUTF8(
l10n_util::GetStringFUTF8(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(enterprise_display_domain)); base::UTF8ToUTF16(enterprise_display_domain));
delegate_->OnEnterpriseInfoUpdated(enterprise_info, asset_id); delegate_->OnEnterpriseInfoUpdated(enterprise_info, asset_id);
} }
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "url/gurl.h" #include "url/gurl.h"
using chromeos::ProfileHelper; using chromeos::ProfileHelper;
...@@ -51,11 +52,13 @@ IN_PROC_BROWSER_TEST_F(SystemTrayClientEnterpriseTest, TrayEnterprise) { ...@@ -51,11 +52,13 @@ IN_PROC_BROWSER_TEST_F(SystemTrayClientEnterpriseTest, TrayEnterprise) {
if (ash::features::IsManagedDeviceUIRedesignEnabled()) { if (ash::features::IsManagedDeviceUIRedesignEnabled()) {
// The text shows the domain. // The text shows the domain.
EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16("example.com")), base::UTF8ToUTF16("example.com")),
test_api->GetBubbleViewText(ash::VIEW_ID_TRAY_ENTERPRISE_LABEL)); test_api->GetBubbleViewText(ash::VIEW_ID_TRAY_ENTERPRISE_LABEL));
} else { } else {
// The tooltip shows the domain. // The tooltip shows the domain.
EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16("example.com")), base::UTF8ToUTF16("example.com")),
test_api->GetBubbleViewTooltip(ash::VIEW_ID_TRAY_ENTERPRISE)); test_api->GetBubbleViewTooltip(ash::VIEW_ID_TRAY_ENTERPRISE));
} }
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include "ui/base/theme_provider.h" #include "ui/base/theme_provider.h"
#include "ui/base/webui/jstemplate_builder.h" #include "ui/base/webui/jstemplate_builder.h"
#include "ui/base/webui/web_ui_util.h" #include "ui/base/webui/web_ui_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/gfx/animation/animation.h" #include "ui/gfx/animation/animation.h"
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
...@@ -428,11 +429,11 @@ scoped_refptr<base::RefCountedString> NTPResourceCache::CreateNewTabGuestHTML( ...@@ -428,11 +429,11 @@ scoped_refptr<base::RefCountedString> NTPResourceCache::CreateNewTabGuestHTML(
const std::string enterprise_domain_manager = const std::string enterprise_domain_manager =
connector->GetEnterpriseDomainManager(); connector->GetEnterpriseDomainManager();
enterprise_info = l10n_util::GetStringFUTF16( enterprise_info = l10n_util::GetStringFUTF16(
IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY, ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(enterprise_domain_manager)); base::UTF8ToUTF16(enterprise_domain_manager));
} else if (connector->IsActiveDirectoryManaged()) { } else if (connector->IsActiveDirectoryManaged()) {
enterprise_info = enterprise_info = l10n_util::GetStringFUTF16(
l10n_util::GetStringUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED); IDS_ASH_ENTERPRISE_DEVICE_MANAGED, ui::GetChromeOSDeviceName());
} else { } else {
NOTREACHED() << "Unknown management type"; NOTREACHED() << "Unknown management type";
} }
......
...@@ -182,11 +182,11 @@ Try tapping the mic to ask me anything. ...@@ -182,11 +182,11 @@ Try tapping the mic to ask me anything.
</message> </message>
<!-- Status tray enterprise management. --> <!-- Status tray enterprise management. -->
<message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY" desc="Text for notifications showing that this device is enterpise managed. Used when the organization's domain name is available."> <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY" desc="Text for notifications showing that this device is enterprise managed. Used when the manager is available. MANAGER can be a domain or an email address.">
This device is managed by <ph name="DOMAIN">$1<ex>acmecorp.com</ex></ph>. This <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> is managed by <ph name="MANAGER">$2<ex>acmecorp.com</ex></ph>.
</message> </message>
<message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED" desc="Text for notifications showing that this device is enterprise managed. Used when the organization's domain name is not available (e.g. Active Directory)."> <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED" desc="Text for notifications showing that this device is enterprise managed. Used when the manager is not available (e.g. Active Directory).">
This device is enterprise managed This <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> is enterprise managed
</message> </message>
<message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_SHORT" desc="Short text showing that the device is enterprise managed."> <message name="IDS_ASH_ENTERPRISE_DEVICE_MANAGED_SHORT" desc="Short text showing that the device is enterprise managed.">
Managed Managed
......
1a81d2e43bb8fb22e6c061917fea0bb76c089e51
\ No newline at end of file
de650a83c22f3ace1b727c015a93d2f95b5731b2
\ No newline at end of file
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