Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected Map<String, String> loadLang(String lang) {
- try {
- String content = Utils.readFile(getClass().getClassLoader().getResourceAsStream("lang/"+lang+".ini"));
- Map<String, String> d = new HashMap<>();
- for (String line : content.split("n")) {
- line = line.trim();
- if (line.equals("") || line.charAt(0) == '#') {
- continue;
- }
- String[] t = line.split("=");
- if (t.length < 2) {
- continue;
- }
- String key = t[0];
- String value = "";
- for (int i = 1; i < t.length - 1; i++) {
- value += t[i] + "=";
- }
- value += t[t.length - 1];
- if (value.equals("")) {
- continue;
- }
- d.put(key, value);
- }
- return d;
- } catch (IOException e) {
- Server.getInstance().getLogger().logException(e);
- return null;
- }
- }
- Далее this.languages().get(key); мне выведет value. В котором и нужно реализовать перенос строки
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement