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

Bug 277674

Summary: [NLS] objectContribution's in popupMenus left untranslated after first switching of language
Product: [RT] RAP Reporter: Dmitry Pryadkin <drpadawan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: drpadawan
Version: 1.2   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
testcase none

Description Dmitry Pryadkin CLA 2009-05-25 08:03:59 EDT
Build ID: M20090211-1700

Steps To Reproduce:
The extension of org.eclipse.ui.poupMenus has objectContributions. These contributions are to be turned into actions. 

I have an action with a NLS label property. This property is localized in corresponding fragment.

1. Run application.

2. Open browser with English language and see that everything is translated.

3. Change language in browser and restart.

4. See that everything is localized for the new language.

5. Switch language back to English. Clear cookies, etc and restart (or pick another browser).

6. Bug: See that the ObjectContributions are not in English.

7. Restart an application and open browser again, then may continue from #2. This makes me think that something gets cached.


More information:

I've attached a testcase.
Comment 1 Dmitry Pryadkin CLA 2009-05-25 08:04:49 EDT
Created attachment 136999 [details]
testcase
Comment 2 Dmitry Pryadkin CLA 2009-09-30 06:23:25 EDT
I'm not ready to provide a patch. But I can describe this problem further.

The code in ObjectActionContributor involves some caching, thanks to configRead.

I received a stacktrace (see below) from the very first run of the application, with help of breakpointing inside ObjectActionContributor.

During next executions, the breakpoint is not reachable because the configRead was set to true at first time.

I'm not ready to provide a patch, it's not that easy for me yet.

Daemon Thread [UIThread [7B25CB1699283EC75CA7C7014718843A]] (Suspended (breakpoint at line 129 in ActionDescriptor))	
	ActionDescriptor.<init>(IConfigurationElement, int, Object) line: 129	
	ActionDescriptor.<init>(IConfigurationElement, int) line: 103	
	ObjectActionContributor.createActionDescriptor(IConfigurationElement) line: 200	
	ObjectActionContributor(PluginActionBuilder).readElement(IConfigurationElement) line: 162	
	ObjectActionContributor.readElement(IConfigurationElement) line: 279	
	ObjectActionContributor(RegistryReader).readElements(IConfigurationElement[]) line: 144	
	ObjectActionContributor(RegistryReader).readElementChildren(IConfigurationElement) line: 133	
	ObjectActionContributor.readConfigElement() line: 250	
	ObjectActionContributor.isApplicableTo(Object) line: 216	
	ObjectActionContributorManager(ObjectContributorManager).isApplicableTo(List, IObjectContributor) line: 293	
	ObjectActionContributorManager.contributeObjectActions(IWorkbenchPart, IMenuManager, ISelectionProvider) line: 82	
	PopupMenuExtender.addObjectActions(IMenuManager) line: 261	
	PopupMenuExtender.menuAboutToShow(IMenuManager) line: 337	
	MenuManager.fireAboutToShow(IMenuManager) line: 335	
	MenuManager.handleAboutToShow() line: 463	
	MenuManager.access$1(MenuManager) line: 459	
	MenuManager$2.menuShown(MenuEvent) line: 485	
	MenuEvent.dispatchToObserver(Object) line: 66	
	MenuEvent(Event).processEvent() line: 44	
	MenuEvent(TypedEvent).processEvent() line: 128	
	TypedEvent.executeNext() line: 168	
	RWTLifeCycle.readAndDispatch() line: 244	
	Display.readAndDispatch() line: 786	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2403	
	Workbench.runUI() line: 2362	
	Workbench.access$5(Workbench) line: 2213	
	Workbench$4.run() line: 431	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	RealmAdapter.run() line: 44	
	RealmAdapterHook.runWithDefault(Display, Runnable) line: 48	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 434	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 157	
	ApplicationAsClient.createUI() line: 87	
	EntryPointManager.createUI(String) line: 92	
	RWTLifeCycle.createUI() line: 231	
	RWTLifeCycle$UIThreadController.run() line: 119	
	UIThread(Thread).run() line: 619	
	UIThread.run() line: 68
Comment 3 Dmitry Pryadkin CLA 2009-11-13 06:02:48 EST
As I see now, it is solved in 1.3 M3.
Many thanks :)
Comment 4 RĂ¼diger Herrmann CLA 2009-11-17 05:05:19 EST
Though I am not sure how this got fixed (see comment #3), I will mark it as such.
Please re-open if the problem surfaces again.