Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Value returned by IConfigurationElement.getAttribute() was not translated
Value returned by IConfigurationElement.getAttribute() was not translated [message #331072] Sat, 23 August 2008 03:13 Go to next message
yau is currently offline yauFriend
Messages: 14
Registered: July 2009
Junior Member
Hi!

I'm using Eclipse 3.4. I have a plugin, it defines an extension, as below:

<extension
id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
point="net.yau.test.extensionreg">
<net.yau.test.extensionreg.test
class="net.yau.test.extensionreg.cosumer.TestObjImpl"
id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
name="%consumerName">
<description>
The description
</description>
</net.yau.test.extensionreg.test>
</extension>

The attribute in the "name" attribute of the element
"net.yau.test.extensionreg.test" are translated in plugin.properties.
IDE also displays the correct translation in plugin.xml editor(in the
Extensions page). So I think the translation in plugin.properties is OK.

But in the application, when I do:

....
IExtension[] exArr = ep.getExtensions();

if (exArr.length > 0) {
IExtension ex = exArr[0];
IConfigurationElement[] elmts = ex.getConfigurationElements();
if (elmts.length > 0) {
IConfigurationElement elmt = elmts[0];
return elmt.getAttribute("name");
}
}


The return value is "%consumerName", not the value translated by
plugin.properties.(Plugin developer guide said: Note that any translation
specified in the plug-in manifest file is automatically applied. ).

The fragment of my MANIFEST.MF of the extension point definition bundle:
===========================================
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.update.configurator;bundle-version="3.2.200"

===========================================

The fragment of my MANIFEST.MF of the extension definition bundle:
===========================================
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
net.yau.test.extensionreg.master;bundle-version="1.0.0"
===========================================

Is the problem due to missing some bundle?

Yau
Re: Value returned by IConfigurationElement.getAttribute() was not translated [message #331075 is a reply to message #331072] Sat, 23 August 2008 06:40 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
In the Schema of net.yau.test.extensionreg.test, the translatable should
be set to true for the name atribute

- Prakash

www.eclipse-tips.com


yau wrote:
> Hi!
>
> I'm using Eclipse 3.4. I have a plugin, it defines an extension, as below:
>
> <extension
> id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
> point="net.yau.test.extensionreg">
> <net.yau.test.extensionreg.test
> class="net.yau.test.extensionreg.cosumer.TestObjImpl"
> id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
> name="%consumerName">
> <description>
> The description
> </description>
> </net.yau.test.extensionreg.test>
> </extension>
>
> The attribute in the "name" attribute of the element
> "net.yau.test.extensionreg.test" are translated in plugin.properties.
> IDE also displays the correct translation in plugin.xml editor(in the
> Extensions page). So I think the translation in plugin.properties is OK.
>
> But in the application, when I do:
>
> ...
> IExtension[] exArr = ep.getExtensions();
>
> if (exArr.length > 0) {
> IExtension ex = exArr[0];
> IConfigurationElement[] elmts = ex.getConfigurationElements();
> if (elmts.length > 0) {
> IConfigurationElement elmt = elmts[0];
> return elmt.getAttribute("name");
> }
> }
>
>
> The return value is "%consumerName", not the value translated by
> plugin.properties.(Plugin developer guide said: Note that any translation
> specified in the plug-in manifest file is automatically applied. ).
>
> The fragment of my MANIFEST.MF of the extension point definition bundle:
> ===========================================
> Require-Bundle: org.eclipse.ui,
> org.eclipse.core.runtime,
> org.eclipse.update.configurator;bundle-version="3.2.200"
>
> ===========================================
>
> The fragment of my MANIFEST.MF of the extension definition bundle:
> ===========================================
> Require-Bundle: org.eclipse.ui,
> org.eclipse.core.runtime,
> net.yau.test.extensionreg.master;bundle-version="1.0.0"
> ===========================================
>
> Is the problem due to missing some bundle?
>
> Yau
>
>
Re: Value returned by IConfigurationElement.getAttribute() was not translated [message #331076 is a reply to message #331075] Sat, 23 August 2008 06:47 Go to previous messageGo to next message
yau is currently offline yauFriend
Messages: 14
Registered: July 2009
Junior Member
I already do this:
==================================
<attribute name="name" type="string">
<annotation>
<documentation>

</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>

==================================

"Prakash G.R." <grprakash@gmail.com>
??????:g8obc9$has$1@build.eclipse.org...
> In the Schema of net.yau.test.extensionreg.test, the translatable should
> be set to true for the name atribute
>
> - Prakash
>
> www.eclipse-tips.com
>
>
> yau wrote:
>> Hi!
>>
>> I'm using Eclipse 3.4. I have a plugin, it defines an extension, as
>> below:
>>
>> <extension
>>
>> id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
>> point="net.yau.test.extensionreg">
>> <net.yau.test.extensionreg.test
>> class="net.yau.test.extensionreg.cosumer.TestObjImpl"
>>
>> id=" net.yau.test.extensionreg.cosumer.net.yau.test.extensionreg. consumerID "
>> name="%consumerName">
>> <description>
>> The description
>> </description>
>> </net.yau.test.extensionreg.test>
>> </extension>
>>
>> The attribute in the "name" attribute of the element
>> "net.yau.test.extensionreg.test" are translated in plugin.properties.
>> IDE also displays the correct translation in plugin.xml editor(in the
>> Extensions page). So I think the translation in plugin.properties is OK.
>>
>> But in the application, when I do:
>>
>> ...
>> IExtension[] exArr = ep.getExtensions();
>>
>> if (exArr.length > 0) {
>> IExtension ex = exArr[0];
>> IConfigurationElement[] elmts = ex.getConfigurationElements();
>> if (elmts.length > 0) {
>> IConfigurationElement elmt = elmts[0];
>> return elmt.getAttribute("name");
>> }
>> }
>>
>>
>> The return value is "%consumerName", not the value translated by
>> plugin.properties.(Plugin developer guide said: Note that any translation
>> specified in the plug-in manifest file is automatically applied. ).
>>
>> The fragment of my MANIFEST.MF of the extension point definition bundle:
>> ===========================================
>> Require-Bundle: org.eclipse.ui,
>> org.eclipse.core.runtime,
>> org.eclipse.update.configurator;bundle-version="3.2.200"
>>
>> ===========================================
>>
>> The fragment of my MANIFEST.MF of the extension definition bundle:
>> ===========================================
>> Require-Bundle: org.eclipse.ui,
>> org.eclipse.core.runtime,
>> net.yau.test.extensionreg.master;bundle-version="1.0.0"
>> ===========================================
>>
>> Is the problem due to missing some bundle?
>>
>> Yau
Re: Value returned by IConfigurationElement.getAttribute() was not translated [message #331397 is a reply to message #331076] Thu, 04 September 2008 17:57 Go to previous messageGo to next message
Anne Brinkman is currently offline Anne BrinkmanFriend
Messages: 2
Registered: July 2009
Junior Member
Yau, any luck figuring this out? I just ran into this behavior myself,
also marking the field in question as translatable--doesn't translate
though. Also 3.4.
Re: Value returned by IConfigurationElement.getAttribute() was not translated [message #331400 is a reply to message #331397] Thu, 04 September 2008 18:19 Go to previous message
Anne Brinkman is currently offline Anne BrinkmanFriend
Messages: 2
Registered: July 2009
Junior Member
I think I just figured this out. I was missing a line in my Manifest.mf
file. I added "Bundle-Localization: plugin" add now it's retrieving the
values fine.
Previous Topic:[Databinding] Example Application showing Databinding, EMF, Teneo and CDO in action
Next Topic:Menu extensions
Goto Forum:
  


Current Time: Sun Jun 30 19:33:37 GMT 2024

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

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

Back to the top