Personalization: add resource string for my images label
Bug: b/184774974 Test: browser_test --gtest-filter="PersonalizationApp*" Change-Id: I758d4946a406cc724eda9854af452ad677495827 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2973412 Commit-Queue: Jason Thai <jasontt@chromium.org> Reviewed-by: Tao Wu <wutao@chromium.org> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> Cr-Commit-Position: refs/heads/master@{#894376}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
247bcf416c
commit
fdc7b80a80
chrome/test/data/webui/chromeos/personalization_app
chromeos
@ -83,6 +83,7 @@ export function WallpaperBreadcrumbTest() {
|
||||
assertFalse(div.hidden);
|
||||
const span =
|
||||
wallpaperBreadcrumbElement.shadowRoot.getElementById('pageLabel');
|
||||
assertEquals('My Images', span.textContent);
|
||||
assertEquals(
|
||||
wallpaperBreadcrumbElement.i18n('myImagesLabel'), span.textContent);
|
||||
});
|
||||
}
|
||||
|
@ -1476,6 +1476,9 @@ Try tapping the mic to ask me anything.
|
||||
<message name="IDS_PERSONALIZATION_APP_TITLE" desc="Name of the system web app for personalizing ChromeOS.">
|
||||
Wallpaper
|
||||
</message>
|
||||
<message name="IDS_PERSONALIZATION_APP_MY_IMAGES" desc="Label for the local images page in wallpaper app.">
|
||||
My Images
|
||||
</message>
|
||||
</messages>
|
||||
</release>
|
||||
</grit>
|
||||
|
@ -0,0 +1 @@
|
||||
1705f6498d9c580713e3cf098b0d6fcfc3fdefc7
|
@ -57,7 +57,8 @@ void AddResources(content::WebUIDataSource* source) {
|
||||
|
||||
void AddStrings(content::WebUIDataSource* source) {
|
||||
static constexpr webui::LocalizedString kLocalizedStrings[] = {
|
||||
{"title", IDS_PERSONALIZATION_APP_TITLE}};
|
||||
{"title", IDS_PERSONALIZATION_APP_TITLE},
|
||||
{"myImagesLabel", IDS_PERSONALIZATION_APP_MY_IMAGES}};
|
||||
source->AddLocalizedStrings(kLocalizedStrings);
|
||||
source->UseStringsJs();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
import {Store, StoreObserver} from 'chrome://resources/js/cr/ui/store.m.js';
|
||||
import {StoreClient, StoreClientInterface} from 'chrome://resources/js/cr/ui/store_client.m.js';
|
||||
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
|
||||
import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js';
|
||||
import {mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
import {emptyState, PersonalizationState, reduce} from './personalization_reducers.js';
|
||||
|
||||
@ -88,6 +88,7 @@ export const PersonalizationStoreClient =
|
||||
* @implements {PersonalizationStoreClientInterface}
|
||||
* @implements {StoreClientInterface}
|
||||
* @implements {StoreObserver<PersonalizationState>}
|
||||
* @implements {I18nBehaviorInterface}
|
||||
*/
|
||||
export const WithPersonalizationStore =
|
||||
mixinBehaviors(PersonalizationStoreClient, PolymerElement);
|
||||
|
@ -91,8 +91,7 @@ export class WallpaperBreadcrumb extends WithPersonalizationStore {
|
||||
collections.find(collection => collection.id === collectionId);
|
||||
return collection ? collection.name : '';
|
||||
case Paths.LocalCollection:
|
||||
// TODO(b/184774974): Add translation
|
||||
return 'My Images';
|
||||
return this.i18n('myImagesLabel');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user