@@ -553,7 +553,8 @@ public void save(
553553 AsyncCommandBuilder .wrap (task , actor )
554554 .registerWithSupervisor (worldEdit .getSupervisor (), "Saving schematic " + filename )
555555 .setDelayMessage (Caption .of ("worldedit.schematic.save.saving" ))
556- .onSuccess (filename + " saved" + (overwrite ? " (overwriting previous file)." : "." ), null )
556+ .onSuccess (Caption .of ("fawe.worldedit.schematic.schematic.saved" , filename , (overwrite ?
557+ " (overwriting previous file)." : "." )), null )
557558 .onFailure (
558559 Caption .of ("worldedit.schematic.failed-to-save" ),
559560 worldEdit .getPlatformManager ().getPlatformCommandManager ().getExceptionConverter ()
@@ -975,13 +976,9 @@ public Void call() throws Exception {
975976 int limit = actor .getLimit ().SCHEM_FILE_NUM_LIMIT ;
976977
977978 if (numFiles >= limit ) {
978- TextComponent noSlotsErr = TextComponent .of ( //TODO - to be moved into captions/translatablecomponents
979- String .format (
980- "You have " + numFiles + "/" + limit + " saved schematics. Delete some to save this one!" ,
981- TextColor .RED
982- ));
983979 LOGGER .info (actor .getName () + " failed to save " + file .getCanonicalPath () + " - too many schematics!" );
984- throw new WorldEditException (noSlotsErr ) {
980+ actor .print (Caption .of ("fawe.error.schematic.over.count.limit" , numFiles , limit ).color (TextColor .RED ));
981+ throw new WorldEditException (Caption .of ("fawe.error.schematic.over.limit" , numFiles , limit )) {
985982 };
986983 }
987984 }
@@ -1008,9 +1005,7 @@ public Void call() throws Exception {
10081005 closer .close (); // release the new .schem file so that its size can be measured
10091006 double filesizeKb = Files .size (Paths .get (file .getAbsolutePath ())) / 1000.0 ;
10101007
1011- TextComponent filesizeNotif = TextComponent .of ( //TODO - to be moved into captions/translatablecomponents
1012- SCHEMATIC_NAME + " size: " + String .format ("%.1f" , filesizeKb ) + "kb" , TextColor .GRAY );
1013- actor .print (filesizeNotif );
1008+ actor .print (Caption .of ("fawe.worldedit.schematic.schematic.size" , SCHEMATIC_NAME , String .format ("%.1f" , filesizeKb )));
10141009
10151010 if (checkFilesize ) {
10161011
@@ -1023,17 +1018,11 @@ public Void call() throws Exception {
10231018
10241019 if ((curKb ) > allocatedKb ) {
10251020 file .delete ();
1026- TextComponent notEnoughKbErr = TextComponent .of (
1027- //TODO - to be moved into captions/translatablecomponents
1028- "You're about to be at " + String .format ("%.1f" , curKb ) + "kb of schematics. ("
1029- + String .format (
1030- "%dkb" ,
1031- allocatedKb
1032- ) + " available) Delete some first to save this one!" ,
1033- TextColor .RED
1034- );
1021+ actor .print (Caption .of ("fawe.error.schematic.over.disk.limit" , String .format ("%.1f" , curKb )
1022+ , String .format ("%dkb" , allocatedKb )).color (TextColor .RED ));
10351023 LOGGER .info (actor .getName () + " failed to save " + SCHEMATIC_NAME + " - not enough space!" );
1036- throw new WorldEditException (notEnoughKbErr ) {
1024+ throw new WorldEditException (Caption .of ("fawe.error.schematic.over.disk.limit" , String .format ("%.1f" , curKb )
1025+ , String .format ("%dkb" , allocatedKb ))) {
10371026 };
10381027 }
10391028 if (overwrite ) {
@@ -1042,23 +1031,13 @@ public Void call() throws Exception {
10421031 } else {
10431032 numFiles ++;
10441033 }
1045- TextComponent kbRemainingNotif = TextComponent .of (
1046- //TODO - to be moved into captions/translatablecomponents
1047- "You have " + String .format ("%.1f" , (allocatedKb - curKb )) + "kb left for schematics." ,
1048- TextColor .GRAY
1049- );
1050- actor .print (kbRemainingNotif );
1034+
1035+ actor .print (Caption .of ("fawe.worldedit.schematic.schematic.disk.space" , String .format ("%.1f" , (allocatedKb - curKb ))));
10511036 }
10521037
10531038 if (Settings .settings ().PATHS .PER_PLAYER_SCHEMATICS && actor .getLimit ().SCHEM_FILE_NUM_LIMIT > -1 ) {
10541039
1055- TextComponent slotsRemainingNotif = TextComponent .of (
1056- //TODO - to be moved into captions/translatablecomponents
1057- "You have " + (actor .getLimit ().SCHEM_FILE_NUM_LIMIT - numFiles )
1058- + " schematic file slots left." ,
1059- TextColor .GRAY
1060- );
1061- actor .print (slotsRemainingNotif );
1040+ actor .print (Caption .of ("fawe.worldedit.schematic.schematic.slots.free" , (actor .getLimit ().SCHEM_FILE_NUM_LIMIT - numFiles )));
10621041 }
10631042 LOGGER .info (actor .getName () + " saved " + file .getCanonicalPath ());
10641043 } else {
0 commit comments