[Pkg-javascript-commits] [pdf.js] 12/139: Allow localization of the placement of percent signs in the zoom box

David Prévot taffit at moszumanska.debian.org
Fri Jan 9 21:18:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 2505c8613b61b2eccd64745a37032c416dad027a
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Oct 16 14:36:03 2014 +0200

    Allow localization of the placement of percent signs in the zoom box
---
 l10n/en-US/viewer.properties |  3 +++
 l10n/sv-SE/viewer.properties |  3 +++
 web/viewer.html              | 16 ++++++++--------
 web/viewer.js                |  4 +++-
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties
index c52020c..4a3a6aa 100644
--- a/l10n/en-US/viewer.properties
+++ b/l10n/en-US/viewer.properties
@@ -140,6 +140,9 @@ page_scale_width=Page Width
 page_scale_fit=Page Fit
 page_scale_auto=Automatic Zoom
 page_scale_actual=Actual Size
+# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
+# numerical scale value.
+page_scale_percent={{scale}}%
 
 # Loading indicator messages
 loading_error_indicator=Error
diff --git a/l10n/sv-SE/viewer.properties b/l10n/sv-SE/viewer.properties
index a88edbd..17232fc 100644
--- a/l10n/sv-SE/viewer.properties
+++ b/l10n/sv-SE/viewer.properties
@@ -140,6 +140,9 @@ page_scale_width=Sidbredd
 page_scale_fit=Anpassa sida
 page_scale_auto=Automatisk zoom
 page_scale_actual=Verklig storlek
+# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
+# numerical scale value.
+page_scale_percent={{scale}} %
 
 # Loading indicator messages
 loading_error_indicator=Fel
diff --git a/web/viewer.html b/web/viewer.html
index b89d9ae..31f40a9 100644
--- a/web/viewer.html
+++ b/web/viewer.html
@@ -266,14 +266,14 @@ http://sourceforge.net/adobe/cmap/wiki/License/
                       <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
                       <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
                       <option id="customScaleOption" title="" value="custom"></option>
-                      <option title="" value="0.5">50%</option>
-                      <option title="" value="0.75">75%</option>
-                      <option title="" value="1">100%</option>
-                      <option title="" value="1.25">125%</option>
-                      <option title="" value="1.5">150%</option>
-                      <option title="" value="2">200%</option>
-                      <option title="" value="3">300%</option>
-                      <option title="" value="4">400%</option>
+                      <option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
+                      <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
+                      <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
+                      <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
+                      <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
+                      <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>
+                      <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option>
+                      <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option>
                     </select>
                   </span>
                 </div>
diff --git a/web/viewer.js b/web/viewer.js
index 3a86c3d..d2675d3 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -1927,7 +1927,9 @@ window.addEventListener('scalechange', function scalechange(evt) {
 
   var predefinedValueFound = selectScaleOption('' + evt.scale);
   if (!predefinedValueFound) {
-    customScaleOption.textContent = Math.round(evt.scale * 10000) / 100 + '%';
+    var customScale = Math.round(evt.scale * 10000) / 100;
+    customScaleOption.textContent =
+      mozL10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%');
     customScaleOption.selected = true;
   }
   updateViewarea();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list