Skip to content

Commit 8a57302

Browse files
authored
Make a few hardcoded strings localizable (#79)
Make a few hardcoded strings localizable (#79)
1 parent fc630f7 commit 8a57302

10 files changed

+20
-17
lines changed

extension/src/project/addFile2Project.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ function hasMultipleExtensions(filePath:string):boolean {
8080

8181
async function SelectLspFiles() {
8282
let label = localize("autolispext.project.addfile.openlabel", "Add to Project");
83+
const filterDesc = localize("autolispext.project.addfile.sourcefilefilter", "AutoLISP Source Files");
8384
const options: vscode.OpenDialogOptions = {
84-
//TBD: globalize
8585
canSelectMany: true,
8686
openLabel: label,
87-
filters: {
88-
'Autolisp source files': ['lsp']
89-
}
87+
filters: {}
9088
};
89+
options.filters[filterDesc] = ['lsp'];
9190

9291
let fileUris = await vscode.window.showOpenDialog(options);
9392
if (fileUris && fileUris.length > 0)

extension/src/project/createProject.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ const localize = nls.config({ messageFormat: nls.MessageFormat.file })();
1111

1212
export async function getNewProjectFilePath() {
1313
let label = localize("autolispext.project.createproject.createlabel", "Create");
14+
const filterDesc = localize("autolispext.project.createproject.projectfilter", "AutoLISP Project Files");
1415
const options: vscode.SaveDialogOptions = {
15-
//TBD: globalize
1616
saveLabel: label,
17-
filters: {
18-
'Autolisp project files': ['prj']
19-
}
17+
filters: {}
2018
};
19+
options.filters[filterDesc] = ['prj'];
2120

2221
let fileUri = await vscode.window.showSaveDialog(options);
2322
if (fileUri) {

extension/src/project/icons.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export class IconUris {
2828
public static lspFile(): { light: string | vscode.Uri; dark: string | vscode.Uri } {
2929
if(IconUris.lspFileUri == undefined) {
3030
IconUris.lspFileUri = {
31-
//TBD: update with real icons from PD
3231
"light" : vscode.Uri.file(path.join(IconUris.extRootDir, 'images', 'light', 'LISP_file.svg')),
3332
"dark" : vscode.Uri.file(path.join(IconUris.extRootDir, 'images', 'dark', 'LISP_file.svg'))
3433
};

extension/src/project/openProject.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ export function OpenProjectFile(prjUri: vscode.Uri): ProjectNode {
5555

5656
async function SelectProjectFile() {
5757
let label = localize("autolispext.project.openproject.label", "Open Project");
58+
const filterDesc = localize("autolispext.project.openproject.projectfilter", "AutoLISP Project Files");
5859
const options: vscode.OpenDialogOptions = {
59-
//TBD: globalize
6060
canSelectMany: false,
6161
openLabel: label,
62-
filters: {
63-
'Autolisp project files': ['prj']
64-
}
62+
filters: {}
6563
};
64+
options.filters[filterDesc] = ['prj'];
6665

6766
let fileUri = await vscode.window.showOpenDialog(options);
6867
if (fileUri && fileUri.length > 0){

i18n/enu/out/project/addFile2Project.i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"autolispext.project.addfile.onlylspallowed": "Only LSP files are allowed.",
44
"autolispext.project.addfile.filealreadyexist": "File already exists in this project: ",
55
"autolispext.project.addfile.samenameexist": "File with the same name already exists in this project: ",
6-
"autolispext.project.addfile.openlabel": "Add to Project"
6+
"autolispext.project.addfile.openlabel": "Add to Project",
7+
"autolispext.project.addfile.sourcefilefilter": "AutoLISP Source Files"
78
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"autolispext.project.createproject.createlabel": "Create",
33
"autolispext.project.createproject.onlyprjallowed": "Only PRJ files are allowed.",
4-
"autolispext.project.createproject.nospaces": "Legacy PRJ naming rules do not allow spaces"
4+
"autolispext.project.createproject.nospaces": "Legacy PRJ naming rules do not allow spaces",
5+
"autolispext.project.createproject.projectfilter": "AutoLISP Project Files"
56
}

i18n/enu/out/project/openProject.i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"autolispext.project.openproject.readfailed": "Can't read project file: ",
44
"autolispext.project.openproject.malformedfile": "Malformed project file: ",
55
"autolispext.project.openproject.label": "Open Project",
6-
"autolispext.project.openproject.nospaces": "Legacy PRJ naming rules do not allow spaces"
6+
"autolispext.project.openproject.nospaces": "Legacy PRJ naming rules do not allow spaces",
7+
"autolispext.project.openproject.projectfilter": "AutoLISP Project Files"
78
}

i18n/enu/package.i18n.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"autolispext.description": "This is a vscode extension for AutoCAD AutoLISP",
33
"autolispext.loadcurrentfile.title": "Load File into AutoCAD",
44
"autolispext.openwebhelp.title": "Open Online Help",
5+
"autolispext.regionsnippet.title": "Insert Region",
56
"autolispext.configuration.title": "AutoCAD® AutoLISP configuration",
67
"autolispext.configuration.maxlinechars.desc": "Suggested maximum number of characters to display on each line. Value must be 60 or greater.",
78
"autolispext.configuration.narrowstyleindent.desc": "Indentation value used in the Narrow Formatting Style of function arguments. Value must be in the range of 1 and 6.",
@@ -15,7 +16,9 @@
1516
"autolispext.debug.launchconfig.desc": "user settings for AutoCAD path and startup parameters.",
1617
"autolispext.project.createproject.title": "Create a New Project",
1718
"autolispext.project.openproject.title": "Open an Existing Project",
19+
"autolispext.project.closeproject.title": "Close Project",
1820
"autolispext.project.addfile.title": "Add File to Project",
21+
"autolispext.project.addworkspacefile.title": "Add File to AutoLISP Project",
1922
"autolispext.project.removefile.title": "Remove File from Project",
2023
"autolispext.project.saveproject.title": "Save Project",
2124
"autolispext.project.saveall.title": "Save All",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
{
9797
"command": "autolisp.addWorkspaceFile2Project",
9898
"category": "AutoLISP",
99-
"title": "%autolispext.project.addfile.title%",
99+
"title": "%autolispext.project.addworkspacefile.title%",
100100
"icon": {
101101
"dark": "images/dark/Add_LISP_File.svg",
102102
"light": "images/light/Add_LISP_File.svg"

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"autolispext.project.openproject.title": "Open an Existing Project",
1919
"autolispext.project.closeproject.title": "Close Project",
2020
"autolispext.project.addfile.title": "Add File to Project",
21+
"autolispext.project.addworkspacefile.title": "Add File to AutoLISP Project",
2122
"autolispext.project.removefile.title": "Remove File from Project",
2223
"autolispext.project.saveproject.title": "Save Project",
2324
"autolispext.project.saveall.title": "Save All",

0 commit comments

Comments
 (0)