Bug 215116 - externalize Mylyn UI Strings, Labels, Messages to support internationalization
Summary: externalize Mylyn UI Strings, Labels, Messages to support internationalization
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.2   Edit
Hardware: PC All
: P1 enhancement with 5 votes (vote)
Target Milestone: 3.1   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
: 212317 261583 (view as bug list)
Depends on: 241848 245191 252531 253052 253053 253116 253117 253118 253119 253120 253121 253122 253123 253124 253125 253126 253128 253129 253130 254822 254866 254867 254868 254949 257651 257817
Blocks:
  Show dependency tree
 
Reported: 2008-01-12 11:50 EST by Christian Stellwag CLA
Modified: 2009-01-19 22:05 EST (History)
7 users (show)

See Also:


Attachments
path (128.01 KB, patch)
2008-04-03 15:44 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (1.97 KB, application/octet-stream)
2008-04-03 15:44 EDT, Frank Becker CLA
no flags Details
screenshot.png (740.68 KB, image/png)
2008-10-23 10:15 EDT, Hiroyuki CLA
no flags Details
org.eclipse.mylyn.team.cvs.patch (7.96 KB, patch)
2008-10-27 10:02 EDT, Hiroyuki CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Stellwag CLA 2008-01-12 11:50:26 EST
I suggest to externalize all Strings, Labels, Messages ...  into properties-files so Mylyn UI could be internationalized.

I offer to contribute a german translation pack.
Comment 1 Mik Kersten CLA 2008-01-15 22:25:09 EST
Christian: thanks for the offer.  We will definitely take you up on it once the externalization is done.

Steffen: I'm putting this in your 3.0 pile for now.
Comment 2 Kenan YAZICI CLA 2008-02-23 13:54:04 EST
In addition to that, can the language option be in the "Additional Settings", like we have in Bugzilla for EN and DE, for other languages and for JIRA too. And this may require another properties file that will store the language options, so Mylyn can fetch the languages from that file. So when some one needs to add a language to Mylyn he opens that file and adds the language option and the required file to the relative directory.

For example when I need to add Turkish I open the "languages.properties" file 
and add

"TURKISH = TR" 

line then add the "turkish.properties" file to the directory(File names may vary as you may need different files for diffent repositories, like turkish-jira.properties, turkish-bugzilla.properties,... etc.). So when I restart the Eclipse, Mylyn would show the TR in the dropdown box in the "Additional Settings" of the repository.

Anyway, I offer to contribute translation for Turkish if you decide to externalize.
Comment 3 Frank Becker CLA 2008-04-03 15:29:59 EDT
Rob,

I start with org.eclipse.mylyn.bugzilla.ui. 

First Version is comming soon.
Comment 4 Frank Becker CLA 2008-04-03 15:44:16 EDT
Created attachment 94773 [details]
path

For this first try I must detect for every String if

a) to Externalize
or
b) to Ignore

Hope that i made the right decisions :-)
Comment 5 Frank Becker CLA 2008-04-03 15:44:18 EDT
Created attachment 94774 [details]
mylyn/context/zip
Comment 6 Robert Elves CLA 2008-04-03 18:31:48 EDT
This is looking right Frank. Is it possible to use a single Messages.java and messages.properties for the entire plugin (vs duplication)?  If there isn't tool support for this it might need to be manually merged?
Comment 7 Frank Becker CLA 2008-04-04 11:33:40 EDT
 (In reply to comment #6)
> This is looking right Frank. Is it possible to use a single Messages.java and
> messages.properties for the entire plugin (vs duplication)?  If there isn't tool
> support for this it might need to be manually merged?

Yes we can have a single Messages.java, but this means that we must create an extra package or select an existing.

For the plugin org.eclipse.mylyn.bugzilla.ui we can use the existing org.eclipse.mylyn.internal.bugzilla.ui for all packages.

Or do you think it is better to have a package (org.eclipse.mylyn.bugzilla.ui) named like the plugin.
Comment 8 Steffen Pingel CLA 2008-04-07 16:45:03 EDT
Thanks for the patch Frank. I noticed that it uses strings as message keys. In Eclipse 3.4 there is a checkbox in the externalization dialog "Use Eclipse's string externalization mechanism" which creates a class with static fields for externalization. Most other Eclipse projects that I have looked at do it that way and it probably make sense to be consistent and also use that mechanism.

Having multiple message.properties files (i.e. one per package) seems to be the way platform does it so my sense is that we should go with that as well. 

From looking at the patch what concerns me most that instead of having strings that make it straight forward to make a connection from the UI to the corresponding code, e.g. by searching the code for "Create query from URL", the text is now replaced by cryptic keys, e.g. "BugzillaCustomQueryWizardPage.2". I saw that platform uses keys Create_query_from_URL which is still not as good as having the original text but seems better than the numbered keys. Frank, do you know if there is tool support to create more meaningful keys or is that a manual process?

Getting the externalization for Mylyn 3.0 would be very valuable for the project. Unfortunately the patch exceeds the size of contributions that we can accept without going through a review process by the Eclipse foundation. I will contact Eclipse legal to figure out what the easiest/fastest way to consume patches for externalization and will comment here how to proceed once I hear back.
Comment 9 Frank Becker CLA 2008-04-08 01:08:33 EDT
(In reply to comment #8)
> Thanks for the patch Frank. I noticed that it uses strings as message keys. In
> Eclipse 3.4 there is a checkbox in the externalization dialog "Use Eclipse's
> string externalization mechanism" which creates a class with static fields for
> externalization. Most other Eclipse projects that I have looked at do it that
> way and it probably make sense to be consistent and also use that mechanism.

Yes, maybe I only mist to set the checkbox.

> From looking at the patch what concerns me most that instead of having strings
> that make it straight forward to make a connection from the UI to the
> corresponding code, e.g. by searching the code for "Create query from URL", the
> text is now replaced by cryptic keys, e.g. "BugzillaCustomQueryWizardPage.2". I
> saw that platform uses keys Create_query_from_URL which is still not as good as
> having the original text but seems better than the numbered keys. Frank, do you
> know if there is tool support to create more meaningful keys or is that a
> manual process?

Yes, you must clear the common prefix and the you have to enter a value for every String that you want to be external.


Comment 10 Hiroyuki CLA 2008-10-23 10:08:33 EDT
Hi

I starting String externalization of Mylyn 3.0.2.

First step: [Completed]
  String externalization of plugin.xml and manifest.mf
  Target: Mylyn 3.0.2 (SDK, Extras and Incubotor)

Second step: [Now]
  String externalization in Java code
 (Menu, Dialog, Message, etc)

Time is necessary by there are a lot of numbers of source file.
The following making to String externalization has been done. 

org.eclipse.mylyn
org.eclipse.mylyn.bugzilla.core
org.eclipse.mylyn.bugzilla.ide
org.eclipse.mylyn.bugzilla.ui
org.eclipse.mylyn.commons.core
org.eclipse.mylyn.commons.net
org.eclipse.mylyn.commons.ui
org.eclipse.mylyn.compatibility
org.eclipse.mylyn.context.core
org.eclipse.mylyn.help.ui
org.eclipse.mylyn.ide.ant
org.eclipse.mylyn.ide.ui
org.eclipse.mylyn.java.tasks
org.eclipse.mylyn.java.ui
org.eclipse.mylyn.pde.ui
org.eclipse.mylyn.tasks.ui
org.eclipse.mylyn.team.cvs

The translation and making to the fragmentation to Japanese are executed at the same time. 

org.eclipse.mylyn.nl1
org.eclipse.mylyn.bugzilla.core.nl1
org.eclipse.mylyn.bugzilla.ide.nl1
org.eclipse.mylyn.bugzilla.ui.nl1
org.eclipse.mylyn.commons.core.nl1
org.eclipse.mylyn.commons.net.nl1
org.eclipse.mylyn.commons.ui.nl1
org.eclipse.mylyn.compatibility.nl1
org.eclipse.mylyn.context.core.nl1
org.eclipse.mylyn.help.ui.nl1
org.eclipse.mylyn.ide.ant.nl1
org.eclipse.mylyn.ide.ui.nl1
org.eclipse.mylyn.java.tasks.nl1
org.eclipse.mylyn.java.ui.nl1
org.eclipse.mylyn.pde.ui.nl1
org.eclipse.mylyn.tasks.ui.nl1
org.eclipse.mylyn.team.cvs.nl1




Comment 11 Hiroyuki CLA 2008-10-23 10:15:25 EDT
Created attachment 115934 [details]
screenshot.png

This screenshot is Mylyn screen while working. 
The string in the Mylyn screen is translated Japanese. 
It is executed on Windows Vista Japanese + Eclipse 3.4.1
Comment 12 Hiroyuki CLA 2008-10-23 10:33:53 EDT
It works though it made to the externalization by using the PDE function
by the following rules. 

- The string externalization is limited to the text that can be translated. 
  EX) The figures are not targeted. 

- The character string used for StatusHandler.log, StatusHandler.fail
  and Exception is not targeted. 

- The key name is made an original character string of the capital letter. 
  EX)

  BugzillaAttribute.CLASSIFICATION_ID=Classification ID:
  BugzillaAttribute.VERSION_OF_BUGZILLA_INSTALLED=version of bugzilla installed

- The Message class is made for the unit of the package.

- A special character is not included in the external string as much as
  possible. A special character is written in the Java code. 

- The Java code is repaired if necessary. 
  EX) Layout mistake
Comment 13 Steffen Pingel CLA 2008-10-23 18:39:53 EDT
The screenshot looks great! I have contacted the Eclipse legal department to clarify whether we can accept externalization patches as contributions. It's probably best to hold off with further changes until that has been resolved. It would be unfortunate if we wouldn't be able to merge the externalization back into the code base.
Comment 14 Hiroyuki CLA 2008-10-26 07:43:20 EDT
The patch for Mylyn R_3_0_2 was made (excluding incubator).
The size of the file only have to be large and up-load it here?

Mylyn 3.0.2
169,740  	org.eclipse.mylyn.bugzilla.core.patch
3,788    	org.eclipse.mylyn.bugzilla.ide.patch
123,519  	org.eclipse.mylyn.bugzilla.ui.patch
19,147  	org.eclipse.mylyn.commons.core.patch
72,882  	org.eclipse.mylyn.commons.net.patch
53,468  	org.eclipse.mylyn.commons.ui.patch
7,988    	org.eclipse.mylyn.compatibility.patch
47,222  	org.eclipse.mylyn.context.core.patch
133,876  	org.eclipse.mylyn.context.ui.patch
9,486    	org.eclipse.mylyn.help.ui.patch
15,698  	org.eclipse.mylyn.ide.ant.patch
14,442  	org.eclipse.mylyn.ide.ui.patch
12,568  	org.eclipse.mylyn.java.tasks.patch
74,782  	org.eclipse.mylyn.java.ui.patch
37,849  	org.eclipse.mylyn.monitor.core.patch
23,245  	org.eclipse.mylyn.monitor.ui.patch
1,882    	org.eclipse.mylyn.patch
29,428  	org.eclipse.mylyn.pde.ui.patch
29,129  	org.eclipse.mylyn.resources.ui.patch
45,168  	org.eclipse.mylyn.tasks.bugs.patch
220,386 	org.eclipse.mylyn.tasks.core.patch
820,320 	org.eclipse.mylyn.tasks.ui.patch
8,149    	org.eclipse.mylyn.team.cvs.patch
62,986   	org.eclipse.mylyn.team.ui.patch

Mylyn 3.0.2 Extras
735,865 	org.eclipse.mylyn.jira.core.patch
 69,901  	org.eclipse.mylyn.jira.ui.patch
121,668	org.eclipse.mylyn.trac.core.patch
 54,886  	org.eclipse.mylyn.trac.ui.patch

Note; There is a possibility that the mistake has been occurred by work.
Comment 15 Steffen Pingel CLA 2008-10-26 13:40:12 EDT
Can you attach one of the smaller patches, e.g. for org.eclipse.mylyn.team.cvs.patch?
Comment 16 Hiroyuki CLA 2008-10-27 10:02:11 EDT
Created attachment 116181 [details]
org.eclipse.mylyn.team.cvs.patch

This is org.eclipse.mylyn.team.cvs.patch of Mylyn 3.0.2
Comment 17 Steffen Pingel CLA 2008-10-28 23:54:02 EDT
The patch looks good. Here is how I would suggest to proceed for getting this into the Mylyn code base: Please switch your workspace to Mylyn head and recreate the patches. The naming of message constants should follow a standard pattern of ClassName_Message, e.g.:

CvsContextChangeSet {
	MessageDialog.openQuestion(
 						PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
						"Mylyn Change Set Management",
						"You are attempting to commit a resource which is not associated with the selected task repository.  Proceed with creating the commit message?");
}

Should be refactored into this:

CvsContextChangeSet {
	MessageDialog.openQuestion(
 						PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
						Messages.CvsContextChangeSet_Mylyn_Change_Set_Management,
						Messages.CvsContextChangeSet_Attempting_to_commit_a_resource)
}

This is close to what you have in the patch except for not making the constants all upper case. To minimize conflicts with the ongoing changes in the code base and other patches, it would be great to do this incrementally in the order below. Once you have completed externalizing messages for a plug-in, create a new bug that is a subtask of this bug, e.g. "externalize strings for org.eclipse.mylyn.bugzilla.ide", and attach a patch to the bug. I will then review the patch and apply it or file a legal review if necessary.

1,882 org.eclipse.mylyn.patch
3,788 org.eclipse.mylyn.bugzilla.ide.patch
9,486 org.eclipse.mylyn.help.ui.patch
7,988 org.eclipse.mylyn.compatibility.patch
15,698 org.eclipse.mylyn.ide.ant.patch
14,442 org.eclipse.mylyn.ide.ui.patch
37,849 org.eclipse.mylyn.monitor.core.patch
23,245 org.eclipse.mylyn.monitor.ui.patch
12,568 org.eclipse.mylyn.java.tasks.patch
74,782 org.eclipse.mylyn.java.ui.patch
29,428 org.eclipse.mylyn.pde.ui.patch
29,129 org.eclipse.mylyn.resources.ui.patch
45,168 org.eclipse.mylyn.tasks.bugs.patch
8,149 org.eclipse.mylyn.team.cvs.patch
62,986 org.eclipse.mylyn.team.ui.patch
19,147 org.eclipse.mylyn.commons.core.patch
72,882 org.eclipse.mylyn.commons.net.patch
53,468 org.eclipse.mylyn.commons.ui.patch

I would like to hold off with these plug-ins until the ones above have been completed and other outstanding patches have been applied:

169,740 org.eclipse.mylyn.bugzilla.core.patch
123,519 org.eclipse.mylyn.bugzilla.ui.patch
47,222 org.eclipse.mylyn.context.core.patch
133,876 org.eclipse.mylyn.context.ui.patch
220,386 org.eclipse.mylyn.tasks.core.patch
820,320 org.eclipse.mylyn.tasks.ui.patch

Let me know what you think.
Comment 18 Hiroyuki CLA 2008-11-01 07:19:14 EDT
I am making the difference with CVS HEAD. 
Is it good in this way though two differences were made and issued?
- bug 253052   externalize strings for org.eclipse.mylyn
- bug 253053   externalize strings for org.eclipse.mylyn.bugzilla.ide
Comment 19 Steffen Pingel CLA 2008-11-01 16:18:07 EDT
I had problems applying the patches. See my comment on bug 253052.
Comment 20 Steffen Pingel CLA 2008-11-02 23:59:31 EST
*** Bug 212317 has been marked as a duplicate of this bug. ***
Comment 21 Steffen Pingel CLA 2008-11-11 01:07:47 EST
I have filed CQ 2820 to request an IP review of all outstanding externalization patches.
Comment 22 Steffen Pingel CLA 2008-11-26 13:59:51 EST
The CQ has been approved! I will start merging the outstanding patches in the course of next week.
Comment 23 Steffen Pingel CLA 2008-12-06 23:52:42 EST
All patches have been applied with the exception of the Bugzilla component which is waiting on other patches to get merged first. String should become available in Babel for translation in the next few days.
Comment 24 Steffen Pingel CLA 2008-12-16 13:57:27 EST
All externalization patches have been merged and Mylyn is available for translation from Babel now: http://tasktop.com/blog/mylyn/mylyn-is-turning-japanese .
Comment 25 Steffen Pingel CLA 2009-01-19 22:05:14 EST
*** Bug 261583 has been marked as a duplicate of this bug. ***