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

Bug 349107

Summary: properties file for template is located in wrong path in org.eclipse.wst.jsdt.ui.nl_ja
Product: [Technology] Babel Reporter: Satoru Yoshida <ramat>
Component: ServerAssignee: Satoru Yoshida <ramat>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: kitlo
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---Flags: kitlo: iplog+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 265194    
Attachments:
Description Flags
implement for adding nl path feature none

Description Satoru Yoshida CLA 2011-06-10 23:39:23 EDT
Build Identifier: R0.8.1/helios

Hello,
I find default-templates_ja.properties is located in wrong path of org.eclipse.wst.jsdt.ui.nl_ja_3.6.0.v20101211043401.jar .

The jar file can be downloaded from Babel Language Pack Update Site for Helios R 0.8.1

Actually
--------
default-templates_ja.properties is in root of the jar file.
It causes Menu bar|Window|Preference|JavaScript|Editor|Templates can not be localized.

Expected
--------
nl/ja/default-templates.properties in the jar file.


Reproducible: Always
Comment 1 Satoru Yoshida CLA 2011-06-12 02:34:59 EDT
Sorry, I have 1 mistake.

Expected
--------
nl/ja/templates/default-templates.properties
Comment 2 Satoru Yoshida CLA 2011-06-12 05:49:29 EDT
Additional Info.
org.eclipse.wst.html.ui.nl_ja_3.6.0.v20101211043401.jar has also same problem.

Expected
--------
nl/ja/templates/htmldefault-templates.properties

Thanks.
Comment 3 Satoru Yoshida CLA 2011-06-26 02:43:43 EDT
I find following fragment has also same problem.
org.eclipse.wst.xml.ui.nl_ja_3.6.0.v20101211043401

Actually
--------
xmldefault-templates_ja.properties is in root of the jar file.

Expected
--------
nl/ja/templates/xmldefault-templates.properties
Comment 4 Kit Lo CLA 2011-06-26 12:14:14 EDT
Babel is currently only designed to translate Java Property Resource Bundle files. A new enhancement is needed in order to support the translation of the templates.properties files.

- first of all, we need to be able to identify these editor template files
  - Eclipse does not have any rules to stop developers from using the
    name "templates.properties" for a regular Java Property Resource Bundle file
  - therefore, potentially, "templates.properties" could be a regular Java
    Property Resource Bundle file
  - we need a mechanism for projects to tell Babel the list of editor template
    files
- during language pack and update site generation, we have to construct the
  translated editor template files in the plugin fragment in a different
  directory structure

Babel currently does not have the resource to implement this enhancement. I'm adding the "helpwanted" keyword to this bug. Hope the community can help implement this.
Comment 5 Satoru Yoshida CLA 2011-11-29 08:59:05 EST
I find new type for this issue.

charset.properties, defaultIANA.properties and override.properties
under  org.eclipse.wst.sse.core/config/ .

this path does not contain /templates/ , but contains /config/ .

These property files would be located
under org.eclipse.wst.sse.core.nl_ja/nl/ja/config/ .
(it is example for Japanese)

Thanks.
Comment 6 Kit Lo CLA 2011-11-29 13:34:56 EST
Yoshida-san, first of all, do you think the 3 files (charset.properties, defaultIANA.properties and override.properties) should be translated?

Moreover, the same arguments in comment 4 still apply:
- potentially, "config" could be a directory for a regular Java Property Resource Bundle file
- we need a mechanism for projects to tell Babel the list of these special directories
- during language pack and update site generation, we have to construct the translated config files in the plugin fragment in a different directory structure
Comment 7 Satoru Yoshida CLA 2011-12-01 07:36:29 EST
Hello, Kit Lo-san,
I think the 5th comment is trivial, and "nice to have".
Because users would not be troubled in most of case, I feel.

Issue of /templates/ directory is more important than one of /config/ directory.

However, I reported the 5th comment for record because nobody might notice problem peculiar to org.eclipse.wst.sse.core .

Thanks.
Comment 8 Satoru Yoshida CLA 2012-04-11 00:41:53 EDT
I try some research...

In eclipse 3.6 or above, following query gives us files to use ROOT/nl/AA/path/to/file.properties
(AA is language code. And not uses file.properties_AA in this case)

select project_id, version, name from files where is_active = 1
and name not regexp
'^org\.eclipse\.[0-9a-z._]+\/[0-9a-z._\-]+properties$'
and name not regexp
'^org\.eclipse\.[0-9a-z._]+\/org'
and name not regexp
'^org\.eclipse\.[0-9a-z._]+\/src'
and name not regexp
'^org\.eclipse\.[0-9a-z._]+\/OSGI\-INF'

AND project_id = 'eclipse'
AND version >= '3.6';

Note:
if eclipse 3.5 or before, I have not idea yet.

I will be happy if its comment could help You, Thanks
Comment 9 Satoru Yoshida CLA 2012-05-22 10:13:49 EDT
Created attachment 216036 [details]
implement for adding nl path feature

Hi, Kit Lo-san.

I try to implement for this issue.
I hope it could help all of us.

Thanks.
Comment 10 Kit Lo CLA 2012-05-23 00:48:22 EDT
Yoshida-san, the patch looks reasonable. I will test it out and release that soon. Thanks for the contribution to Babel!
Comment 11 Satoru Yoshida CLA 2012-06-16 11:28:55 EDT
hi, Kit Lo-san,

I have just checked the Nightly Builds I20120616-0400 for juno.
it seemes to be fine for me, thanks.
Comment 12 Kit Lo CLA 2012-06-16 12:55:55 EDT
Yoshida-san, I was waiting for the integration build to finish, test out the language packs before I provide my status update. You are faster than me :-)

I tested your patch, but received some messages saying the $dir_name variable on line 265 is undefined. I think you had a typo. The variable should be $dirname.

I changed line 265 to the following and everything is working now:
	$fullpath = $tmp_dir . $dirname . $filename;

I also tested out the new language packs. I can see the template translations loaded properly. The problem is resolved!

Thanks for your patch contribution! Keep them coming :-)
Comment 13 Satoru Yoshida CLA 2012-06-17 11:58:11 EDT
Hi, Kit Lo-san,
Thank you for correcting my mistyping.
I look forward eagerly to the next Babel release ;-)