@ -349,11 +349,13 @@ var PDFView = {
@@ -349,11 +349,13 @@ var PDFView = {
} ,
function getDocumentError ( message , exception ) {
var loadingIndicator = document . getElementById ( 'loading' ) ;
loadingIndicator . textContent = mozL10n . get ( 'loading_error_indicator' ) ;
loadingIndicator . textContent = mozL10n . get ( 'loading_error_indicator' ,
null , 'Error' ) ;
var moreInfo = {
message : message
} ;
self . error ( mozL10n . get ( 'loading_error' ) , moreInfo ) ;
self . error ( mozL10n . get ( 'loading_error' , null ,
'An error occurred while loading the PDF.' ) , moreInfo ) ;
self . loading = false ;
} ,
function getDocumentProgress ( progressData ) {
@ -461,22 +463,27 @@ var PDFView = {
@@ -461,22 +463,27 @@ var PDFView = {
moreInfoButton . removeAttribute ( 'hidden' ) ;
lessInfoButton . setAttribute ( 'hidden' , 'true' ) ;
errorMoreInfo . value =
mozL10n . get ( 'error_build' , { build : PDFJS . build } ) + '\n' ;
mozL10n . get ( 'error_build' , { build : PDFJS . build } ,
'PDF.JS Build: {{build}}' ) + '\n' ;
if ( moreInfo ) {
errorMoreInfo . value +=
mozL10n . get ( 'error_message' , { message : moreInfo . message } ) ;
mozL10n . get ( 'error_message' , { message : moreInfo . message } ,
'Message: {{message}}' ) ;
if ( moreInfo . stack ) {
errorMoreInfo . value += '\n' +
mozL10n . get ( 'error_stack' , { stack : moreInfo . stack } ) ;
mozL10n . get ( 'error_stack' , { stack : moreInfo . stack } ,
'Stack: {{stack}}' ) ;
} else {
if ( moreInfo . filename ) {
errorMoreInfo . value += '\n' +
mozL10n . get ( 'error_file' , { file : moreInfo . filename } ) ;
mozL10n . get ( 'error_file' , { file : moreInfo . filename } ,
'File: {{file}}' ) ;
}
if ( moreInfo . lineNumber ) {
errorMoreInfo . value += '\n' +
mozL10n . get ( 'error_line' , { line : moreInfo . lineNumber } ) ;
mozL10n . get ( 'error_line' , { line : moreInfo . lineNumber } ,
'Line: {{line}}' ) ;
}
}
}
@ -486,7 +493,8 @@ var PDFView = {
@@ -486,7 +493,8 @@ var PDFView = {
progress : function pdfViewProgress ( level ) {
var percent = Math . round ( level * 100 ) ;
var loadingIndicator = document . getElementById ( 'loading' ) ;
loadingIndicator . textContent = mozL10n . get ( 'loading' , { percent : percent } ) ;
loadingIndicator . textContent = mozL10n . get ( 'loading' , { percent : percent } ,
'Loading... {{percent}}%' ) ;
PDFView . loadingBar . percent = percent ;
} ,
@ -523,7 +531,7 @@ var PDFView = {
@@ -523,7 +531,7 @@ var PDFView = {
var id = pdfDocument . fingerprint ;
var storedHash = null ;
document . getElementById ( 'numPages' ) . textContent =
mozL10n . get ( 'page_of' , { pageCount : pagesCount } ) ;
mozL10n . get ( 'page_of' , { pageCount : pagesCount } , 'of {{pageCount}}' ) ;
document . getElementById ( 'pageNumber' ) . max = pagesCount ;
PDFView . documentFingerprint = id ;
var store = PDFView . store = new Settings ( id ) ;
@ -837,7 +845,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
@@ -837,7 +845,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
var rect = viewport . convertToViewportRectangle ( item . rect ) ;
rect = PDFJS . Util . normalizeRect ( rect ) ;
image . src = kImageDirectory + 'annotation-' + type . toLowerCase ( ) + '.svg' ;
image . alt = mozL10n . get ( 'text_annotation_type' , { type : type } ) ;
image . alt = mozL10n . get ( 'text_annotation_type' , { type : type } ,
'[{{type}} Annotation]' ) ;
var content = document . createElement ( 'div' ) ;
content . setAttribute ( 'hidden' , true ) ;
var title = document . createElement ( 'h1' ) ;
@ -1018,8 +1027,10 @@ var PageView = function pageView(container, pdfPage, id, scale,
@@ -1018,8 +1027,10 @@ var PageView = function pageView(container, pdfPage, id, scale,
delete self . loadingIconDiv ;
}
if ( error )
PDFView . error ( mozL10n . get ( 'rendering_error' ) , error ) ;
if ( error ) {
PDFView . error ( mozL10n . get ( 'rendering_error' , null ,
'An error occurred while rendering the page.' ) , error ) ;
}
self . stats = pdfPage . stats ;
self . updateStats ( ) ;
@ -1163,7 +1174,8 @@ var DocumentOutlineView = function documentOutlineView(outline) {
@@ -1163,7 +1174,8 @@ var DocumentOutlineView = function documentOutlineView(outline) {
if ( ! outline ) {
var noOutline = document . createElement ( 'div' ) ;
noOutline . classList . add ( 'noOutline' ) ;
noOutline . textContent = mozL10n . get ( 'no_outline' ) ;
noOutline . textContent = mozL10n . get ( 'no_outline' , null ,
'No Outline Available' ) ;
outlineView . appendChild ( noOutline ) ;
return ;
}