Skip to content

Commit 4635ec8

Browse files
Merge pull request #714 from ArikSquad/feat/translations
Internationalization
2 parents 0551aeb + 642b8ec commit 4635ec8

File tree

173 files changed

+6952
-2484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+6952
-2484
lines changed

commons/src/main/java/net/swofty/commons/StringUtility.java

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
66
import net.minestom.server.instance.block.Block;
77
import net.minestom.server.item.Material;
8-
import net.swofty.commons.skyblock.statistics.ItemStatistic;
98

109
import java.math.RoundingMode;
1110
import java.text.DecimalFormat;
@@ -152,6 +151,86 @@ public static String profileAge(long tbf) {
152151
return formatTimeWentBy(System.currentTimeMillis() - tbf);
153152
}
154153

154+
/**
155+
* Unescapes a string that contains standard Java escape sequences.
156+
* This is untested and may not work as expected.
157+
*
158+
* @param input the string to unescape
159+
* @return the unescaped string
160+
*/
161+
public static String unescapeJava(String input) {
162+
if (input == null) {
163+
return null;
164+
}
165+
StringBuilder sb = new StringBuilder(input.length());
166+
for (int i = 0; i < input.length(); i++) {
167+
char c = input.charAt(i);
168+
if (c == '\\' && i < input.length() - 1) {
169+
char next = input.charAt(i + 1);
170+
switch (next) {
171+
case 'b':
172+
sb.append('\b');
173+
i++;
174+
break;
175+
case 't':
176+
sb.append('\t');
177+
i++;
178+
break;
179+
case 'n':
180+
sb.append('\n');
181+
i++;
182+
break;
183+
case 'f':
184+
sb.append('\f');
185+
i++;
186+
break;
187+
case 'r':
188+
sb.append('\r');
189+
i++;
190+
break;
191+
case '\"':
192+
sb.append('\"');
193+
i++;
194+
break;
195+
case '\'':
196+
sb.append('\'');
197+
i++;
198+
break;
199+
case '\\':
200+
sb.append('\\');
201+
i++;
202+
break;
203+
case 'u':
204+
// Unicode escape sequence:
205+
if (i + 5 < input.length()) {
206+
String hex = input.substring(i + 2, i + 6);
207+
try {
208+
int code = Integer.parseInt(hex, 16);
209+
sb.append((char) code);
210+
i += 5;
211+
} catch (NumberFormatException e) {
212+
// Not a valid Unicode escape, so fall back
213+
sb.append('\\').append('u');
214+
i++;
215+
}
216+
} else {
217+
sb.append('\\').append('u');
218+
i++;
219+
}
220+
break;
221+
default:
222+
// Unrecognized escape, skip the backslash
223+
sb.append(next);
224+
i++;
225+
break;
226+
}
227+
} else {
228+
sb.append(c);
229+
}
230+
}
231+
return sb.toString();
232+
}
233+
155234
public static String getAsRomanNumeral(int num) {
156235
if (num == 0) return "";
157236
int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bedwars.kill.died.default="<player> <gray>died."
2+
bedwars.kill.died_by.default="<player> <gray>was killed by <killer><gray>."
3+
bedwars.kill.projectile.default="<player> <gray>was shot by <killer><gray>."
4+
bedwars.kill.assist.default="<player> <gray>was killed by <victim><gray>'s <entity>."
5+
bedwars.kill.void.default="<player> <gray>fell in to the void."
6+
bedwars.kill.void_by.default="<player> <gray>was knocked into the void by <killer><gray>."
7+
bedwars.kill.bed.default="<gray>was destroyed by"
8+
bedwars.kill.final_kill="<aqua><bold>FINAL KILL!</aqua></bold>"
9+
bedwars.bed_destroyed="<white><bold>BED DESTRUCTION ></bold> <gray><team> Bed <gray><message> <gray>."
10+
bedwars.bed_destroyed_self="<white><bold>BED DESTRUCTION ></bold> <gray>Your bed <gray><message> <gray>."
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# ============================================================
2+
# Common / Shared
3+
# ============================================================
4+
commands.common.separator = <blue><strikethrough>-----------------------------------------------------
5+
commands.common.player_not_found = <red>Can't find a player by the name of '{player}'
6+
commands.common.player_not_found_short = <red>Could not find player: {player}
7+
commands.common.unknown_command_use_help = <red>Unknown command. Use /{command} for help.
8+
commands.common.service_offline_friend = <red>Could not connect to the friend service! Please try again later.
9+
commands.common.service_offline_party = <red>Could not connect to the party service! Please try again later.
10+
commands.common.service_offline_party_alt = <red>Couldn't find a party service! Please try again later.
11+
commands.common.service_offline_punishment = <red>Could not {action} this player at this time. The punishment service may be offline.
12+
commands.common.empty_line = <white>
13+
14+
# ============================================================
15+
# Friend Command
16+
# ============================================================
17+
commands.friend.help_header = <gold>Friend Commands
18+
commands.friend.help_add = <yellow>/f add <player> <dark_gray>- <gray>Add a player as a friend
19+
commands.friend.help_accept = <yellow>/f accept <player> <dark_gray>- <gray>Accept a friend request
20+
commands.friend.help_deny = <yellow>/f deny <player> <dark_gray>- <gray>Deny a friend request
21+
commands.friend.help_remove = <yellow>/f remove <player> <dark_gray>- <gray>Remove a friend
22+
commands.friend.help_removeall = <yellow>/f removeall <dark_gray>- <gray>Remove all friends (keeps best friends)
23+
commands.friend.help_best = <yellow>/f best <player> <dark_gray>- <gray>Toggle best friend status
24+
commands.friend.help_nickname = <yellow>/f nickname <player> <name> <dark_gray>- <gray>Set a nickname for a friend
25+
commands.friend.help_list = <yellow>/f list [page/best] <dark_gray>- <gray>List your friends
26+
commands.friend.help_requests = <yellow>/f requests [page] <dark_gray>- <gray>View pending friend requests
27+
commands.friend.help_toggle = <yellow>/f toggle <dark_gray>- <gray>Toggle accepting friend requests
28+
commands.friend.help_notifications = <yellow>/f notifications <dark_gray>- <gray>Toggle join/leave notifications
29+
commands.friend.error_not_found = <red>Couldn't find a player with that name!
30+
commands.friend.error_cannot_add_self = <red>You cannot add yourself as a friend!
31+
32+
# ============================================================
33+
# Party Command
34+
# ============================================================
35+
commands.party.help_header = <gold>Party Commands
36+
commands.party.help_accept = <yellow>/p accept <dark_gray>- <gray><italic>Accept a party invite from a player
37+
commands.party.help_invite = <yellow>/p invite <player> <dark_gray>- <gray><italic>Invite another player to your party
38+
commands.party.help_list = <yellow>/p list <dark_gray>- <gray><italic>Lists the players in your current party
39+
commands.party.help_leave = <yellow>/p leave <dark_gray>- <gray><italic>Leaves your current party
40+
commands.party.help_warp = <yellow>/p warp <dark_gray>- <gray><italic>Warps the members of a party to your current server
41+
commands.party.help_disband = <yellow>/p disband <dark_gray>- <gray><italic>Disbands the party
42+
commands.party.help_transfer = <yellow>/p transfer <player> <dark_gray>- <gray><italic>Transfers the party to another player
43+
commands.party.help_kick = <yellow>/p kick <player> <dark_gray>- <gray><italic>Remove a player from your party
44+
commands.party.help_promote = <yellow>/p promote <player> <dark_gray>- <gray><italic>Promote a player to moderator
45+
commands.party.help_demote = <yellow>/p demote <player> <dark_gray>- <gray><italic>Demote a player from moderator
46+
commands.party.help_chat = <yellow>/p chat <dark_gray>- <gray><italic>Sends a chat message to the entire party
47+
commands.party.help_hijack = <yellow>/p hijack <player> <dark_gray>- <gray><italic>Hijacks a party (Admin only)
48+
commands.party.not_in_party = <red>You are not in a party!
49+
commands.party.list_header = <gold>Party Members ({count})
50+
commands.party.list_leader = <yellow>Party Leader: {leader}
51+
commands.party.list_moderators = <yellow>Party Moderators: {moderators}
52+
commands.party.list_members = <yellow>Party Members: {members}
53+
commands.party.error_not_found = <red>Couldn't find a player with that name!
54+
commands.party.error_not_online = <red>That player is not online!
55+
commands.party.error_invite_self = <red>You cannot invite yourself!
56+
commands.party.error_already_in_party = <red>That player is already in your party!
57+
commands.party.error_must_leave_party = <red>You must leave your current party before accepting an invite!
58+
commands.party.error_need_staff = <red>You need STAFF to do this command
59+
60+
# ============================================================
61+
# Message Command
62+
# ============================================================
63+
commands.message.player_not_found = <red>Can't find a player by the name of '{player}'
64+
commands.message.player_not_online = <red>The player you tried to message, {player}, is not online.
65+
commands.message.outgoing = <light_purple>To {target}<gray>: {message}
66+
commands.message.incoming = <light_purple>From {sender}<gray>: {message}
67+
68+
# ============================================================
69+
# Mute Command
70+
# ============================================================
71+
commands.mute.invalid_reason = <red>Invalid mute reason. Use tab-completion to see valid options.
72+
commands.mute.success = <green>Successfully muted player <yellow>{player}<green>. <dark_gray>Punishment ID: <gray>{id}
73+
commands.mute.already_muted = <red>This player already has an active mute. Punishment ID: <gray>{id}
74+
commands.mute.failed = <red>Failed to mute player: {error}
75+
commands.mute.service_offline = <red>Could not mute this player at this time. The punishment service may be offline.
76+
77+
# ============================================================
78+
# Ban Command
79+
# ============================================================
80+
commands.ban.invalid_reason = <red>Invalid ban reason. Use tab-completion to see valid options.
81+
commands.ban.success = <green>Successfully banned player <yellow>{player}<green>. <dark_gray>Punishment ID: <gray>{id}
82+
commands.ban.already_banned = <red>This player is already banned. Use the tag -O to overwrite. Punishment ID: <gray>{id}
83+
commands.ban.failed = <red>Failed to ban player: {error}
84+
commands.ban.service_offline = <red>Could not ban this player at this time. The punishment service may be offline.
85+
86+
# ============================================================
87+
# UnMute Command
88+
# ============================================================
89+
commands.unmute.success = <green>Successfully unmuted player: {player}
90+
commands.unmute.service_offline = <red>Could not unmute this player at this time. The punishment service may be offline.
91+
92+
# ============================================================
93+
# UnBan Command
94+
# ============================================================
95+
commands.unban.success = <green>Successfully unbanned player: {player}
96+
commands.unban.service_offline = <red>Could not unban this player at this time. The punishment service may be offline.
97+
98+
# ============================================================
99+
# Rank Command
100+
# ============================================================
101+
commands.rank.player_not_found = <red>Couldn't find a player by the name of <yellow>{player}<red>.
102+
commands.rank.success = <green>Successfully set <yellow>{player}<green>'s rank to <yellow>{rank}<green>.
103+
104+
# ============================================================
105+
# Chat Command
106+
# ============================================================
107+
commands.chat.unknown_type = <red>Unknown chat type.
108+
commands.chat.staff_view_toggled = <green>Staff chat viewing is now {state}
109+
commands.chat.staff_view_enabled = <green>enabled
110+
commands.chat.staff_view_disabled = <red>disabled
111+
commands.chat.switched_channel = <green>You are now in the <gold>{channel} <green>channel
112+
113+
# ============================================================
114+
# Dragon Command
115+
# ============================================================
116+
commands.dragon.help_header = <gold>Dragon Commands
117+
commands.dragon.help_spawn = <yellow>/dragon spawn [speed] <dark_gray>- <gray>Spawn a dragon at your location
118+
commands.dragon.help_follow = <yellow>/dragon follow [speed] <dark_gray>- <gray>Make the dragon follow you
119+
commands.dragon.help_idle = <yellow>/dragon idle [distance] <dark_gray>- <gray>Make the dragon idle around your position
120+
commands.dragon.help_stop = <yellow>/dragon stop <dark_gray>- <gray>Stop the dragon
121+
commands.dragon.help_remove = <yellow>/dragon remove <dark_gray>- <gray>Remove your dragon
122+
commands.dragon.already_spawned = <red>You already have a dragon spawned! Use /dragon remove first.
123+
commands.dragon.spawned = <green>Dragon spawned!
124+
commands.dragon.no_dragon = <red>You don't have a dragon!
125+
commands.dragon.no_dragon_spawn_first = <red>You don't have a dragon! Use /dragon spawn first.
126+
commands.dragon.following = <green>Dragon is now following you at speed {speed}!
127+
commands.dragon.idling = <green>Dragon is now idling around your position with distance {distance}!
128+
commands.dragon.stopped = <green>Dragon stopped.
129+
commands.dragon.removed = <green>Dragon removed!
130+
131+
# ============================================================
132+
# Gamemode Command
133+
# ============================================================
134+
commands.gamemode.success = <green>Set your gamemode to <yellow>{gamemode}<green>.
135+
136+
# ============================================================
137+
# FlySpeed Command
138+
# ============================================================
139+
commands.flyspeed.success = <green>Set your {type} speed to <yellow>{speed}<green>.
140+
141+
# ============================================================
142+
# WipeMe Command
143+
# ============================================================
144+
commands.wipeme.kick_message = <red>You have been wiped
145+
146+
# ============================================================
147+
# Teleport Command
148+
# ============================================================
149+
commands.teleport.player_not_found = <red>Couldn't find a player by the name of <yellow>{player}<red>.
150+
151+
# ============================================================
152+
# AdminMe Command
153+
# ============================================================
154+
commands.adminme.running_checks = <dark_gray>Running checks...
155+
commands.adminme.not_allowed = <red>You are not allowed to use this command.
156+
commands.adminme.success = <green>Successfully set rank to {rank}<green>.
157+
158+
# ============================================================
159+
# StaffChat Command
160+
# ============================================================
161+
commands.staffchat.usage = <red>Usage: /sc <message>
162+
163+
# ============================================================
164+
# Hub Command
165+
# ============================================================
166+
commands.hub.must_complete_missions = <red>You must complete your starting missions!
167+
168+
# ============================================================
169+
# Warp Command
170+
# ============================================================
171+
commands.warp.warped_to = <gray>You have been warped to {destination}<gray>!
172+
commands.warp.not_unlocked = <red>You have not unlocked this warp.
173+
commands.warp.not_found = <red>Could not find a warp with the name '{warp}'.
174+
175+
# ============================================================
176+
# Coop Command
177+
# ============================================================
178+
commands.coop.no_outgoing_invite = <red>You don't have an outgoing co-op invite!
179+
commands.coop.create_hint = <yellow>Use <aqua>/coop <player 1> <player 2>... <yellow>to create one!
180+
commands.coop.add_hint = <yellow>Use <green>/coopadd <player> <yellow>to add a player to your current co-op!
181+
commands.coop.validating = <gray>Validating invite...
182+
commands.coop.cannot_invite_self = <red>You can't invite yourself to a co-op!
183+
commands.coop.players_not_online = <aqua>[Co-op] <red>One or more of the players you specified are not online!
184+
commands.coop.players_already_have_coop = <aqua>[Co-op] <red>One or more of the players you specified already have a co-op or an invite pending!
185+
commands.coop.cannot_invite_same_twice = <aqua>[Co-op] <red>You can't invite the same player twice!
186+
commands.coop.too_many_players = <aqua>[Co-op] <red>You can't invite more than 4 players!
187+
commands.coop.invite_sent = <aqua>[Co-op] <yellow>You invited {player} to a SkyBlock co-op!
188+
commands.coop.invite_received_separator = <aqua>----------------------------------------
189+
commands.coop.invite_received = {player} <yellow>invited you to a SkyBlock co-op!
190+
commands.coop.invite_click_to_view = <gold>Click here <yellow>to view!
191+
commands.coop.invite_click_hover = <yellow>Click here to view the invite
192+
commands.coop.status_hint = <yellow>Use <aqua>/coop <yellow>or <green><bold>CLICK THIS <yellow>for status!
193+
commands.coop.already_in_coop = <red>You are already in a co-op!
194+
commands.coop.leave_hint = <yellow>Run <green>/coopleave <yellow>to leave your current co-op.
195+
commands.coop.outgoing_invite_exists = <yellow>You already have an outgoing co-op invite! <green><bold>CLICK TO VIEW!
196+
commands.coop.incoming_invite_exists = <red>You already have an incoming co-op invite! <green><bold>CLICK TO VIEW!
197+
198+
# ============================================================
199+
# CoopLeave Command
200+
# ============================================================
201+
commands.coopleave.not_in_coop = <aqua>[Co-op] <red>You are not on a coop profile!
202+
commands.coopleave.cannot_leave_last = <aqua>[Co-op] <red>You cannot leave your last profile!
203+
commands.coopleave.make_another_profile = <aqua>[Co-op] <yellow>Make another profile before deleting this one.
204+
commands.coopleave.kick_message = <red>You must reconnect for this change to take effect
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# =============================================================================
2+
# Abiphone GUI Translations
3+
# =============================================================================
4+
5+
# --- GUIAbiphone / AbiphoneView ---
6+
gui_abiphone.sort_button = <green>Sort <aqua>TO-DO
7+
gui_abiphone.sort_button.lore = \n<gray> First Added\n<gray> Alphabetical\n<gray> Last Called\n<gray> Most Called\n<gray> Do Not Disturb First\n\n<aqua>Right-click to go backwards!\n<yellow>Click to switch!
8+
9+
gui_abiphone.contacts_directory = <green>Contacts Directory <aqua>TO-DO
10+
gui_abiphone.contacts_directory.lore = <gray>Browse through all NPCs in SkyBlock\n<gray>which both own an Abiphone AND are\n<gray>willing to add you as a contact.\n\n<gray>Your contacts: <green>{contact_count}<aqua>/{total_contacts}\n\n<yellow>Click to view contacts!
11+
12+
gui_abiphone.contact_manage_hint = <dark_gray>Right-click to manage!
13+
gui_abiphone.contact_call_hint = <yellow>Left-click to call!
14+
15+
gui_abiphone.ring_1 = <yellow>\u2706 RING...
16+
gui_abiphone.ring_2 = <yellow>\u2706 RING... RING...
17+
gui_abiphone.ring_3 = <yellow>\u2706 RING... RING... RING...
18+
19+
# --- GUIConfirmAbiphone ---
20+
gui_abiphone.confirm.title = Confirm
21+
gui_abiphone.confirm.confirm_button = <green>Confirm
22+
gui_abiphone.confirm.confirm_button.lore = <yellow>Click to remove {npc_name}\n<yellow>from your\ncontacts!
23+
gui_abiphone.confirm.cancel_button = <red>Cancel
24+
25+
# --- GUIContactManagement / GUIContactManagementView ---
26+
gui_abiphone.management.title = Contact Management
27+
28+
gui_abiphone.management.remove_contact = <red>Remove Contact
29+
gui_abiphone.management.remove_contact.lore = <gray>In case you're no longer friends, or\n<gray>whatever other reason.\n \n<yellow>Click to remove!
30+
31+
gui_abiphone.management.removed_message = <red>\u2706 Removed {npc_name} <red>from your contacts!

0 commit comments

Comments
 (0)