Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » use bundle.properties file from another plugin(How can I use a bundle.properties from another plugin?)
use bundle.properties file from another plugin [message #524146] Tue, 30 March 2010 22:50 Go to next message
Eugene  is currently offline Eugene
Messages: 25
Registered: July 2009
Junior Member
Hello all,

I have the following plugin structure:

plugin A
plugin B (depends on A)

so A defines a menu called "X Menu" and B Defines a view Called "X View"

What I would like to do is to make X a translateable string. By following the "externalize strings" wizard, I am able to externalize the string, however the wizard creates a bundle.properties file in plugin A.

By creating the bundle.properties file in plugin A, I am going to affect all children of A by making changes to the bundle.properties file.

This is undesireable. What I would really like is to have the plugin which specified the product, to define a bundle.properties file, in a sense, I want this bundle.properties file to be something dynamic, rather than hard coded in the build.properties file of plugin A.

Does anyone have any suggestions?
Re: use bundle.properties file from another plugin [message #524309 is a reply to message #524146] Wed, 31 March 2010 13:48 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 427
Registered: July 2009
Senior Member
Are you referring to the strings translated in your plugin.xml? If so then the bundle.properties (plugin.properties is the default name I thought) is specific to the bundle it is contained in (bundle A). Bundle B can have its own bundle.properties that is only used to translate its extensions defined in its own plugin.xml file.

Fragments are typically used to deliver additional properties files for other languages (e.g. bundle_fr_FR.properties). The extension registry uses the same translation files as the bundle manifest localization. See section 3.10.2 "Manifest Localization" from the OSGi Core Specification for more information.

Tom.
Re: use bundle.properties file from another plugin [message #524377 is a reply to message #524309] Wed, 31 March 2010 17:17 Go to previous messageGo to next message
Eugene  is currently offline Eugene
Messages: 25
Registered: July 2009
Junior Member
Yes,

I am referring to strings translated in the plugin.xml

It is quite unfortunate that there is no way to provide an alternate .properties file from another plugin to be used.
Re: use bundle.properties file from another plugin [message #524598 is a reply to message #524377] Thu, 01 April 2010 09:56 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

As Tom mentioned, you can use a fragment to supply the actual properties
file. If product 1 includes fragment A1 and product 2 includes fragment
A2 then you will have a different menu label used per-product. Is that
what you are trying to do?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: use bundle.properties file from another plugin [message #524673 is a reply to message #524598] Thu, 01 April 2010 18:34 Go to previous messageGo to next message
Eugene  is currently offline Eugene
Messages: 25
Registered: July 2009
Junior Member
Before I officially reply to your suggestion let make sure we're on the same page. To rephrase my original query, we have 30+ plugins that all use the same string "X" and we would like to avoid having to have either 30 plugin.properties files or 30 fragments to replace "X" with some other string "Y" everywhere "X" occurs.

so basically we want one place to specify the value of the replacement for "X"
Re: use bundle.properties file from another plugin [message #524676 is a reply to message #524673] Thu, 01 April 2010 18:44 Go to previous message
Thomas Watson is currently offline Thomas Watson
Messages: 427
Registered: July 2009
Senior Member
There is nothing available to do what you are suggesting. We have the same issue in most all of our bundles where our provider string is identical for all bundles included in the Eclipse SDK. We currently duplicate the string in each bundle.
Previous Topic:Drools and OSGi
Next Topic:Start equinox using jar
Goto Forum:
  


Current Time: Mon Sep 22 04:22:45 GMT 2014

Powered by FUDForum. Page generated in 0.03594 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software