apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.62k stars 840 forks source link

NETBEANS-2263 Integrate the localisation bundles from Oracle's 3rd donation into the current GitHub repository #1167

Closed borisheithecker closed 4 years ago

borisheithecker commented 5 years ago

To check the integrity of the file files from this commit with the files from the donated zip file:

  1. First, merge only the first commit (328b07c)
  2. Go the project root, do "find netbeans-l10n/ -type f -exec md5sum {} + | sort -k 2 > md5sum.txt"
  3. Unzip ApacheNetBeansDonation3.zip and subsequently netbeans-l10n.zip
  4. Go to the unzipped directory ApacheNetBeansDonation3/
  5. Repeat step 2.: ..... md5sum-orig.txt
  6. diff -u md5sum-orig.txt path_to_incubator-netbeans/md5sum.txt. An empty result is expected. Works for me.
matthiasblaesing commented 5 years ago

Thank you - I'll only comment on the license side of the import. I want an opinion from others more knowledgeable of the l10n part of the netbeans infrastructure, if the source code location is sensible and/or if we should open a separate repository of the the l10n data.

Running the output of diff through diffstat reveals, that 6287 were not caught. My gut feeling tells me, that you missed the files, that Oracle inherited from Sun and never updated.

borisheithecker commented 5 years ago

I ran the convert tool from https://github.com/apache/incubator-netbeans-tools to bulk replace the license headers. A large number of files without any license header can be found in the donated zip. It seems that these are the files revealed by your script. This can be either because they can't have one (.gif files for localized image resources, .url files pointing the translated online resources), or because they're not supposed to have one like the many bundle_xx.properties files that contain translated strings for the names of modules. The convert tool only replaces, it doesn't insert a license if none was present.

I suggest that a separate repository for the l10n bundles shouldn't be used. The build scripts assume that the bundles are placed in a subfolder of the root directory, and if they're pulled from a different repository, I think that make working with the source only more difficult.

junichi11 commented 5 years ago

cc: @masakikatakai

matthiasblaesing commented 5 years ago

Indeed the files are partitially broken. Here is the list of all files, that are not updated in the second commit:

unmodified.txt

One of the files (netbeans-l10n/src/zh_CN/webcommon/html-angular/html-angular/org/netbeans/modules/html/angular/Bundle_zh_CN.properties):

Bundle_zh_CN.properties.txt

Some one added property definitions above the license header. This makes it now much harder to fix the files. In all fairness - the sample is a mess:

These files all need to be cleaned up. What IMHO could be done:

borisheithecker commented 5 years ago

As said, I've used the convert tool from incubator-netbeans-tools. The sources of it show that for .properties files it expects the original license to be at the top. That could be adapted to also detect a valid but misplaced license somewhere in the middle of the file and consequently remove it and insert the new Apache license at the top of the file.

My question is what to do with the (text) files which were donated without any license at all.

matthiasblaesing commented 5 years ago

The files, that don't have a license, but could hold one (property files, java files, ...) need one added. There are options to relex that requirement if the text is used in the GUI and adding the license header would interfere with the display.

borisheithecker commented 5 years ago

And no action is required for binary files (image resources)?

matthiasblaesing commented 5 years ago

Ah sorry - good question. For the regular modules this is solved by introducing an "licenseinfo.xml". That files contains the necessary data. See here for an example: https://github.com/apache/incubator-netbeans/blob/master/ide/image/licenseinfo.xml

This might be interesting: https://cwiki.apache.org/confluence/display/NETBEANS/Legal+FAQ Specificly: https://cwiki.apache.org/confluence/display/NETBEANS/Legal+FAQ#LegalFAQ-licenseinfoPerfileinfo-licenseinfo.xml

borisheithecker commented 5 years ago

I was somehow relying on the conversion tool, but now, reviewing the converted files, I understand that it far from converts everything. It's a great number of files and fixing them all is incremental work and it's definitely going to take much more time. I'm making small commits to make changes trackable - for now fixing the original license headers so they can be auto converted later. I'm adapting the convert tool from incubator-netbeans-tools to catch more of the uncomplying licensing cases. It's on github (https://github.com/borisheithecker/incubator-netbeans-tools/tree/netbeans-l10n), my working branch is netbeans-l10n.

borisheithecker commented 5 years ago

Yes, the first PR should deal only with the licenses. But this is not yet done completely. For the next steps, we need to think about how the contribute should be used in the future. Do we want a multilingual IDE or only localisation support for platform applications?

borisheithecker commented 5 years ago

Another question: There are several files in this PR which contain licensing statements not in the file header but as a localisable string to be displayed to the user (see, for example, netbeans-l10n/src/af/other/installer/infra/build/web/js/common_strings_af.js). These pieces of text surely will have to be updated, too, but does is have to be done for the first PR already?

matthiasblaesing commented 5 years ago

No I don't think these changes are strictly necessary. However, at some point we either need to remove these translations or update them to the correct information. If you encounter such properties, creating an issue for updating these would be great.

geertjanw commented 5 years ago

What is the status of this?

borisheithecker commented 5 years ago

This is much more work than expected. More than 1300 license headers pending to be reviewed and fixed individually, one by one. Even after a couple of improvements on the conversion tool. We need it, esp. the german language pack, and I still feel committed to it. I can't resume work on it before July 20.

matthiasblaesing commented 5 years ago

@borisheithecker thank you for working on this! I'll mark this PR as work-in-progress, so that people know the state.

junichi11 commented 5 years ago

I suggest we create a branch for l10n then merging this PR into it once. Some people can work on this per language. If OK, I'll create a new branch (e.g. 3rd-donation-l10n).

borisheithecker commented 5 years ago

What is the sense of integrating it into the main repository if we're building individual extensions per language? Another option could be to create a new repository that holds the extension plus the donated sources. It could be added as a git "submodule" to the main repository (if needed). Boris

On Tue, 30 Jul 2019 at 16:23, Junichi Yamamoto notifications@github.com wrote:

I suggest we create a branch for l10n then merging this PR into it once. Some people can work on this per language. If OK, I'll create a new branch (e.g. 3rd-donation-l10n).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/netbeans/pull/1167?email_source=notifications&email_token=AECA34PB4MXVYR5FQN2IEITQCBFGZA5CNFSM4G7BZN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EENOI#issuecomment-516441785, or mute the thread https://github.com/notifications/unsubscribe-auth/AECA34PONP6KVLRYPCJ4I33QCBFGZANCNFSM4G7BZN7Q .

-- Boris Heithecker

Dr. Boris Heithecker Lüneburger Str. 30 28870 Ottersberg Festnetz: +49 4205 315834 Mobil: +49 170 6137015

borisheithecker commented 5 years ago

What I'm wondering is, why does this pull request pass the CI test if it's disapproved of by the rat job because of missing licenses?

junichi11 commented 5 years ago

What is the sense of integrating it into the main repository if we're building individual extensions per language?

I meant that we should create PRs to change the license headers per language because this integration is so huge. It's hard work to do it only one person and it takes much time :) Also see @JaroslavTulach 's comment.

Thanks.

matthiasblaesing commented 5 years ago

What I'm wondering is, why does this pull request pass the CI test if it's disapproved of by the rat job because of missing licenses?

The rat check in the CI run does not check the git repository, but the released source zip. As the language files are not part of the build, they don't cause a build failure.

kishida commented 4 years ago

What is the status?

junichi11 commented 4 years ago

Here: https://github.com/apache/netbeans-l10n

Maybe, we can close this, I suppose.

borisheithecker commented 4 years ago

Close this, as the repository has been created. Work is going to be continued on the translations, eyeing a first release. I need to know how to proceed with the license header adaptions in a way that meets all legal requirements.

junichi11 commented 4 years ago

Closing.