updated availableLanguages and localized progress percentage. fixes #747

This commit is contained in:
Danny Coates 2018-02-07 12:09:23 -08:00
parent 1c5e47b4c4
commit deb177c6bb
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,5 @@
const html = require('choo/html'); const html = require('choo/html');
const percent = require('../utils').percent;
const radius = 73; const radius = 73;
const oRadius = radius + 10; const oRadius = radius + 10;
@ -7,7 +8,7 @@ const circumference = 2 * Math.PI * radius;
module.exports = function(progressRatio) { module.exports = function(progressRatio) {
const dashOffset = (1 - progressRatio) * circumference; const dashOffset = (1 - progressRatio) * circumference;
const percent = Math.floor(progressRatio * 100); const percentComplete = percent(progressRatio);
const div = html` const div = html`
<div class="progress-bar"> <div class="progress-bar">
<svg <svg
@ -31,8 +32,7 @@ module.exports = function(progressRatio) {
stroke-dasharray="${circumference}" stroke-dasharray="${circumference}"
stroke-dashoffset="${dashOffset}"/> stroke-dashoffset="${dashOffset}"/>
<text class="percentage" text-anchor="middle" x="50%" y="98"> <text class="percentage" text-anchor="middle" x="50%" y="98">
<tspan class="percent-number">${percent}</tspan> <tspan class="percent-number">${percentComplete}</tspan>
<tspan class="percent-sign">%</tspan>
</text> </text>
</svg> </svg>
</div> </div>

View File

@ -111,6 +111,7 @@
}, },
"availableLanguages": [ "availableLanguages": [
"en-US", "en-US",
"ar",
"ast", "ast",
"az", "az",
"bs", "bs",
@ -131,6 +132,7 @@
"fy-NL", "fy-NL",
"hsb", "hsb",
"hu", "hu",
"ia",
"id", "id",
"it", "it",
"ja", "ja",
@ -143,9 +145,11 @@
"nn-NO", "nn-NO",
"pt-BR", "pt-BR",
"pt-PT", "pt-PT",
"ro",
"ru", "ru",
"sk", "sk",
"sl", "sl",
"sq",
"sr", "sr",
"sv-SE", "sv-SE",
"tl", "tl",