Bug 249418 - Internationalization of plugin.properties does not work.
Summary: Internationalization of plugin.properties does not work.
Status: RESOLVED INVALID
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-10-01 19:49 EDT by A. Salzborn CLA
Modified: 2008-10-23 06:41 EDT (History)
1 user (show)

See Also:


Attachments
screenshot of localized perspective switcher (3.99 KB, image/png)
2008-10-23 06:40 EDT, Frank Appel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description A. Salzborn CLA 2008-10-01 19:49:42 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Create file plugin.properties in a plugin which contributes for example a perspective or view. The label of the view or perspective must be translated there with a key, for example "%myLabel".
2. Ensure, that plugin.properties is included in build (see build.properties).
2. Then run and open your RAP application in a internet browser of your choice.
3. Check translation of the label of your view or perspective: Then you will see, that there is still the key (with "%" as prefix).


More information:
Internationalization of plugin.properties or plugin_<locale>.properties does not work in Rich Ajax Platform applications.

I checked the source code of org.eclipse.core.internal.registry.ConfigurationElement: The method getAttribute(String name) does directly call getAttributeAsIs(String name) and does not translate anything.
Comment 1 A. Salzborn CLA 2008-10-01 19:52:55 EDT
Thank you.

Andreas
Comment 2 Andreas Salzborn CLA 2008-10-01 19:58:53 EDT
Added my new e-mail address to CC.
Comment 3 Rüdiger Herrmann CLA 2008-10-20 06:35:06 EDT
Did you follow the steps described here:
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.rap.help/help/html/advanced/internationalization.html
Comment 4 Andreas Salzborn CLA 2008-10-22 10:40:27 EDT
Thank you, after adding "Bundle-Localization: plugin" to the manifest, it works for views but not for perspectives. It works not for perspectives, because they are "translatet" at startup without a (locale sensitive) session.

Do you solve this issue in future versions of RAP?


Thank you,

Andreas
Comment 5 Rüdiger Herrmann CLA 2008-10-22 10:45:33 EDT
(In reply to comment #4)
> Thank you, after adding "Bundle-Localization: plugin" to the manifest, it works
> for views but not for perspectives. It works not for perspectives, because they
> are "translatet" at startup without a (locale sensitive) session.
This is new to me. Where do you have this information from?

> 
> Do you solve this issue in future versions of RAP?
Comment 6 Andreas Salzborn CLA 2008-10-23 04:59:02 EDT
I read this information from source code (see snippet below) and confirmed the behaviour during remote debuging. The perspective descriptors are translatet to early, were no user session is available. If no user session is available, then a language can not be determined.

Snippet from org.eclipse.core.internal.registry.ConfigurationElement (v1.1, Plugin org.eclipse.rap.equiniox.registry):
==================================================================
	public String getAttribute(String attrName) {
// TODO [fappel]: We avoided translation at startup, since RAP needs
//		          request/session aware translation mechanism. So we are 
//                doing translation now. 
		String symbolicName = getContributor().getName();
		String attribute = getAttributeAsIs( attrName );
        return RegistryFactory.translate( attribute, symbolicName );
	}
==================================================================

Quote: "[...] We avoided translation at startup[...]"
Comment 7 Frank Appel CLA 2008-10-23 06:40:37 EDT
Created attachment 115906 [details]
screenshot of localized perspective switcher
Comment 8 Frank Appel CLA 2008-10-23 06:40:54 EDT
I can't reproduce this. Perspective labels are translated session aware as the attached screenshot shows. The example is the current version of the RMS demo. The code is available from the sandbox component in CVS.
Comment 9 Frank Appel CLA 2008-10-23 06:41:57 EDT
Can't reproduce. Feel free to re-open if you can provide more information