-
Daisy Mae
-
- None of this would have been possible without Ninji's work figuring out just how Timmy
- and Tommy value their turnips.
-
-
- Support, comments and contributions are available through Github
-
-
Oh! And let's not forget to thank those who have contributed so far!
+
+
+
+
Contributors:
diff --git a/js/chart.js b/js/chart.js
index 9ea48c5..ee635ab 100644
--- a/js/chart.js
+++ b/js/chart.js
@@ -22,17 +22,17 @@ function update_chart(input_data, possibilities) {
datasets = [
{
- label: "Input Price",
+ label: i18next.t("output.chart.input"),
data: input_data.slice(1),
fill: false,
},
{
- label: "Minimum",
+ label: i18next.t("output.chart.minimum"),
data: possibilities[0].prices.slice(1).map(day => day.min),
fill: false,
},
{
- label: "Maximum",
+ label: i18next.t("output.chart.maximum"),
data: possibilities[0].prices.slice(1).map(day => day.max),
fill: "-1",
},
@@ -45,7 +45,7 @@ function update_chart(input_data, possibilities) {
chart_instance = new Chart(ctx, {
data: {
datasets: datasets,
- labels: ["Sunday", "Mon AM", "Mon PM", "Tue AM", "Tue PM", "Wed AM", "Wed PM", "Thu AM", "Thu PM", "Fri AM", "Fri PM", "Sat AM", "Sat PM"],
+ labels: [i18next.t("weekdays.sunday"), i18next.t("weekdays.abr.monday") + i18next.t("times.morning"), i18next.t("weekdays.abr.monday") + i18next.t("times.afternoon"), i18next.t("weekdays.abr.tuesday") + i18next.t("times.morning"), i18next.t("weekdays.abr.tuesday") + i18next.t("times.afternoon"), i18next.t("weekdays.abr.wednesday") + i18next.t("times.morning"), i18next.t("weekdays.abr.wednesday") + i18next.t("times.afternoon"), i18next.t("weekdays.abr.thursday") + i18next.t("times.morning"), i18next.t("weekdays.abr.thursday") + i18next.t("times.afternoon"), i18next.t("weekdays.abr.friday") + i18next.t("times.morning"), i18next.t("weekdays.abr.friday") + i18next.t("times.afternoon"), i18next.t("weekdays.abr.saturday") + i18next.t("times.morning"), i18next.t("weekdays.abr.saturday") + i18next.t("times.afternoon")],
},
options: chart_options,
type: "line",
diff --git a/js/predictions.js b/js/predictions.js
index 51353e2..52acd2c 100644
--- a/js/predictions.js
+++ b/js/predictions.js
@@ -560,7 +560,7 @@ function*
}
yield {
- pattern_description: "Fluctuating",
+ pattern_description: i18next.t("patterns.fluctuating"),
pattern_number: 0,
prices: predicted_prices,
probability,
@@ -639,7 +639,7 @@ function* generate_pattern_1_with_peak(given_prices, peak_start) {
}
}
yield {
- pattern_description: "Large spike",
+ pattern_description: i18next.t("patterns.large-spike"),
pattern_number: 1,
prices: predicted_prices,
probability,
@@ -686,7 +686,7 @@ function* generate_pattern_2(given_prices) {
}
yield {
- pattern_description: "Decreasing",
+ pattern_description: i18next.t("patterns.decreasing"),
pattern_number: 2,
prices: predicted_prices,
probability,
@@ -767,7 +767,7 @@ function* generate_pattern_3_with_peak(given_prices, peak_start) {
}
yield {
- pattern_description: "Small spike",
+ pattern_description: i18next.t("patterns.small-spike"),
pattern_number: 3,
prices: predicted_prices,
probability,
@@ -863,7 +863,7 @@ function analyze_possibilities(sell_prices, first_buy, previous_pattern) {
}
generated_possibilities.unshift({
- pattern_description: "All patterns",
+ 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 242a2f2..f9c834f 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -85,7 +85,7 @@ const initialize = function () {
$("#permalink-btn").on("click", copyPermalink)
$("#reset").on("click", function () {
- if (window.confirm("Are you sure you want to reset all fields?\n\nThis cannot be undone!")) {
+ if (window.confirm(i18next.t("prices.reset-warning"))) {
sell_inputs.forEach(input => input.value = '')
fillFields([], false, -1)
update()
@@ -260,7 +260,7 @@ const calculateOutput = function (data, first_buy, previous_pattern) {
out_line += `
${Number.isFinite(poss.probability) ? ((poss.probability * 100).toPrecision(3) + '%') : '—'} | `;
for (let day of poss.prices.slice(1)) {
if (day.min !== day.max) {
- out_line += `
${day.min} to ${day.max} | `;
+ out_line += `
${day.min} ${i18next.t("output.to")} ${day.max} | `;
} else {
out_line += `
${day.min} | `;
}
@@ -308,7 +308,7 @@ const copyPermalink = function () {
document.execCommand('copy');
permalink_input.hide();
- flashMessage("Permalink copied!");
+ flashMessage(i18next.t("prices.permalink-copied"));
}
const flashMessage = function(message) {
diff --git a/locales/en.json b/locales/en.json
index ccbb406..b31cefd 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -1,13 +1,80 @@
{
+ "general": {
+ "name": "Turnip Prophet",
+ "daisymae": "Daisy Mae"
+ },
+ "welcome": {
+ "salutation": "Hello, and welcome to the
Turnip Prophet app on your Nook Phone.",
+ "description": "This app lets you track your island's turnip prices daily, but you'll have to put the prices in yourself!",
+ "conclusion": "After that, the Turnip Prophet app will
magically predict the turnip prices you'll have for the rest of the week."
+ },
+ "firsttime": {
+ "title": "First-Time Buyer",
+ "description": "Is this your first time buying turnips from Daisy Mae on your island?
(This affects your pattern)",
+ "yes": "Yes",
+ "no": "No"
+ },
"patterns": {
+ "title": "Previous Pattern",
+ "description": "What was last week's turnip price pattern?
(This affects your pattern)",
+ "pattern": "Pattern",
+ "all": "All patterns",
"decreasing": "Decreasing",
"fluctuating": "Fluctuating",
"unknown": "I don't know",
"large-spike": "Large Spike",
"small-spike": "Small Spike"
},
+ "prices": {
+ "description": "What was the price of turnips this week on your island?
(If this is your first time buying turnips, this field will be disabled)",
+ "open": {
+ "am": "AM - 8:00 am to 11:59 am",
+ "pm": "PM - 12:00 pm to 10:00 pm"
+ },
+ "copy-permalink": "Copy permalink",
+ "permalink-copied": "Permalink copied!",
+ "reset": "Reset Turnip Prophet",
+ "reset-warning": "Are you sure you want to reset all fields?\n\nThis cannot be undone!"
+ },
+ "weekdays": {
+ "monday": "Monday",
+ "tuesday": "Tuesday",
+ "wednesday": "Wednesday",
+ "thursday": "Thursday",
+ "friday": "Friday",
+ "saturday" : "Saturday",
+ "sunday": "Sunday",
+ "abr": {
+ "monday": "Mon ",
+ "tuesday": "Tue ",
+ "wednesday": "Wed ",
+ "thursday": "Thu ",
+ "friday": "Fri ",
+ "saturday" : "Sat "
+ }
+ },
"times": {
"morning": "AM",
"afternoon": "PM"
+ },
+ "output": {
+ "title": "Output",
+ "chance": "% Chance",
+ "to": "to",
+ "minimum": "Guaranteed Minimum",
+ "maximum": "Guaranteed Maximum",
+ "chart": {
+ "input": "Input Price",
+ "minimum": "Minimum",
+ "maximum": "Maximum"
+ }
+ },
+ "textbox": {
+ "description": "After you've listed some turnip prices, the Turnip Prophet will run some numbers and display the different possible patterns that your island may experience.",
+ "development": "This app is still in development, but will improve over time!",
+ "thanks": "None of this would have been possible without
Ninji's work figuring out just how Timmy and Tommy value their turnips.",
+ "support": "Support, comments and contributions are available through
Github",
+ "contributors-text": "Oh! And let's not forget to thank those who have contributed so far!",
+ "contributors": "Contributors"
}
}