Skip to content

Commit 9afe13e

Browse files
committed
Improve error logging in ConnectLib and enhance LangType documentation
1 parent 8f7fa14 commit 9afe13e

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/main/java/fr/sandro642/github/ConnectLib.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static String getRoute(String routeName) {
8686
if (routes.containsKey(routeName)) {
8787
return routes.get(routeName);
8888
} else {
89-
ConnectLib.Logger().ERROR("Route '" + routeName + "' not found in the ConnectorAPI routes.");
89+
ConnectLib.Logger().ERROR(langManager.getMessage("connectlib.class", "getroute.error", Map.of("route", routeName)));
9090
return null;
9191
}
9292
}

src/main/java/fr/sandro642/github/enums/LangType.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package fr.sandro642.github.enums;
22

3+
/**
4+
* LangType is an enumeration representing different language codes used in the ConnectLib library.
5+
*
6+
* @author Sandro642
7+
* @version 1.0
8+
*/
9+
310
public enum LangType {
411
ENGLISH("EN_US"),
512
FRENCH("FR_EU"),
@@ -9,12 +16,23 @@ public enum LangType {
916
PORTUGUESE("PT_EU"),
1017
RUSSIAN("RU_RU");
1118

19+
/**
20+
* Language code.
21+
*/
1222
private final String lang;
1323

24+
/**
25+
* Constructor to initialize the language code.
26+
* @param lang
27+
*/
1428
LangType(String lang) {
1529
this.lang = lang;
1630
}
1731

32+
/**
33+
* Get the language code.
34+
* @return
35+
*/
1836
public String getLang() {
1937
return lang;
2038
}

0 commit comments

Comments
 (0)