Skip to content

Commit 8c28f27

Browse files
committed
Fixed l10n messages remaining and updated failing tests
1 parent a24d513 commit 8c28f27

File tree

16 files changed

+64
-42
lines changed

16 files changed

+64
-42
lines changed

nbcode/notebooks/src/org/netbeans/modules/nbcode/java/notebook/CodeEval.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
*
4747
* @author atalati
4848
*/
49-
@NbBundle.Messages({"InterruptCodeCell.exec.success=Code execution stopped successfully",
50-
"InterruptCodeCell.info.msg=Code execution stopped successfully"})
49+
@NbBundle.Messages({
50+
"MSG_InterruptCodeCellExecSuccess=Code execution stopped successfully",
51+
"MSG_InterruptCodeCellInfo=Code execution was interrupted"
52+
})
5153
public class CodeEval {
5254

5355
private static final Logger LOG = Logger.getLogger(CodeEval.class.getName());
54-
private static final String CODE_EXEC_INTERRUPT_SUCCESS_MESSAGE = Bundle.InterruptCodeCell_exec_success();
55-
private static final String CODE_EXEC_INTERRUPTED_MESSAGE = Bundle.InterruptCodeCell_info_msg();
56+
private static final String CODE_EXEC_INTERRUPT_SUCCESS_MESSAGE = Bundle.MSG_InterruptCodeCellExecSuccess();
57+
private static final String CODE_EXEC_INTERRUPTED_MESSAGE = Bundle.MSG_InterruptCodeCellInfo();
5658
private static final Pattern LINEBREAK = Pattern.compile("\\R");
5759

5860
private final Map<String, RequestProcessor> codeExecMap = new ConcurrentHashMap<>();

nbcode/notebooks/src/org/netbeans/modules/nbcode/java/notebook/CustomInputStream.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
*
3333
* @author atalati
3434
*/
35-
@NbBundle.Messages({"GetUserInput.msg=Please provide scanner input here"})
35+
@NbBundle.Messages({
36+
"PROMPT_GetUserInput=Please provide scanner input here"
37+
})
3638
public class CustomInputStream extends InputStream {
3739

3840
private static final Logger LOG = Logger.getLogger(CustomInputStream.class.getName());
3941
private ByteArrayInputStream currentStream;
4042
private final WeakReference<NbCodeLanguageClient> client;
41-
private static final String USER_PROMPT_REQUEST = Bundle.GetUserInput_msg();
43+
private static final String USER_PROMPT_REQUEST = Bundle.PROMPT_GetUserInput();
4244

4345
public CustomInputStream(NbCodeLanguageClient client) {
4446
this.client = new WeakReference<>(client);

nbcode/notebooks/src/org/netbeans/modules/nbcode/java/notebook/NotebookDocumentServiceHandlerImpl.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@
8080
* @author atalati
8181
*/
8282
@ServiceProvider(service = NotebookDocumentServiceHandler.class)
83-
@NbBundle.Messages({"kernel.initializing=Intializing Java kernel for notebook.",
84-
"kernel.initialize.success=Java kernel initialized successfully.",
85-
"kernel.initialize.failed=Error could not initialize Java kernel for the notebook."})
83+
@NbBundle.Messages({
84+
"MSG_KernelInitializing=Intializing Java kernel for notebook",
85+
"MSG_KernelInitializeSuccess=Java kernel initialized successfully.",
86+
"# {0} - error message",
87+
"MSG_KernelInitializeFailed=Java kernel initialization for the notebook failed. Error {0}"
88+
})
8689
public class NotebookDocumentServiceHandlerImpl implements NotebookDocumentServiceHandler {
8790

8891
private static final Logger LOG = Logger.getLogger(NotebookDocumentServiceHandler.class.getName());
@@ -97,13 +100,13 @@ public void didOpen(DidOpenNotebookDocumentParams params) {
97100
if (client == null) {
98101
return;
99102
}
100-
client.showStatusBarMessage(new ShowStatusMessageParams(MessageType.Info, Bundle.kernel_initializing()));
103+
client.showStatusBarMessage(new ShowStatusMessageParams(MessageType.Info, Bundle.MSG_KernelInitializing()));
101104
NotebookSessionManager.getInstance().createSession(params.getNotebookDocument()).whenComplete((JShell jshell, Throwable t) -> {
102105
if (t == null) {
103-
client.showStatusBarMessage(new ShowStatusMessageParams(MessageType.Info, Bundle.kernel_initialize_success()));
106+
client.showStatusBarMessage(new ShowStatusMessageParams(MessageType.Info, Bundle.MSG_KernelInitializeSuccess()));
104107
} else {
105108
// if package import fails user is not informed ?
106-
client.showMessage(new MessageParams(MessageType.Error, Bundle.kernel_initialize_failed()));
109+
client.showMessage(new MessageParams(MessageType.Error, Bundle.MSG_KernelInitializeFailed(t.getMessage())));
107110
LOG.log(Level.SEVERE, "Error could not initialize Java kernel for the notebook. : {0}", t.getMessage());
108111
}
109112
});

nbcode/notebooks/src/org/netbeans/modules/nbcode/java/project/ProjectContext.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@
3939
*
4040
* @author atalati
4141
*/
42-
@NbBundle.Messages({"Select.project.title=Select Project",
43-
"CurrentProjectContext.title=Current project context: ",
44-
"NoProjectFound.msg=No projects found",
45-
"NoProjectContextFound.msg=No project context"})
42+
@NbBundle.Messages({
43+
"PROMPT_SelectProjectTitle=Select Project",
44+
"# {0} - project name",
45+
"LBL_CurrentProjectContext=Current project context: {0}",
46+
"MSG_NoProjectFound=No projects found",
47+
"MSG_NoProjectContextFound=No project context"
48+
})
4649
public class ProjectContext {
4750

4851
public static Project getProject(String uri) {
@@ -92,7 +95,7 @@ private static CompletableFuture<List<Project>> selectFromMultipleProjects(Proje
9295
if (client == null) {
9396
return CompletableFuture.completedFuture(new ArrayList<>());
9497
}
95-
String title = Bundle.Select_project_title();
98+
String title = Bundle.PROMPT_SelectProjectTitle();
9699
List<QuickPickItem> items = new ArrayList<>();
97100
Map<String, Project> prjMap = new HashMap<>();
98101
for (Project prj : prjs) {
@@ -101,8 +104,8 @@ private static CompletableFuture<List<Project>> selectFromMultipleProjects(Proje
101104
prjMap.put(displayName, prj);
102105
items.add(item);
103106
}
104-
String placeholder = defaultPrjSelected != null ? Bundle.CurrentProjectContext_title() + defaultPrjSelected.getName()
105-
: items.isEmpty() ? Bundle.NoProjectFound_msg() : Bundle.NoProjectContextFound_msg();
107+
String placeholder = defaultPrjSelected != null ? Bundle.LBL_CurrentProjectContext(defaultPrjSelected.getName())
108+
: items.isEmpty() ? Bundle.MSG_NoProjectFound() : Bundle.MSG_NoProjectFound();
106109

107110
ShowQuickPickParams params = new ShowQuickPickParams(title, placeholder, false, items);
108111
return client.showQuickPick(params).thenApply(selected -> {

vscode/l10n/bundle.l10n.en.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
"jdk.extension.error_msg.doesntSupportNewTeamplate":"Client {client} doesn't support creating a new file from template",
8989
"jdk.extension.error_msg.doesntSupportNewProject":"Client {client} doesn't support new project",
9090
"jdk.extension.error_msg.doesntSupportGoToTest":"Client {client} doesn't support go to test",
91-
"jdk.extension.error_msg.doesntSupportNoteboookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
91+
"jdk.extension.error_msg.doesntSupportNotebookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
92+
"jdk.extension.error_msg.doesntSupportJShellExecution":"Language Server for {client} doesn't support JShell execution",
9293
"jdk.extension.error_msg.noSuperImpl":"No super implementation found",
9394
"jdk.extension.error_msg.cacheDeletionError":"Error deleting the cache",
9495
"jdk.extension.message.cacheDeleted":"Cache deleted successfully",
@@ -108,15 +109,15 @@
108109
"jdk.notebook.create.error_msg.invalid.notebook.name": "Invalid notebook file name",
109110
"jdk.notebook.create.error_msg.invalid.notebook.path": "A notebook already exists with the same name. Please use a different name or folder.",
110111
"jdk.notebook.create.error_msg.failed": "Failed to create a notebook",
111-
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching Jshell",
112+
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching JShell",
112113
"jdk.notebook.project.mapping.error_msg.failed": "An error occurred while changing the project context of the notebook",
113-
"jdk.notebook.create.new.notebook.input.name": "Enter new Java notebook file name",
114+
"jdk.notebook.create.new.notebook.input.name": "Enter a file name for the new Java notebook",
114115
"jdk.notebook.parsing.empty.file.error_msg.title": "Empty Notebook",
115116
"jdk.notebook.parsing.empty.file.error_msg.desc": "The notebook file appears to be empty.",
116117
"jdk.notebook.parsing.error_msg.title": "Error Opening Notebook",
117118
"jdk.notebook.parsing.error_msg.desc": "Failed to open notebook: {message}",
118119
"jdk.notebook.parsing.invalid.structure.error_msg.title": "Invalid Notebook Structure",
119-
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid `cells` array.",
120+
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid cells array.",
120121
"jdk.notebook.cell.parsing.error_msg.title": "Cell parsing error",
121122
"jdk.notebook.cell.type.error_msg": "Invalid cell type: {cellType}",
122123
"jdk.notebook.cell.missing.error_msg": "Missing field: {fieldName}",

vscode/l10n/bundle.l10n.ja.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
"jdk.extension.error_msg.doesntSupportNewTeamplate":"クライアント{client}では、「テンプレートからファイル新規作成」はサポートされていません",
8989
"jdk.extension.error_msg.doesntSupportNewProject":"クライアント{client}では、新規プロジェクトはサポートされていません",
9090
"jdk.extension.error_msg.doesntSupportGoToTest":"クライアント{client}では、「テストへ移動」はサポートされていません",
91-
"jdk.extension.error_msg.doesntSupportNoteboookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
91+
"jdk.extension.error_msg.doesntSupportNotebookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
92+
"jdk.extension.error_msg.doesntSupportJShellExecution":"Language Server for {client} doesn't support JShell execution",
9293
"jdk.extension.error_msg.noSuperImpl":"スーパークラスの実装が見つかりません",
9394
"jdk.extension.error_msg.cacheDeletionError":"キャッシュの削除中にエラーが発生しました",
9495
"jdk.extension.message.cacheDeleted":"キャッシュが正常に削除されました",
@@ -108,21 +109,21 @@
108109
"jdk.notebook.create.error_msg.invalid.notebook.name": "Invalid notebook file name",
109110
"jdk.notebook.create.error_msg.invalid.notebook.path": "A notebook already exists with the same name. Please use a different name or folder.",
110111
"jdk.notebook.create.error_msg.failed": "Failed to create a notebook",
111-
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching Jshell",
112+
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching JShell",
112113
"jdk.notebook.project.mapping.error_msg.failed": "An error occurred while changing the project context of the notebook",
113-
"jdk.notebook.create.new.notebook.input.name": "Enter new Java notebook file name",
114+
"jdk.notebook.create.new.notebook.input.name": "Enter a file name for the new Java notebook",
114115
"jdk.notebook.parsing.empty.file.error_msg.title": "Empty Notebook",
115116
"jdk.notebook.parsing.empty.file.error_msg.desc": "The notebook file appears to be empty.",
116117
"jdk.notebook.parsing.error_msg.title": "Error Opening Notebook",
117118
"jdk.notebook.parsing.error_msg.desc": "Failed to open notebook: {message}",
118119
"jdk.notebook.parsing.invalid.structure.error_msg.title": "Invalid Notebook Structure",
119-
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid `cells` array.",
120+
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid cells array.",
120121
"jdk.notebook.cell.parsing.error_msg.title": "Cell parsing error",
121122
"jdk.notebook.cell.type.error_msg": "Invalid cell type: {cellType}",
122123
"jdk.notebook.cell.missing.error_msg": "Missing field: {fieldName}",
123124
"jdk.notebook.serializer.error_msg": "Failed to serialize notebook: {errorMessage}",
124125
"jdk.notebook.cell.serializer.error_msg": "Failed to serialize one or more cells",
125126
"jdk.notebook.validation.failed.error_msg": "Notebook JSON validation failed",
126-
"jdk.notebook.mime_type.not.found.cell.output": "Mime Type: {mimeType}\nContent Length: {contentLength}",
127+
"jdk.notebook.mime_type.not.found.cell.output": "Mime Type: {mimeType}, Content Length: {contentLength}",
127128
"jdk.notebook.cell.language.not.found": "Doesn't support {languageId} execution"
128129
}

vscode/l10n/bundle.l10n.zh-cn.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
"jdk.extension.error_msg.doesntSupportNewTeamplate":"客户端 {client} 不支持从模板新建文件",
8989
"jdk.extension.error_msg.doesntSupportNewProject":"客户端 {client} 不支持新项目",
9090
"jdk.extension.error_msg.doesntSupportGoToTest":"客户端 {client} 不支持转至测试",
91-
"jdk.extension.error_msg.doesntSupportNoteboookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
91+
"jdk.extension.error_msg.doesntSupportNotebookCellExecution":"Language Server for {client} doesn't support notebook cell execution",
92+
"jdk.extension.error_msg.doesntSupportJShellExecution":"Language Server for {client} doesn't support JShell execution",
9293
"jdk.extension.error_msg.noSuperImpl":"未找到超类实现",
9394
"jdk.extension.error_msg.cacheDeletionError":"删除高速缓存时出错",
9495
"jdk.extension.message.cacheDeleted":"已成功删除高速缓存",
@@ -108,21 +109,21 @@
108109
"jdk.notebook.create.error_msg.invalid.notebook.name": "Invalid notebook file name",
109110
"jdk.notebook.create.error_msg.invalid.notebook.path": "A notebook already exists with the same name. Please use a different name or folder.",
110111
"jdk.notebook.create.error_msg.failed": "Failed to create a notebook",
111-
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching Jshell",
112+
"jdk.jshell.open.error_msg.failed": "Some error occurred while launching JShell",
112113
"jdk.notebook.project.mapping.error_msg.failed": "An error occurred while changing the project context of the notebook",
113-
"jdk.notebook.create.new.notebook.input.name": "Enter new Java notebook file name",
114+
"jdk.notebook.create.new.notebook.input.name": "Enter a file name for the new Java notebook",
114115
"jdk.notebook.parsing.empty.file.error_msg.title": "Empty Notebook",
115116
"jdk.notebook.parsing.empty.file.error_msg.desc": "The notebook file appears to be empty.",
116117
"jdk.notebook.parsing.error_msg.title": "Error Opening Notebook",
117118
"jdk.notebook.parsing.error_msg.desc": "Failed to open notebook: {message}",
118119
"jdk.notebook.parsing.invalid.structure.error_msg.title": "Invalid Notebook Structure",
119-
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid `cells` array.",
120+
"jdk.notebook.parsing.invalid.structure.error_msg.desc": "Missing or invalid cells array.",
120121
"jdk.notebook.cell.parsing.error_msg.title": "Cell parsing error",
121122
"jdk.notebook.cell.type.error_msg": "Invalid cell type: {cellType}",
122123
"jdk.notebook.cell.missing.error_msg": "Missing field: {fieldName}",
123124
"jdk.notebook.serializer.error_msg": "Failed to serialize notebook: {errorMessage}",
124125
"jdk.notebook.cell.serializer.error_msg": "Failed to serialize one or more cells",
125126
"jdk.notebook.validation.failed.error_msg": "Notebook JSON validation failed",
126-
"jdk.notebook.mime_type.not.found.cell.output": "Mime Type: {mimeType}\nContent Length: {contentLength}",
127+
"jdk.notebook.mime_type.not.found.cell.output": "Mime Type: {mimeType}, Content Length: {contentLength}",
127128
"jdk.notebook.cell.language.not.found": "Doesn't support {languageId} execution"
128129
}

vscode/package.nls.ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"jdk.notebook.addmodules.description": "The specific modules for use in Java notebooks. Defaults to modules of the project context, when empty.",
7474
"jdk.notebook.enablePreview.description": "Enable the use of Java preview features in Java notebooks",
7575
"jdk.notebook.implicitImports.description": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of java.util, java.io and java.math packages, when empty.",
76+
"jdk.notebook.implicitImports.markdownDescription": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of `java.util`, `java.io` and `java.math` packages, when empty.",
7677
"jdk.notebook.projects.mapping.description": "Mapping of Java notebook paths to the path of the project that provides it context.",
7778
"jdk.configuration.java.completion.commit.chars": "コード補完の提案の受入れをトリガーする文字を指定します。たとえば、ピリオド(.)を入力したときに提案を受け入れるには、これを[\".\"]に設定します",
7879
"jdk.initialConfigurations.launchJavaApp.name": "Javaアプリケーションの起動",

vscode/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"jdk.notebook.addmodules.description": "The specific modules for use in Java notebooks. Defaults to modules of the project context, when empty.",
7474
"jdk.notebook.enablePreview.description": "Enable the use of Java preview features in Java notebooks",
7575
"jdk.notebook.implicitImports.description": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of java.util, java.io and java.math packages, when empty.",
76+
"jdk.notebook.implicitImports.markdownDescription": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of `java.util`, `java.io` and `java.math` packages, when empty.",
7677
"jdk.notebook.projects.mapping.description": "Mapping of Java notebook paths to the path of the project that provides it context.",
7778
"jdk.configuration.java.completion.commit.chars": "Specifies the characters that trigger accepting a code completion suggestion. For example, to accept suggestions when typing a dot (.), set this to [\".\"]",
7879
"jdk.initialConfigurations.launchJavaApp.name": "Launch Java App",

vscode/package.nls.zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"jdk.notebook.addmodules.description": "The specific modules for use in Java notebooks. Defaults to modules of the project context, when empty.",
7474
"jdk.notebook.enablePreview.description": "Enable the use of Java preview features in Java notebooks",
7575
"jdk.notebook.implicitImports.description": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of java.util, java.io and java.math packages, when empty.",
76+
"jdk.notebook.implicitImports.markdownDescription": "List of elements to implicitly import in Java notebooks. Defaults to star-imports of `java.util`, `java.io` and `java.math` packages, when empty.",
7677
"jdk.notebook.projects.mapping.description": "Mapping of Java notebook paths to the path of the project that provides it context.",
7778
"jdk.configuration.java.completion.commit.chars": "指定用于触发接受代码补全建议的字符。例如,要在键入点 (.) 时接受建议,请将该字符设为 [\".\"]",
7879
"jdk.initialConfigurations.launchJavaApp.name": "启动 Java 应用程序",

0 commit comments

Comments
 (0)