diff --git a/js/predictions.js b/js/predictions.js index e2bafc1..eb680b4 100644 --- a/js/predictions.js +++ b/js/predictions.js @@ -657,7 +657,6 @@ class Predictor { } yield { - pattern_description: i18next.t("patterns.fluctuating"), pattern_number: 0, prices: predicted_prices, probability, @@ -736,7 +735,6 @@ class Predictor { } } yield { - pattern_description: i18next.t("patterns.large-spike"), pattern_number: 1, prices: predicted_prices, probability, @@ -783,7 +781,6 @@ class Predictor { } yield { - pattern_description: i18next.t("patterns.decreasing"), pattern_number: 2, prices: predicted_prices, probability, @@ -864,7 +861,6 @@ class Predictor { } yield { - pattern_description: i18next.t("patterns.small-spike"), pattern_number: 3, prices: predicted_prices, probability, @@ -992,7 +988,6 @@ class Predictor { } generated_possibilities.unshift({ - pattern_description: i18next.t("patterns.all"), pattern_number: 4, prices: global_min_max, weekGuaranteedMinimum: Math.min(...generated_possibilities.map(poss => poss.weekGuaranteedMinimum)), diff --git a/js/scripts.js b/js/scripts.js index 0f61564..51fd89b 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -279,13 +279,14 @@ const calculateOutput = function (data, first_buy, previous_pattern) { $("#output").html(""); return; } + let pat_desc = {0:"fluctuating", 1:"large-spike", 2:"decreasing", 3:"small-spike", 4:"all"}; let output_possibilities = ""; let predictor = new Predictor(data, first_buy, previous_pattern); let analyzed_possibilities = predictor.analyze_possibilities(); let buy_price = parseInt(buy_input.val()); previous_pattern_number = ""; for (let poss of analyzed_possibilities) { - var out_line = "" + poss.pattern_description + ""; + var out_line = "" + i18next.t("patterns." + pat_desc[poss.pattern_number]) + ""; const style_price = buy_price || poss.prices[0].min; if (previous_pattern_number != poss.pattern_number) { previous_pattern_number = poss.pattern_number;