From 33b22b82804274602f4873f59fe69a30f55e89e1 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Fri, 14 Oct 2016 14:53:20 +0100 Subject: [PATCH] Use correct i18n formatting methods. Update note to 2.2 --- src/app/components/HardpointSlot.jsx | 10 +++++----- src/app/i18n/Language.jsx | 2 ++ src/app/pages/AboutPage.jsx | 2 +- src/app/pages/OutfittingPage.jsx | 2 +- src/app/pages/ShipyardPage.jsx | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/components/HardpointSlot.jsx b/src/app/components/HardpointSlot.jsx index 5e253015..64807dde 100644 --- a/src/app/components/HardpointSlot.jsx +++ b/src/app/components/HardpointSlot.jsx @@ -51,12 +51,12 @@ export default class HardpointSlot extends Slot {
{m.mass}{u.T}
- { m.dps ?
{translate('DPS')}: {formats.int(10 * m.dps) / 10} { m.clip ? ({formats.int(10 * (m.clip * m.dps / m.rof) / ((m.clip / m.rof) + m.reload)) / 10}) : null }
: null } - { m.eps ?
{translate('EPS')}: {formats.int(10 * m.eps) / 10} { m.clip ? ({formats.int(10 * (m.clip * m.eps / m.rof) / ((m.clip / m.rof) + m.reload)) / 10}) : null }
: null } - { m.hps ?
{translate('HPS')}: {formats.int(10 * m.hps) / 10} { m.clip ? ({formats.int(10 * (m.clip * m.hps / m.rof) / ((m.clip / m.rof) + m.reload)) / 10}) : null }
: null } - { m.dps && m.eps ?
{translate('DPE')}: {formats.int( 10 * m.dps / m.eps) / 10}
: null } + { m.dps ?
{translate('DPS')}: {formats.round1(m.dps)} { m.clip ? ({formats.round1((m.clip * m.dps / m.rof) / ((m.clip / m.rof) + m.reload)) }) : null }
: null } + { m.eps ?
{translate('EPS')}: {formats.round1(m.eps)} { m.clip ? ({formats.round1((m.clip * m.eps / m.rof) / ((m.clip / m.rof) + m.reload)) }) : null }
: null } + { m.hps ?
{translate('HPS')}: {formats.round1(m.hps)} { m.clip ? ({formats.round1((m.clip * m.hps / m.rof) / ((m.clip / m.rof) + m.reload)) }) : null }
: null } + { m.dps && m.eps ?
{translate('DPE')}: {formats.round1(m.dps / m.eps)}
: null } { m.rof ?
{translate('ROF')}: {m.rof}{u.ps}
: null } - { m.range && !m.dps ?
{translate('Range')}: {m.range/1000}{u.km}
: null } + { m.range && !m.dps ?
{translate('Range')}: {formats.round(m.range/1000)}{u.km}
: null } { m.shieldmul ?
+{formats.rPct(m.shieldmul)}
: null } { m.ammo >= 0 ?
{translate('ammo')}: {formats.int(m.clip)}/{formats.int(m.ammo)}
: null }
diff --git a/src/app/i18n/Language.jsx b/src/app/i18n/Language.jsx index dc237c24..6d4d21a8 100644 --- a/src/app/i18n/Language.jsx +++ b/src/app/i18n/Language.jsx @@ -41,12 +41,14 @@ export function getLanguage(langCode) { formats: { gen, // General number format (.e.g 1,001,001.1234) int: d3Locale.numberFormat(',.0f'), // Fixed to 0 decimal places (.e.g 1,001) + f1: d3Locale.numberFormat(',.1f'), // Fixed to 1 decimal place (.e.g 1,001.1) f2: d3Locale.numberFormat(',.2f'), // Fixed to 2 decimal places (.e.g 1,001.10) s2: d3Locale.numberFormat('.2s'), // SI Format to 2 decimal places (.e.g 1.1k) pct: d3Locale.numberFormat('.2%'), // % to 2 decimal places (.e.g 5.40%) pct1: d3Locale.numberFormat('.1%'), // % to 1 decimal places (.e.g 5.4%) r2: d3Locale.numberFormat('.2r'), // Rounded to 2 significant numbers (.e.g 512 => 510, 4.122 => 4.1) rPct: d3.format('%'), // % to 0 decimal places (.e.g 5%) + round1: (d) => gen(d3.round(d, 1)), // Rounded to 0-1 decimal places (.e.g 5.1, 4) round: (d) => gen(d3.round(d, 2)), // Rounded to 0-2 decimal places (.e.g 5.12, 4.1) time: (d) => (d < 0 ? '-' : '') + Math.floor(Math.abs(d) / 60) + ':' + ('00' + Math.floor(Math.abs(d) % 60)).substr(-2, 2) }, diff --git a/src/app/pages/AboutPage.jsx b/src/app/pages/AboutPage.jsx index ed8771c9..77579786 100644 --- a/src/app/pages/AboutPage.jsx +++ b/src/app/pages/AboutPage.jsx @@ -29,7 +29,7 @@ export default class AboutPage extends Page {

This is a clone of the Coriolis project, whose original author is currently unable to maintain it. This clone is maintained by the EDCD community.

To recover your builds, go to https://coriolis.io/, backup your builds (Settings / Backup), copy the text, return here and import (Settings / Import).

The Coriolis project was inspired by E:D Shipyard and, of course, Elite Dangerous. The ultimate goal of Coriolis is to provide rich features to support in-game play and planning while engaging the E:D community to support its development.

-

Coriolis was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments.

+

Coriolis was created using assets and imagery from Elite: Dangerous, with the permission of Frontier Developments plc, for non-commercial purposes. It is not endorsed by nor reflects the views or opinions of Frontier Developments. A number of assets were sourced from ED Assets

diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index 0ac81281..e4ee5633 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -293,7 +293,7 @@ export default class OutfittingPage extends Page {

{ship.name}