@ -17,7 +17,7 @@
'use strict' ;
'use strict' ;
var fs = require ( 'fs' ) ;
var fs = require ( 'fs' ) ;
var http = require ( 'http' ) ;
var https = require ( 'https ' ) ;
var path = require ( 'path' ) ;
var path = require ( 'path' ) ;
// Defines all languages that have a translation at mozilla-aurora.
// 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
// Constants for constructing the URLs. Translations are taken from the
// Aurora channel as those are the most recent ones. The Nightly channel
// Aurora channel as those are the most recent ones. The Nightly channel
// does not provide all translations.
// does not provide all translations.
var MOZCENTRAL _ROOT = 'http://mxr.mozilla.org/l10n-mozilla-aurora/source/' ;
var MOZ _AURORA _ROOT = 'https://hg.mozilla.org/releases/l10n/mozilla-aurora/' ;
var MOZCENTRAL _PDFJS _DIR = '/browser/pdfviewer/' ;
var MOZ _AURORA _PDFJS _DIR = '/raw-file/tip/browser/pdfviewer/' ;
var MOZCENTRAL _RAW _FLAG = '?raw=1' ;
// Defines which files to download for each language.
// Defines which files to download for each language.
var files = [ 'chrome.properties' , 'viewer.properties' ] ;
var files = [ 'chrome.properties' , 'viewer.properties' ] ;
@ -63,9 +62,8 @@ function downloadLanguageFiles(root, langCode, callback) {
// Download the necessary files for this language.
// Download the necessary files for this language.
files . forEach ( function ( fileName ) {
files . forEach ( function ( fileName ) {
var outputPath = path . join ( outputDir , fileName ) ;
var outputPath = path . join ( outputDir , fileName ) ;
var url = MOZCENTRAL _ROOT + langCode + MOZCENTRAL _PDFJS _DIR +
var url = MOZ _AURORA _ROOT + langCode + MOZ _AURORA _PDFJS _DIR + fileName ;
fileName + MOZCENTRAL _RAW _FLAG ;
var request = https . get ( url , function ( response ) {
var request = http . get ( url , function ( response ) {
var content = '' ;
var content = '' ;
response . setEncoding ( 'utf8' ) ;
response . setEncoding ( 'utf8' ) ;
response . on ( "data" , function ( chunk ) {
response . on ( "data" , function ( chunk ) {