Skip to content

Commit 580b828

Browse files
committed
feat: localize all the strings used in image ribbon gallery
1 parent e17eda9 commit 580b828

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ function RemoteFunctions(config = {}) {
22882288
<div class="phoenix-ribbon-header-left">
22892289
<div class="phoenix-ribbon-search">
22902290
<input type="text" placeholder="${config.strings.imageGallerySearchPlaceholder}" />
2291-
<button class="phoenix-ribbon-search-btn">Search</button>
2291+
<button class="phoenix-ribbon-search-btn">${config.strings.imageGallerySearchButton}</button>
22922292
</div>
22932293
<div class="phoenix-ribbon-select">
22942294
<button class="phoenix-select-image-btn" title="${config.strings.imageGallerySelectFromComputer}">
@@ -2381,7 +2381,7 @@ function RemoteFunctions(config = {}) {
23812381
this._updateSearchInput(searchQuery);
23822382
this._updateCache(searchQuery, data, append);
23832383
} else if (!append) {
2384-
this._showError('No images found');
2384+
this._showError(config.strings.imageGalleryNoImages);
23852385
}
23862386

23872387
if (append) {
@@ -2392,7 +2392,7 @@ function RemoteFunctions(config = {}) {
23922392
.catch(error => {
23932393
console.error('Failed to fetch images:', error);
23942394
if (!append) {
2395-
this._showError('Failed to load images');
2395+
this._showError(config.strings.imageGalleryLoadError);
23962396
} else {
23972397
this._isLoadingMore = false;
23982398
this._hideLoadingMore();
@@ -2540,7 +2540,7 @@ function RemoteFunctions(config = {}) {
25402540
const rowElement = this._shadow.querySelector('.phoenix-ribbon-row');
25412541
if (!rowElement) { return; }
25422542

2543-
rowElement.innerHTML = 'Loading images...';
2543+
rowElement.innerHTML = config.strings.imageGalleryLoadingInitial;
25442544
rowElement.className = 'phoenix-ribbon-row phoenix-ribbon-loading';
25452545
},
25462546

@@ -2551,7 +2551,7 @@ function RemoteFunctions(config = {}) {
25512551
// when loading more images we need to show the message at the end of the image ribbon
25522552
const loadingIndicator = window.document.createElement('div');
25532553
loadingIndicator.className = 'phoenix-loading-more';
2554-
loadingIndicator.textContent = 'Loading...';
2554+
loadingIndicator.textContent = config.strings.imageGalleryLoadingMore;
25552555
rowElement.appendChild(loadingIndicator);
25562556
},
25572557

src/LiveDevelopment/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ define(function main(require, exports, module) {
8484
imageGalleryUseImage: Strings.LIVE_DEV_IMAGE_GALLERY_USE_IMAGE,
8585
imageGallerySelectFromComputer: Strings.LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER,
8686
imageGalleryChooseFolder: Strings.LIVE_DEV_IMAGE_GALLERY_CHOOSE_FOLDER,
87-
imageGallerySearchPlaceholder: Strings.LIVE_DEV_IMAGE_GALLERY_SEARCH_PLACEHOLDER
87+
imageGallerySearchPlaceholder: Strings.LIVE_DEV_IMAGE_GALLERY_SEARCH_PLACEHOLDER,
88+
imageGallerySearchButton: Strings.LIVE_DEV_IMAGE_GALLERY_SEARCH_BUTTON,
89+
imageGalleryLoadingInitial: Strings.LIVE_DEV_IMAGE_GALLERY_LOADING_INITIAL,
90+
imageGalleryLoadingMore: Strings.LIVE_DEV_IMAGE_GALLERY_LOADING_MORE,
91+
imageGalleryNoImages: Strings.LIVE_DEV_IMAGE_GALLERY_NO_IMAGES,
92+
imageGalleryLoadError: Strings.LIVE_DEV_IMAGE_GALLERY_LOAD_ERROR
8893
}
8994
};
9095
// Status labels/styles are ordered: error, not connected, progress1, progress2, connected.

src/nls/root/strings.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ define({
193193
"LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER": "Select image from computer",
194194
"LIVE_DEV_IMAGE_GALLERY_CHOOSE_FOLDER": "Choose download folder",
195195
"LIVE_DEV_IMAGE_GALLERY_SEARCH_PLACEHOLDER": "Search images...",
196+
"LIVE_DEV_IMAGE_GALLERY_SEARCH_BUTTON": "Search",
197+
"LIVE_DEV_IMAGE_GALLERY_LOADING_INITIAL": "Loading images...",
198+
"LIVE_DEV_IMAGE_GALLERY_LOADING_MORE": "Loading...",
199+
"LIVE_DEV_IMAGE_GALLERY_NO_IMAGES": "No images found",
200+
"LIVE_DEV_IMAGE_GALLERY_LOAD_ERROR": "Failed to load images",
196201
"LIVE_DEV_AI_PROMPT_PLACEHOLDER": "Ask Phoenix AI to modify this element...",
197202
"LIVE_PREVIEW_CUSTOM_SERVER_BANNER": "Getting preview from your custom server {0}",
198203
"LIVE_PREVIEW_MODE_PREVIEW": "Preview Mode",

0 commit comments

Comments
 (0)