mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-29 19:41:35 +01:00
Removes Html.loadLocale(File)
This commit is contained in:
parent
891bb90a3a
commit
19ce7b5ed6
@ -32,14 +32,17 @@ public class WebLevelCommand extends SubCommand {
|
||||
ColorScheme cs = plugin.getColorScheme();
|
||||
String sCol = cs.getSecondaryColor();
|
||||
String cmdBall = Locale.get(Msg.CMD_CONSTANT_LIST_BALL).parse();
|
||||
String cmdFooter = Locale.get(Msg.CMD_CONSTANT_FOOTER).parse();
|
||||
|
||||
String[] messages = new String[]{
|
||||
Locale.get(Msg.CMD_CONSTANT_FOOTER).parse(),
|
||||
cmdBall + sCol + "0: Access all pages",
|
||||
cmdBall + sCol + "1: Access '/players' and all inspect pages",
|
||||
cmdBall + sCol + "2: Access inspect page with the same username as the webuser",
|
||||
cmdBall + sCol + "3+: No permissions",
|
||||
Locale.get(Msg.CMD_CONSTANT_FOOTER).parse()
|
||||
cmdFooter,
|
||||
cmdBall + sCol + "0: Access all pages",
|
||||
cmdBall + sCol + "1: Access '/players' and all inspect pages",
|
||||
cmdBall + sCol + "2: Access inspect page with the same username as the webuser",
|
||||
cmdBall + sCol + "3+: No permissions",
|
||||
cmdFooter
|
||||
};
|
||||
|
||||
sender.sendMessage(messages);
|
||||
return true;
|
||||
}
|
||||
|
@ -1,13 +1,6 @@
|
||||
package main.java.com.djrapitops.plan.ui.html;
|
||||
|
||||
import com.djrapitops.plugin.utilities.Verify;
|
||||
import main.java.com.djrapitops.plan.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* @author Rsl1122
|
||||
@ -69,41 +62,6 @@ public enum Html {
|
||||
this.html = html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param localeFile
|
||||
*/
|
||||
public static void loadLocale(File localeFile) {
|
||||
try (Scanner localeScanner = new Scanner(localeFile, "UTF-8")) {
|
||||
List<String> localeRows = new ArrayList<>();
|
||||
boolean html = false;
|
||||
|
||||
while (localeScanner.hasNextLine()) {
|
||||
String line = localeScanner.nextLine();
|
||||
if (line.equals("<<<<<<HTML>>>>>>")) {
|
||||
html = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!html) {
|
||||
continue;
|
||||
}
|
||||
|
||||
localeRows.add(line);
|
||||
}
|
||||
|
||||
for (String localeRow : localeRows) {
|
||||
try {
|
||||
String[] split = localeRow.split(" <> ");
|
||||
Html.valueOf(split[0]).setHtml(split[1]);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.error("There is a miswritten lines in locale on lines " + localeRows.indexOf(localeRow));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.error("Something went wrong at loading locale " + localeFile.getAbsoluteFile() + ": " + e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user