-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathupdateLoc.js
124 lines (103 loc) · 3.72 KB
/
updateLoc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Copies the exported lang file from Distant Seas and edits the descriptions for translators
// Requires you to hit "Export lang" in the DEBUG > Misc tab
const fs = require("fs");
const path = require("path");
const locPath = process.argv[2];
const loc = JSON.parse(fs.readFileSync(locPath, "utf8"));
const newLoc = {};
for (const [key, value] of Object.entries(loc)) {
const originalDescription = value.description;
if (value.description === "AboutSection.Draw") {
const notBullets = [
"AboutSectionHeader",
"AboutSectionVersion",
"AboutSectionDescriptionStart"
];
if (key.startsWith("AboutSectionButton")) {
value.description =
"Displayed on a clickable button at the bottom of the About tab.";
} else if (notBullets.includes(key)) {
value.description = "Displayed in the About tab.";
} else {
value.description = "Displayed in a bullet point in the About tab.";
}
}
if (value.description.includes("SettingsSection")) {
if (key.endsWith("Description")) {
value.description =
"Displayed in the Settings tab, as a help label next to a configurable option.";
} else {
value.description =
"Displayed in the Settings tab - most likely a label accompanied by a configurable option.";
}
}
const sections = [
"AboutSection",
"JournalSection",
"LeaderboardSection",
"ProgressSection",
"SchedulesSection",
"SettingsSection"
];
if (sections.includes(key)) {
value.description =
"The name of a section, displayed on the left sidebar of the main window.";
}
if (key === "CommandHelpMessage") {
value.description =
"Displayed in the Plugin Installer as the description for the /pseas command.";
}
if (key.startsWith("Time")) {
value.description =
"A time of day. Displayed in the Schedules section, and on a tooltip in the overlay.";
}
if (key.startsWith("VoyageMissionType")) {
value.description =
"A type of fish, used in voyage missions. Displayed on a tooltip in the overlay.";
}
if (key.startsWith("SchedulesSection")) {
value.description =
"Displayed in the Schedules section, most likely on a table header.";
}
if (key.startsWith("RelativeDate")) {
value.description =
"Displayed in the Schedules section, representing a relative date. The input is a number.";
}
if (key === "ZoneText") {
value.description =
"Displayed in the overlay, to the right of the zone name. The input is a number between 1 and 3.";
}
if (key === "ZoneHoverText") {
value.description =
"Displayed in the overlay, when hovering over the current zone.";
}
if (key.startsWith("Overlay")) {
if (key.startsWith("OverlayTooltip")) {
value.description = "Displayed in a tooltip in the overlay.";
} else {
value.description = "Displayed in the overlay.";
}
}
if (key === "AlarmMessage") {
value.description = "Displayed in the chat window when the alarm goes off.";
}
if (["JournalActive", "JournalEnabled", "JournalDisabled"].includes(key)) {
value.description = "Displayed at the top of the Journal section.";
}
if (key.startsWith("JournalSection")) {
value.description =
"Displayed in the Journal section, most likely on a button or table header.";
}
if (key.startsWith("ProgressSection")) {
value.description =
"Displayed in the Progress section, most likely on a table header.";
}
if (key.startsWith("LeaderboardSection")) {
value.description = "Displayed in the Leaderboard section.";
}
if (value.description == originalDescription) {
console.warn(`No description for ${key}`);
}
newLoc[key] = value;
}
fs.writeFileSync("./loc.json", JSON.stringify(newLoc, null, 2));