2018-10-28 09:10:56 +01:00
|
|
|
|
/*
|
|
|
|
|
* This file is part of Player Analytics (Plan).
|
|
|
|
|
*
|
|
|
|
|
* Plan is free software: you can redistribute it and/or modify
|
2018-11-11 19:55:11 +01:00
|
|
|
|
* it under the terms of the GNU Lesser General Public License v3 as published by
|
2018-10-28 09:10:56 +01:00
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* Plan is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2018-11-11 19:55:11 +01:00
|
|
|
|
* GNU Lesser General Public License for more details.
|
2018-10-28 09:10:56 +01:00
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2019-08-30 22:14:54 +02:00
|
|
|
|
package com.djrapitops.plan.settings.locale;
|
2018-07-28 17:31:07 +02:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Language enum of supported languages, follows ISO 639-1 for language codes.
|
|
|
|
|
*
|
2021-02-13 14:16:03 +01:00
|
|
|
|
* @author AuroraLS3
|
2018-07-28 17:31:07 +02:00
|
|
|
|
*/
|
|
|
|
|
public enum LangCode {
|
|
|
|
|
|
2019-04-20 11:04:07 +02:00
|
|
|
|
CUSTOM("Custom", ""),
|
2021-02-13 14:16:03 +01:00
|
|
|
|
EN("English", "AuroraLS3"),
|
2022-04-06 16:37:23 +02:00
|
|
|
|
ES("Español", "Catalina, itaquito, Elguerrero & 4drian3d"),
|
2024-01-28 08:05:07 +01:00
|
|
|
|
CN("\u6C49\u8BED", "f0rb1d (\u4f5b\u58c1\u706f), qsefthuopq, shaokeyibb, Fur_xia, 10935336, SkipM4, TheLittle_Yang, jhqwqmc & liuzhen932"), // Simplified Chinese
|
2024-01-06 16:59:29 +01:00
|
|
|
|
CS("\u010de\u0161tina", "Shadowhackercz, QuakyCZ, MrFriggo & WolverStones"),
|
2022-09-30 16:27:41 +02:00
|
|
|
|
DE("Deutsch", "Eyremba, fuzzlemann, Morsmorse, hallo1142 & DubHacker"),
|
2022-04-11 19:06:09 +02:00
|
|
|
|
FI("suomi", "AuroraLS3, KasperiP"),
|
2024-03-14 19:44:50 +01:00
|
|
|
|
FR("français", "CyanTech, Aurelien, Nogapra & Sniper_TVmc"),
|
2022-04-06 16:37:23 +02:00
|
|
|
|
IT("Italiano", "Malachiel & Mastory_Md5"),
|
2023-09-27 13:14:21 +02:00
|
|
|
|
JA("\u65E5\u672C\u8A9E", "yukieji, inductor, lis2a, yu_solt , Jumala9163 & ringoXD"),
|
2022-04-06 16:37:23 +02:00
|
|
|
|
KO("\uD55C\uAD6D\uC5B4", "Guinness_Akihiko"),
|
|
|
|
|
NL("Nederlands", "Sander0542"),
|
2024-01-06 16:59:29 +01:00
|
|
|
|
RU("ру\u0441\u0441к\u0438\u0439", "Saph1s, Perhun_Pak, BratishkaErik & stashenko"),
|
2022-04-06 16:37:23 +02:00
|
|
|
|
TR("Türkçe", "TDJisvan, BruilsiozPro & EyuphanMandiraci"),
|
2024-01-06 16:59:29 +01:00
|
|
|
|
UK("україн\u0441ька \u043cо\u0432а", "xlanyleeet"),
|
2022-04-06 16:37:23 +02:00
|
|
|
|
PT_BR("Português", "jvmuller"),
|
|
|
|
|
ZH_TW("\u6F22\u8A9E", "\u6d1b\u4f0a & zisunny104");
|
2018-07-28 17:31:07 +02:00
|
|
|
|
|
|
|
|
|
private final String name;
|
2019-04-20 11:04:07 +02:00
|
|
|
|
private final String authors;
|
2018-07-28 17:31:07 +02:00
|
|
|
|
|
2019-04-20 11:04:07 +02:00
|
|
|
|
LangCode(String name, String authors) {
|
2018-07-28 17:31:07 +02:00
|
|
|
|
this.name = name;
|
2019-04-20 11:04:07 +02:00
|
|
|
|
this.authors = authors;
|
2018-07-28 17:31:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static LangCode fromString(String code) {
|
|
|
|
|
try {
|
|
|
|
|
return LangCode.valueOf(code.toUpperCase());
|
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
|
return LangCode.EN;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-20 11:04:07 +02:00
|
|
|
|
public String getAuthors() {
|
|
|
|
|
return authors;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-28 17:31:07 +02:00
|
|
|
|
public String getFileName() {
|
2022-04-06 16:37:23 +02:00
|
|
|
|
return "locale_" + name() + ".yml";
|
2018-07-28 17:31:07 +02:00
|
|
|
|
}
|
|
|
|
|
}
|