translation support for pdfviewer

This commit is contained in:
Thomas Mueller 2012-08-26 02:14:56 +02:00
parent 8e090d8f67
commit ad66d6d5e9
4 changed files with 61 additions and 4 deletions

View File

@ -18,9 +18,18 @@ function showPDFviewer(dir,filename){
function im(path) { return OC.filePath('files_pdfviewer','js','pdfjs/web/images/'+path); }
showPDFviewer.oldcode = $("#controls").html();
$("#controls").empty();
$("#controls").html('<button id="previous" onclick="PDFView.page--;" oncontextmenu="return false;"><img src="'+im('go-up.svg')+'" align="top" height="10"/>Previous</button><button id="next" onclick="PDFView.page++;" oncontextmenu="return false;"><img src="'+im('go-down.svg')+'" align="top" height="10"/>Next</button><div class="separator"></div><input style="width:25px;" type="number" id="pageNumber" onchange="PDFView.page = this.value;" value="1" size="4" min="1" /><span>/</span><span id="numPages">--</span><div class="separator"></div><button id="zoomOut" title="Zoom Out" onclick="PDFView.zoomOut();" oncontextmenu="return false;"><img src="'+im('zoom-out.svg')+'" align="top" height="10"/></button><button id="zoomIn" title="Zoom In" onclick="PDFView.zoomIn();" oncontextmenu="return false;"><img src="'+im('zoom-in.svg')+
'" align="top" height="10"/></button><div class="separator"></div><select id="scaleSelect" onchange="PDFView.parseScale(this.value);" oncontextmenu="return false;"><option id="customScaleOption" value="custom"></option><option value="0.5">50%</option><option value="0.75">75%</option><option value="1">100%</option><option value="1.25" selected="selected">125%</option><option value="1.5">150%</option><option value="2">200%</option><option id="pageWidthOption" value="page-width">Page Width</option><option id="pageFitOption" value="page-fit">Page Fit</option></select><div class="separator"></div><button id="print" onclick="window.print();" oncontextmenu="return false;"><img src="'+im('document-print.svg')+'" align="top" height="10"/>Print</button><button id="download" title="Download" onclick="PDFView.download();" oncontextmenu="return false;">'+
'<img src="'+im('download.svg')+'" align="top" height="10"/>Download</button><button id="close" title="Close viewer" onclick="hidePDFviewer();" oncontextmenu="return false;">x</button><span id="info">--</span></div>');
$("#controls").html(
'<button id="previous" onclick="PDFView.page--;" oncontextmenu="return false;"><img src="'+im('go-up.svg')+'" align="top" height="10"/>'+t('files_odfviewer','Previous')+'</button>'+
'<button id="next" onclick="PDFView.page++;" oncontextmenu="return false;"><img src="'+im('go-down.svg')+'" align="top" height="10"/>'+t('files_odfviewer','Next')+'</button>'+
'<div class="separator"></div><input style="width:25px;" type="number" id="pageNumber" onchange="PDFView.page = this.value;" value="1" size="4" min="1" /><span>/</span><span id="numPages">--</span><div class="separator"></div>'+
'<button id="zoomOut" title="Zoom Out" onclick="PDFView.zoomOut();" oncontextmenu="return false;"><img src="'+im('zoom-out.svg')+'" align="top" height="10"/></button>'+
'<button id="zoomIn" title="Zoom In" onclick="PDFView.zoomIn();" oncontextmenu="return false;"><img src="'+im('zoom-in.svg')+ '" align="top" height="10"/></button>'+
'<div class="separator"></div><select id="scaleSelect" onchange="PDFView.parseScale(this.value);" oncontextmenu="return false;"><option id="customScaleOption" value="custom"></option>'+
'<option value="0.5">50%</option><option value="0.75">75%</option><option value="1">100%</option><option value="1.25" selected="selected">125%</option><option value="1.5">150%</option><option value="2">200%</option>'+
'<option id="pageWidthOption" value="page-width">'+t('files_odfviewer', 'Page Width')+'</option><option id="pageFitOption" value="page-fit">'+t('files_odfviewer', 'Page Fit')+'</option></select>'+
'<div class="separator"></div><button id="print" onclick="window.print();" oncontextmenu="return false;"><img src="'+im('document-print.svg')+'" align="top" height="10"/>'+t('files_odfviewer', 'Print')+'</button>'+
'<button id="download" title="Download" onclick="PDFView.download();" oncontextmenu="return false;">'+
'<img src="'+im('download.svg')+'" align="top" height="10"/>'+t('files_odfviewer', 'Download')+'</button><button id="close" title="Close viewer" onclick="hidePDFviewer();" oncontextmenu="return false;">x</button><span id="info">--</span></div>');
var oldcontent = $("#content").html();
$("#content").html(oldcontent+'<div id="loading">Loading... 0%</div><div id="viewer"></div>');
showPDFviewer.lastTitle = document.title;

View File

View File

@ -120,9 +120,15 @@ source_file = templates/impress.pot
source_lang = en
type = PO
[owncloud.impress]
[owncloud.files_odfviewer]
file_filter = <lang>/files_odfviewer.po
source_file = templates/files_odfviewer.pot
source_lang = en
type = PO
[owncloud.files_pdfviewer]
file_filter = <lang>/files_pdfviewer.po
source_file = templates/files_pdfviewer.pot
source_lang = en
type = PO

View File

@ -0,0 +1,42 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-08-26 02:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: js/viewer.js:22
msgid "Previous"
msgstr ""
#: js/viewer.js:23
msgid "Next"
msgstr ""
#: js/viewer.js:29
msgid "Page Width"
msgstr ""
#: js/viewer.js:29
msgid "Page Fit"
msgstr ""
#: js/viewer.js:30
msgid "Print"
msgstr ""
#: js/viewer.js:32
msgid "Download"
msgstr ""