This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 164358

Summary: I18N: "Go to Source" not working when LBL_At is localized and "at" position is changed
Product: php Reporter: Masaki Katakai <masaki>
Component: PHPUnitAssignee: Tomas Mysik <tmysik>
Status: VERIFIED FIXED    
Severity: blocker CC: jf4jbug, mvanek
Priority: P2 Keywords: I18N
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Masaki Katakai 2009-05-04 05:36:02 UTC
NetBeans IDE 6.7 Beta (Build 200904242137)
Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-133
Mac OS X 10.5.6; UTF8; ja_JP (nb)

These codes may not work properly when LBL_At is localized.
Actually on 6.7 Beta Japanese, "Go to Source" (actionPerformed()
in JumpToCallStackAction.java) is not working.

  php.project/src/org/netbeans/modules/php/project/util/PhpUnit.java

    static final String AT_I18N = NbBundle.getMessage(UnitTestRunner.class, "LBL_At").replace("{0}", ""); // NOI18N
    public static final Pattern LINE_PATTERN = Pattern.compile("(?:" + AT_I18N + ")?(?:.+\\(\\) )?(.+):(\\d+)"); // NOI18N

  php.project/src/org/netbeans/modules/php/project/ui/testrunner/Bundle.properties
    LBL_At=at {0}

  php.project/src/org/netbeans/modules/php/project/ui/testrunner/JumpToCallStackAction.java
    public void actionPerformed(ActionEvent e) {
        Matcher matcher = PhpUnit.LINE_PATTERN.matcher(callstackFrameInfo);
        if (matcher.matches()) {
            String path = matcher.group(1);
            String line = matcher.group(2);
            PhpProjectUtils.openFile(path, Integer.valueOf(line));
        }
    }

It is not good idea that assuming the order of "at" and "{0}"
is the same with English.

at {0}

will be localized into the following in Japanese usually.

{0} <translation of at>

I'd like to suggest the easy solution - is it possible to remove "at"
and just put "filename:line" into the line? Or it is possible to get
just "filename:line" pattern from the strings and ignore the position
of "at"?
Comment 1 Tomas Mysik 2009-05-04 10:04:31 UTC
OK, I will probably remove it. Thanks for reporting.
Comment 2 Tomas Mysik 2009-05-05 15:39:46 UTC
Should be fixed, please verify. Thanks.
http://hg.netbeans.org/web-main/rev/e85b64e75487
Comment 3 Quality Engineering 2009-05-07 08:07:48 UTC
Integrated into 'main-golden', will be available in build *200905070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e85b64e75487
User: Tomas Mysik <tmysik@netbeans.org>
Log: #164358: I18N: "Go to Source" not working when LBL_At is localized and "at" position is changed
Comment 4 Masaki Katakai 2009-05-14 05:35:43 UTC
I've verified it works fine on localized environment.
Thank you very much Tomas, it's great!
Comment 5 Tomas Mysik 2009-05-14 08:51:29 UTC
You are welcome. Thanks for reporting.