diff --git a/external/crlfchecker/normtext.js b/external/crlfchecker/normtext.js new file mode 100644 index 000000000..3bfda0f1f --- /dev/null +++ b/external/crlfchecker/normtext.js @@ -0,0 +1,33 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/* Copyright 2012 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* jshint node:true */ + +'use strict'; + +var fs = require('fs'); + +function normalizeText(s) { + return s.replace(/\r\n?/g, '\n').replace(/\uFEFF/g, ''); +} + +var args = process.argv.slice(2); + +args.forEach(function (file) { + var content = fs.readFileSync(file, 'utf8'); + content = normalizeText(content); + fs.writeFileSync(file, content, 'utf8'); +}); diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js index aba35eaf0..f37e8cfe1 100644 --- a/external/importL10n/locales.js +++ b/external/importL10n/locales.js @@ -39,6 +39,10 @@ var langCodes = [ 'zh-TW', 'zu' ]; +function normalizeText(s) { + return s.replace(/\r\n?/g, '\n').replace(/\uFEFF/g, ''); +} + function downloadLanguageFiles(langCode, callback) { console.log('Downloading ' + langCode + '...'); @@ -60,12 +64,16 @@ function downloadLanguageFiles(langCode, callback) { // Download the necessary files for this language. files.forEach(function(fileName) { var outputPath = path.join(langCode, fileName); - var file = fs.createWriteStream(outputPath); var url = MOZCENTRAL_ROOT + langCode + MOZCENTRAL_PDFJS_DIR + fileName + MOZCENTRAL_RAW_FLAG; var request = http.get(url, function(response) { - response.pipe(file); + var content = ''; + response.setEncoding('utf8'); + response.on("data", function(chunk) { + content += chunk; + }); response.on('end', function() { + fs.writeFileSync(outputPath, normalizeText(content), 'utf8'); downloadsLeft--; if (downloadsLeft === 0) { callback(); diff --git a/l10n/bn-BD/metadata.inc b/l10n/bn-BD/metadata.inc index 818bbfd12..fc36a568f 100644 --- a/l10n/bn-BD/metadata.inc +++ b/l10n/bn-BD/metadata.inc @@ -1,4 +1,4 @@ - + bn-BD পিডিএফ ভিউয়ার diff --git a/l10n/fi/metadata.inc b/l10n/fi/metadata.inc index 1b8d8b613..19ec00d3c 100644 --- a/l10n/fi/metadata.inc +++ b/l10n/fi/metadata.inc @@ -1,4 +1,4 @@ - + fi PDF Lukuohjelma