From bd0affab9c1c4d1206813a55e594102b80046da3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 22 Jun 2016 09:36:59 +0200 Subject: [PATCH] Unbreak the `importl10n` command by updating the links to point to hg.mozilla.org instead of mxr Currently `importl10n` fails, since mxr.mozilla.org has been down for a while. Based on discussions in #developers, it isn't clear to me if/when it'll be available again. Furthermore, I'm not sure why we're even getting the l10n files through a code search tool, rather than just using the official Mozilla repository directly. --- external/importL10n/locales.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js index de0fa2729..7b7eb224f 100644 --- a/external/importL10n/locales.js +++ b/external/importL10n/locales.js @@ -17,7 +17,7 @@ 'use strict'; var fs = require('fs'); -var http = require('http'); +var https = require('https'); var path = require('path'); // Defines all languages that have a translation at mozilla-aurora. @@ -47,9 +47,8 @@ function downloadLanguageFiles(root, langCode, callback) { // Constants for constructing the URLs. Translations are taken from the // Aurora channel as those are the most recent ones. The Nightly channel // does not provide all translations. - var MOZCENTRAL_ROOT = 'http://mxr.mozilla.org/l10n-mozilla-aurora/source/'; - var MOZCENTRAL_PDFJS_DIR = '/browser/pdfviewer/'; - var MOZCENTRAL_RAW_FLAG = '?raw=1'; + var MOZ_AURORA_ROOT = 'https://hg.mozilla.org/releases/l10n/mozilla-aurora/'; + var MOZ_AURORA_PDFJS_DIR = '/raw-file/tip/browser/pdfviewer/'; // Defines which files to download for each language. var files = ['chrome.properties', 'viewer.properties']; @@ -63,9 +62,8 @@ function downloadLanguageFiles(root, langCode, callback) { // Download the necessary files for this language. files.forEach(function(fileName) { var outputPath = path.join(outputDir, fileName); - var url = MOZCENTRAL_ROOT + langCode + MOZCENTRAL_PDFJS_DIR + - fileName + MOZCENTRAL_RAW_FLAG; - var request = http.get(url, function(response) { + var url = MOZ_AURORA_ROOT + langCode + MOZ_AURORA_PDFJS_DIR + fileName; + var request = https.get(url, function(response) { var content = ''; response.setEncoding('utf8'); response.on("data", function(chunk) {