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.
There are some lines in Bundle.properties not totally clear that should not be localized or part localized - and if they are, the generated test code does not compile since those messages are actually pieces of the code. (Probably should not be in Bundle files if just java code.) I realize some, like //comments may be obvious but those actually doing translating may not know about this. Please review entire bundle file also for other possible ones. TestCreator.variantMethods.defaultBody=fail("The test case is empty."); TestCreator.methodImpl.bodyComment=// fill the body in order toprovide useful implementation PROP_generate_main_method_body_default_value=junit.textui.TestRunner.run(suite()); What about: PROP_properties_default_value=#\n# set properties in format <property_name>=<value>\n#\n TestCreator.suiteMethod.suiteBlock.comment=// if "JUNIT" tags are present, the body will be regenerated each time a suite class is created Mount/java/org-netbeans-modules-junit-junit-library.xml=JUnit 3.8.1
OK - I can fix it for the next release, but I'm afraid I will not do it for this one (it's probably too late, furthermore, the module can be localized, but the translators have to be more careful :-)). Anyway, here are some hints from me: - '//' comments have to be left as comments - only the textual part can be translated - TestCreator.variantMethods.defaultBody - this should be translated to 'fail("localized_the_testcase_is_empy");' - PROP_generate_main_method_body_default_value should not be localized at all - the reason for having this in Bundle.properties is, that the string contained a comment, but in the end it was deleted ... - PROP_properties_default_value - should be localized, but leave the non alphabet characters in the same place they are - TestCreator.suiteMethod.suiteBlock.comment - this property is not used at all in the current code - again the code using it was changed (commented out) in the end. - Mount/java/org-netbeans-modules-junit-junit-library.xml - I would leave this string ('JUnit 3.8.1') as it is, because it is the name of the mounted JUnit library jar. Also JUnit can be considered as a trademark (something like Unix), so I don't think there should be any translation. Will it work for you for this release? I promise I will fix it for the next one ....
Other issues found related to this, Martin suggested make it P1 so could be fixed as is blocking localization. I'm including mail about it here which refers to additional issues High level question - will fixing in junit fix issues or will some changes/do not translate be needed for the core- messages mentioned (and thus need separate bug) ? Item 3 below looks related to others perhaps since its same messages being translated that cause problems ? Date: Thu, 17 Apr 2003 16:55:32 +0200 From: Martin Brehovsky <martin.brehovsky@sun.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ken Frank <Ken.Frank@sun.com> Subject: Re: messages for junit not to be translated Content-Transfer-Encoding: 7bit Ken, I think it's basically the same you already sent in the previous email. Everything I wrote in the previous reply is still valid, so feel free to add 1-1 and 1-2 to the existing bug in issuezilla and please raise it's priority to P1. Just to tell you why we have the problem - there was a miscommunication between me and core folks, who told me the string passed to Executor.find() method should not be localized - it should be rather ID - to my bad luck they were apparently wrong ... The 3rd thing - I really don't know where is the problem. Sorry for that - will have to talk to core developers if it will make any sence to them. B. Ken Frank wrote: > more info from those in japan - please send comments > > I can call you if needed also. > > Ken > > ------------- Begin Forwarded Message ------------- > > Date: Thu, 17 Apr 2003 23:02:02 +0900 > From: Keiichi Oono <keiichi.oono@japan.sun.com> > X-Accept-Language: ja > MIME-Version: 1.0 > To: Ken Frank <kenf@harmonia1.sfbay.sun.com> > CC: keiichi.oono@sun.com, yuko.ohsumi@sun.com > Subject: Re: messages for junit not to be translated > Content-Transfer-Encoding: 7bit > > Hello Ken, > > We have three problems, all problems are in JUnit module. > > 1-1. > String comparison of "Internal Execution" > junit/src/org/netbeans/modules/junit/RunTestAction.java > This java program try to compare hard coded "Internal Execution" string > with the following Bundle message: > modules/autoload/locale/core-execution_ja.jar > org/netbeans/core/execution/beaninfo/Bundle_ja.properties > CTL_ThreadExecutor= Internal Execution > > RunTestAction.java has hard coded "Internal Execution". And this hard > coded string is compared with the above Bundle message. When above > Bundle is translated, The string comparison return false, then the JUnit > can not find the internal executor. > > Workaround: > Back-translate into English the above CTL_ThreadExecutor to match the > hard coded string "Internal Execution" in JUnit module. > > > 1-2. > String comparison of "External Execution" > This is similar problem of 1-1. That Java program also try to compare > hard coded string "External Execution" with the following Bundle > message: > modules/autoload/locale/core-execution_ja.jar > org/netbeans/core/execution/beaninfo/Bundle_ja.properties > CTL_ProcessExecutor= External Execution > > > 3. > When the following messages are translated into Japanese. JUnit module > frequently output the following error: > > "Cannot save ..." > "Invalid lock [org.openide.filesystem.AbstractFileObject$AtLock257cc6] > for file HelloWorldTest.java in /mymodule/test/unit/src with current > lock [null]." > > The messages are here (one is in core-execution and others in junit: > core/execution/src/org/netbeans/core/execution/Bundle.properties > Execution=Execution > junit/src/org/netbeans/modules/junit/Bundle.properties > LBL_executor_internal=Internal > LBL_executor_external=External > LBL_executor_debugger=Debugger > > It's strange, but the above error frequently caused when the above four > messages are translated. I would like to receive any comments from > developer. > > The 1-1, and 1-2 is serious problem for Japanese version, because those > two problems prevent us from translating the following messages.: > modules/autoload/locale/core-execution_ja.jar > org/netbeans/core/execution/beaninfo/Bundle_ja.properties > CTL_ProcessExecutor= External Execution > CTL_ThreadExecutor= Internal Execution > > I want file a bug for 1-1, 1-2 as P2. Because two problems (1-1, 1-2) > are similar, one bug report is good, I think. > As for above #2, I also would like to file a bug as P2. But it may not > an i18n problem. > > Please let me know your any additional questions or suggestions. > Thank you. > Keiichi > > > > > > > Ken Frank wrote: > >>ARe those messages about Executors, when translated, >>from junit or other jar files ? I didnt see those >>words in junit jar file bundles. >> >>Is the problem for any translation of Executor >>words or just when running junit ? >> >>I am finding out more on this now with junit >>developer and will have more info later today. >> >>Ken > > > ------------- End Forwarded Message ------------- > >
Waiting for input from core developers to make sure the fix is clean. Also the other bug mentioned in this issue is being solved as issue #32743 <http://www.netbeans.org/issues/show_bug.cgi?id=32743>
Two items: (#2 might need to be separate issue) 1. I think what I see also related to in 1 and 2 in below report and also I got - when I run with localized junit.jar, and choose on Root Suite the junit->execute, I get message unable to set properties for selected type of executor and cant run the test. 2. I used Debugger executor and chose RootSuite and tools->junit->execute and it ran, but in output window summary words like Errors: Errors logged for the: etc did not come from localized modules/ext/junit-testrunner_zh_CN.jar which does have those messages. (I know some other messages I referred to below came just from junit.org jar, but I assume that these messages were put in junit-testrunner so they wouldl come from our jar file ? Should this be filed as a separate issue ?
On the issue of junit-testrunner messages not coming from locale specific file, I did experiment: 1. add localizing bundle value to manifest file, though dont think that is really needed, but it didnt work, or at least not work until step #2. 2. mounted the locale specific file in file explorer, after mounting the junit-testrunner.jar - that did cause the messages to come from locale specific file -- but I'd also seen when the english one was not mounted the messages were shown, so its not clear if this is required or should be required. (I don't know, in this case, if localizing bundle was needed or just the mounting of it) ==> Is it really needed to mount the english and/or localized junit-testrunner.jar ? that the messages
I already wrote some comments to the separate issue about #2 issue (<http://www.netbeans.org/issues/show_bug.cgi?id=33037>). Concerning the #1 (localized junit not able to set properties) - can you copy/paste the value of the properties from the localized JUnit (Tools -> Options, Testing->JUnit Module Settings, Expert tab, Properties option)? I'm afraid thay might not be in a correct form. By default there are no properties, therefore every line should start with '#' - comment sign. Also can you try to leave just the PROP_properties_default_value in the non-localized form (everything else have localized)? Will it work in this case? Finally, concerning the original P1 (executor settings), I think I have a viable solution, so I'll integrate it today to trunk and send you the fixed junit.jar.
Changing the summary, so it says more exactly what this bug is about.
Created attachment 10061 [details] diff of fix in trunk
Fixed in trunk. Will wait for approval to integrate it to release35 branch.
Ken, can you comment the fix (it is the same thing I sent you on Friday), so the reviewers can approve it for release35?
Confirming that the test .jar file Martin sent me fixed the issues described in this issue (I realize there are >1 issue discussed here) ken.frank@sun.com 04/22/2003
approved for 3.5
Fixed in release35 branch
verified ken.frank@sun.com