Skip to content

Commit dfebe26

Browse files
committed
feat: localize all strings
1 parent bd25b9a commit dfebe26

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,7 @@ function RemoteFunctions(config = {}) {
24912491
</div>
24922492
</div>
24932493
<div class="phoenix-ribbon-header-right">
2494-
<button class="phoenix-ribbon-folder-settings" title="Select image download folder">
2494+
<button class="phoenix-ribbon-folder-settings" title="${config.strings.imageGallerySelectDownloadFolder}">
24952495
${ICONS.folderSettings}
24962496
</button>
24972497
<button class="phoenix-ribbon-close">×</button>
@@ -2500,7 +2500,7 @@ function RemoteFunctions(config = {}) {
25002500
<div class="phoenix-ribbon-nav left">&#8249;</div>
25012501
<div class="phoenix-ribbon-strip">
25022502
<div class="phoenix-ribbon-row phoenix-ribbon-loading">
2503-
Loading images...
2503+
${config.strings.imageGalleryLoadingInitial}
25042504
</div>
25052505
</div>
25062506
<div class="phoenix-ribbon-nav right">&#8250;</div>

src/LiveDevelopment/LivePreviewEdit.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ define(function (require, exports, module) {
3535
const Dialogs = require("widgets/Dialogs");
3636
const StateManager = require("preferences/StateManager");
3737
const ProDialogs = require("services/pro-dialogs");
38+
const Mustache = require("thirdparty/mustache/mustache");
39+
const Strings = require("strings");
3840
const ImageFolderDialogTemplate = require("text!htmlContent/image-folder-dialog.html");
3941

4042
// state manager key, to save the download location of the image
@@ -1022,7 +1024,10 @@ define(function (require, exports, module) {
10221024

10231025
// show the dialog with a text box to select a folder
10241026
// dialog html is written in 'image-folder-dialog.html'
1025-
const dialog = Dialogs.showModalDialogUsingTemplate(ImageFolderDialogTemplate, false);
1027+
const templateVars = {
1028+
Strings: Strings
1029+
};
1030+
const dialog = Dialogs.showModalDialogUsingTemplate(Mustache.render(ImageFolderDialogTemplate, templateVars), false);
10261031
const $dlg = dialog.getElement();
10271032
const $input = $dlg.find("#folder-path-input");
10281033
const $suggestions = $dlg.find("#folder-suggestions");

src/LiveDevelopment/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ define(function main(require, exports, module) {
8383
aiPromptPlaceholder: Strings.LIVE_DEV_AI_PROMPT_PLACEHOLDER,
8484
imageGalleryUseImage: Strings.LIVE_DEV_IMAGE_GALLERY_USE_IMAGE,
8585
imageGallerySelectFromComputer: Strings.LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER,
86-
imageGalleryChooseFolder: Strings.LIVE_DEV_IMAGE_GALLERY_CHOOSE_FOLDER,
86+
imageGallerySelectDownloadFolder: Strings.LIVE_DEV_IMAGE_GALLERY_SELECT_DOWNLOAD_FOLDER,
8787
imageGallerySearchPlaceholder: Strings.LIVE_DEV_IMAGE_GALLERY_SEARCH_PLACEHOLDER,
8888
imageGallerySearchButton: Strings.LIVE_DEV_IMAGE_GALLERY_SEARCH_BUTTON,
8989
imageGalleryLoadingInitial: Strings.LIVE_DEV_IMAGE_GALLERY_LOADING_INITIAL,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="image-folder-dialog template modal">
22
<div class="modal-header">
3-
<h1 class="dialog-title">Select Folder to Save Image</h1>
3+
<h1 class="dialog-title">{{Strings.LIVE_DEV_IMAGE_FOLDER_DIALOG_TITLE}}</h1>
44
</div>
55
<div class="modal-body">
6-
<p>Choose where to download the image:</p>
6+
<p>{{Strings.LIVE_DEV_IMAGE_FOLDER_DIALOG_DESCRIPTION}}</p>
77
<input type="text"
88
id="folder-path-input"
9-
placeholder="Type folder path (e.g., assets/images/)"
9+
placeholder="{{Strings.LIVE_DEV_IMAGE_FOLDER_DIALOG_PLACEHOLDER}}"
1010
value=""
1111
autocomplete="off"
1212
spellcheck="false">
@@ -15,18 +15,18 @@ <h1 class="dialog-title">Select Folder to Save Image</h1>
1515
<div id="folder-suggestions"></div>
1616

1717
<p class="folder-help-text">
18-
💡 Type folder path or leave empty to download in project root
18+
{{Strings.LIVE_DEV_IMAGE_FOLDER_DIALOG_HELP}}
1919
</p>
2020

2121
<div class="remember-folder-container">
2222
<label>
2323
<input type="checkbox" id="remember-folder-checkbox" checked>
24-
<span>Don't ask again for this project</span>
24+
<span>{{Strings.LIVE_DEV_IMAGE_FOLDER_DIALOG_REMEMBER}}</span>
2525
</label>
2626
</div>
2727
</div>
2828
<div class="modal-footer">
29-
<button class="dialog-button btn" data-button-id="cancel">Cancel</button>
30-
<button class="dialog-button btn primary" data-button-id="ok">OK</button>
29+
<button class="dialog-button btn" data-button-id="cancel">{{Strings.CANCEL}}</button>
30+
<button class="dialog-button btn primary" data-button-id="ok">{{Strings.OK}}</button>
3131
</div>
3232
</div>

src/nls/root/strings.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,18 @@ define({
192192
"LIVE_DEV_MORE_OPTIONS_IMAGE_GALLERY": "Image Gallery",
193193
"LIVE_DEV_IMAGE_GALLERY_USE_IMAGE": "Use this image",
194194
"LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER": "Select image from computer",
195-
"LIVE_DEV_IMAGE_GALLERY_CHOOSE_FOLDER": "Choose download folder",
195+
"LIVE_DEV_IMAGE_GALLERY_SELECT_DOWNLOAD_FOLDER": "Choose image download folder",
196196
"LIVE_DEV_IMAGE_GALLERY_SEARCH_PLACEHOLDER": "Search images...",
197197
"LIVE_DEV_IMAGE_GALLERY_SEARCH_BUTTON": "Search",
198198
"LIVE_DEV_IMAGE_GALLERY_LOADING_INITIAL": "Loading images...",
199199
"LIVE_DEV_IMAGE_GALLERY_LOADING_MORE": "Loading...",
200200
"LIVE_DEV_IMAGE_GALLERY_NO_IMAGES": "No images found",
201201
"LIVE_DEV_IMAGE_GALLERY_LOAD_ERROR": "Failed to load images",
202+
"LIVE_DEV_IMAGE_FOLDER_DIALOG_TITLE": "Select Folder to Save Image",
203+
"LIVE_DEV_IMAGE_FOLDER_DIALOG_DESCRIPTION": "Choose where to download the image:",
204+
"LIVE_DEV_IMAGE_FOLDER_DIALOG_PLACEHOLDER": "Type folder path (e.g., assets/images/)",
205+
"LIVE_DEV_IMAGE_FOLDER_DIALOG_HELP": "💡 Type folder path or leave empty to download in project root",
206+
"LIVE_DEV_IMAGE_FOLDER_DIALOG_REMEMBER": "Don't ask again for this project",
202207
"LIVE_DEV_AI_PROMPT_PLACEHOLDER": "Ask Phoenix AI to modify this element...",
203208
"LIVE_PREVIEW_CUSTOM_SERVER_BANNER": "Getting preview from your custom server {0}",
204209
"LIVE_PREVIEW_MODE_PREVIEW": "Preview Mode",

0 commit comments

Comments
 (0)