Answer the question
In order to leave comments, you need to log in
What is the best way to organize support for multiple languages?
Right now my project supports multiple languages with a giant singleton with a single public method:
public String getMessage(String ietfCode, String target) {
if (!verifyLangTarget(target))
throw new IllegalArgumentException("Invalid target \"" + target + "\"");
switch (ietfCode) {
case "ru" -> ruList.get(target);
case "ua" -> uaList.get(target);
case "be" -> beList.get(target);
case "pl" -> plList.get(target);
default -> enList.get(target);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question