Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 441831

Summary: "Syntax error on token" message unexternalized
Product: [ECD] Orion Reporter: Kit Lo <kitlo>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: baochlin, gpclark, keithc, mamacdon, Michael_Rennie
Version: unspecified   
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
WSW44.js
none
441831_01
none
Simplified Chinese screenshot
none
PSSI screenshot
none
441831_01_fixed_7.0.0.v20140904-0231.png none

Description Kit Lo CLA 2014-08-15 00:46:30 EDT
I found the following message hard-code in org.eclipse.orion.client.javascript\web\javascript\validator.js:
Line 182 - error.message = msg = "Syntax error on token '"+token.value+"', delete this token.";
Comment 1 Keith Chuang CLA 2014-08-15 02:15:44 EDT
Created attachment 246021 [details]
WSW44.js
Comment 2 Keith Chuang CLA 2014-08-15 02:16:58 EDT
(In reply to Kit Lo from comment #0)
> I found the following message hard-code in
> org.eclipse.orion.client.javascript\web\javascript\validator.js:
> Line 182 - error.message = msg = "Syntax error on token '"+token.value+"',
> delete this token.";



Adding extra comments for Kit:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/diff/bundles/org.eclipse.orion.client.javascript/web/javascript/validator.js?id=53a10417a290393c80af80ba7e54ebc843a0f26e

+ if(error.type) {
+ switch(error.type) {
+ case ASTManager.ErrorTypes.Unexpected:
+ error.message = msg = "Syntax error on token '"+token.value+"', delete this token.";
+ break;
+ case ASTManager.ErrorTypes.EndOfInput:
+ error.message = "Syntax error, incomplete statement.";
+ break;
+ }
+ }




Build label:
Version 4.4.1 Build ID:  7.0.0.v20140813-1903

Steps to recreate problem:
Log in the Orion(https://orionhub.org)
Click Editor icon at side bar
Create a Folder
Import WSW44.js
Hover over the error icon at line 30


Problem description:
"Syntax error, incomplete statement." is not externalized


Expected result:
"Syntax error, incomplete statement." should be externalized


PII Information:
N/A
Comment 3 Keith Chuang CLA 2014-08-15 02:18:13 EDT
Created attachment 246022 [details]
441831_01
Comment 5 George Clark CLA 2014-08-28 15:36:10 EDT
Below is the PII information, and instructions on how to recreate the issue. We see the strings in the PII returns, but not in the builds, perhaps there is some issue with the strings being picked up after the code fix?

PII information:
WSW44AAP001\eclipse\plugins\org.eclipse.orion.client.ui\web\orion\settings\nls\root\messages.js
'syntaxErrorIncomplete': 'Syntax error, incomplete statement.',  //$NON-NLS-0$  //$NON-NLS-1$

Steps to reproduce:

1.Click Editor icon  at left side bar
2.Click WSW44.js 
3.Hover over the error icon at line 30

Simplified Chinese:
441831_CHS.jpg
PSSI build:
441831_PSSI.jpg
Comment 6 George Clark CLA 2014-08-28 15:38:30 EDT
Created attachment 246511 [details]
Simplified Chinese screenshot
Comment 7 George Clark CLA 2014-08-28 15:38:54 EDT
Created attachment 246512 [details]
PSSI screenshot
Comment 8 Keith Chuang CLA 2014-08-29 02:39:47 EDT
Hi Kit,
As this problem is not fixed yet, please help reopen the bug. thank you.
Comment 9 Michael Rennie CLA 2014-08-29 13:30:40 EDT
(In reply to Keith Chuang from comment #8)
> Hi Kit,
> As this problem is not fixed yet, please help reopen the bug. thank you.

The JS tools side of the problem is fixed. If the strings are not being picked up properly that means there is a problem with the translation / translation build.
Comment 10 Mark Macdonald CLA 2014-09-02 09:46:36 EDT
validator.js is trying to load the translated strings directly, when it should be leaving this up to the display-time code (syntaxchecker.js). This will cause the English localization to always be shown on parser syntax errors. Reopening..
Comment 11 Mark Macdonald CLA 2014-09-02 10:43:01 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=feb53d5

I verified this against the French JS language pack -- the error messages are translated now.
Comment 12 Keith Chuang CLA 2014-09-05 03:06:13 EDT
(In reply to Mark Macdonald from comment #11)
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> ?id=feb53d5
> 
> I verified this against the French JS language pack -- the error messages
> are translated now.

Verified in 7.0.0.v20140904-0231, the string is mocked. Thanks for the fix.
Comment 13 Keith Chuang CLA 2014-09-05 03:07:28 EDT
Created attachment 246754 [details]
441831_01_fixed_7.0.0.v20140904-0231.png