Skip to content

Commit 13b8b7c

Browse files
devvaannshabose
authored andcommitted
feat: localize strings used in toast notification
1 parent 7cb4f4e commit 13b8b7c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,7 +3851,7 @@ function RemoteFunctions(config = {}) {
38513851
if (!element.hasAttribute("data-brackets-id")) {
38523852
const hideToast = localStorage.getItem('phoenix-hide-dynamic-toast');
38533853
if (!hideToast) {
3854-
showToast("Element not editable - generated by script.");
3854+
showToast(config.strings.toastNotEditable);
38553855
}
38563856
}
38573857

@@ -4633,7 +4633,7 @@ function RemoteFunctions(config = {}) {
46334633
const content = `
46344634
<div class="toast-container">
46354635
<div class="toast-message">${message}</div>
4636-
<button class="toast-button">Don't show again</button>
4636+
<button class="toast-button">${config.strings.toastDontShowAgain}</button>
46374637
</div>
46384638
`;
46394639

src/LiveDevelopment/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ define(function main(require, exports, module) {
120120
imageGalleryNoImages: Strings.LIVE_DEV_IMAGE_GALLERY_NO_IMAGES,
121121
imageGalleryLoadError: Strings.LIVE_DEV_IMAGE_GALLERY_LOAD_ERROR,
122122
imageGalleryClose: Strings.LIVE_DEV_IMAGE_GALLERY_CLOSE,
123-
imageGalleryUpload: Strings.LIVE_DEV_IMAGE_GALLERY_UPLOAD
123+
imageGalleryUpload: Strings.LIVE_DEV_IMAGE_GALLERY_UPLOAD,
124+
toastNotEditable: Strings.LIVE_DEV_TOAST_NOT_EDITABLE,
125+
toastDontShowAgain: Strings.LIVE_DEV_TOAST_DONT_SHOW_AGAIN
124126
}
125127
};
126128
// Status labels/styles are ordered: error, not connected, progress1, progress2, connected.

src/nls/root/strings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ define({
201201
"LIVE_DEV_IMAGE_GALLERY_LOAD_ERROR": "Failed to load images",
202202
"LIVE_DEV_IMAGE_GALLERY_CLOSE": "Close",
203203
"LIVE_DEV_IMAGE_GALLERY_UPLOAD": "Upload",
204+
"LIVE_DEV_TOAST_NOT_EDITABLE": "Element not editable - generated by script.",
205+
"LIVE_DEV_TOAST_DONT_SHOW_AGAIN": "Don't show again",
204206
"LIVE_DEV_IMAGE_FOLDER_DIALOG_TITLE": "Select Folder to Save Image",
205207
"LIVE_DEV_IMAGE_FOLDER_DIALOG_DESCRIPTION": "Choose where to download the image:",
206208
"LIVE_DEV_IMAGE_FOLDER_DIALOG_PLACEHOLDER": "Type folder path (e.g., assets/images/)",

0 commit comments

Comments
 (0)