Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import l10n files from mozilla-aurora [WIP] #3766

Closed

Conversation

timvandermeij
Copy link
Contributor

This PR fixes #3242 and supersedes #3762. It adds a Makefile utility called importl10n (call: node make importl10n) that fetches the latest l10n files from mozilla-aurora. This implies that translations should now only be done at the central Mozilla repository and not here anymore. This avoids users translating strings here that are already translated by the Firefox team and makes sure that translations are always synchronized between Firefox and PDF.js.

Note that this tool keeps our metadata.inc files because the Firefox team does not translate those.

The PR changes the regex used in node make firefox a bit to allow the new languages codes from mozilla-aurora, in particular three-letter codes.

  • Move the download logic to external/importL10n (say locales.js) in a function downloadLanguageFiles(lang, dest).
  • Squash the last three commits.
  • Update the wiki with the message from CONTRIBUTING.md.
  • Review comment on text in CONTRIBUTING.md


// Defines all languages that have a translation at mozilla-aurora.
// This is used in make.js for the importl10n command.
function getlangcodes() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use lowerCamelCase, i.e. getLangCodes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know what I was thinking there. Fixed in new commit :)

@waddlesplash
Copy link
Contributor

Can this be merged?

@yurydelendik
Copy link
Contributor

@timvandermeij Okay, let's do this:

  • rebase to the latest master
  • add a README.md file that will tell where we got this files, mention MPL license is used for all except 'en-US' there (probably we shall include the license file too)
  • remove 'ja-JP-mac' from the list
  • make the initial import, which will include all new files
  • not sure about this one, but remove locales that we not present in the l10n-aurora

Last two can be done in the separate commit.

@Snuffleupagus
Copy link
Collaborator

I have a question in connection with this: Does this mean that, going forward, all PRs that update locales (except for en-US of course) will be rejected?

The reason that I think we should make a decision about this is the following case:
When new functionality (adding locale strings) lands in PDF.js, it can easily take at least two months for it to land in Aurora. During this time, those strings will be untranslated in PDF.js.
Do we want to accept PRs adding missing strings, until such a time that they are available in Aurora?

I believe that it would be a good idea make a decision about this, and then preferably adding this information to the Wiki and CONTRIBUTING.md.

@yurydelendik
Copy link
Contributor

I have a question in connection with this: Does this mean that, going forward, all PRs that update locales (except for en-US of course) will be rejected?

Good question. But can we afford to do micro-merging? How about we will still accept the pull request, but we will override the patches/changes will new sync.

... and then preferably adding this information to the Wiki and CONTRIBUTING.md.

Yes, we shall mention that there

@Snuffleupagus
Copy link
Collaborator

How about we will still accept the pull request, but we will override the patches/changes will new sync.

That's exactly what I've been thinking too!

@timvandermeij
Copy link
Contributor Author

@yurydelendik Sounds like a good plan. One question though: where would I put the README.md file?

@yurydelendik
Copy link
Contributor

where would I put the README.md file?

https://github.com/mozilla/pdf.js/tree/master/l10n is a good place for it

@@ -0,0 +1 @@
Most of the files in this folder (except for the `en-US` folder and the `metadata.inc` files) have been imported from the Firefox Aurora branch, which is located at https://mxr.mozilla.org/l10n-mozilla-aurora/source. Those files are licensed under the MPL license. You can obtain a copy of the license at http://mozilla.org/MPL/2.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the files license under apache2. We can reword "Those files are licensed under the MPL license. " -> "Some of the files are licensed under the MPL license."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split/format text at 80 chars margin?

@yurydelendik
Copy link
Contributor

move import_locales.js to the external/importL10n/ folder

@timvandermeij timvandermeij changed the title Import l10n files from mozilla-aurora [WIP] Import l10n files from mozilla-aurora Mar 20, 2014
If you are developing a custom solution, first check examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare short well-documented example that demonstrate the problem and make it accessible online on your website, jsbin, github, etc. before opening a new issue or contacting us on the IRC channel -- keep in mind that just code snippets won't help us troubleshoot the problem. The issues that do not provide enough details will be closed as invalid/incomplete.
If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us on the IRC channel -- keep in mind that just code snippets won't help us troubleshoot the problem.

Note that the translations for PDF.js in the `l10n` folder are synchronized with the Aurora branch of Mozilla Firefox. This means that we will still accept pull requests that update translations (because it can take a few weeks before the most recent translations are in the Aurora branch), but keep in mind that the changes will be overwritten when we synchronize again.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this more explicitly state that we only will accept PRs that add strings currently missing in Aurora, i.e. no PRs which changes existing strings (since they are pointless)?
Also, since PDF.js spends one cycle (= six weeks) on Nightly before being uplifted to Aurora, I suggest changing "because it can take a few weeks" to "because it will take at least six weeks".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I will definitely change that.

@timvandermeij timvandermeij changed the title [WIP] Import l10n files from mozilla-aurora Import l10n files from mozilla-aurora [WIP] Mar 22, 2014
@timvandermeij
Copy link
Contributor Author

Superseded by #4504.

@timvandermeij timvandermeij deleted the l10n-import-makefile branch March 22, 2014 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import language files from mozilla-central
4 participants