Class LanguageManager
- java.lang.Object
-
- de.dytanic.cloudnet.common.language.LanguageManager
-
public final class LanguageManager extends java.lang.ObjectThe LanguageManager is a static service, which handles messages from different languages, which are registered or loaded there
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddLanguageFile(java.lang.String language, Properties properties)Add a new language properties, which can resolve with getMessage() in the configured language.static voidaddLanguageFile(java.lang.String language, java.io.File file)Deprecated.static voidaddLanguageFile(java.lang.String language, java.io.InputStream inputStream)Add a new language properties, which can resolve with getMessage() in the configured language.static voidaddLanguageFile(java.lang.String language, java.io.Reader reader)Add a new language properties, which can resolve with getMessage() in the configured language.static voidaddLanguageFile(java.lang.String language, java.nio.file.Path file)Add a new language properties, which can resolve with getMessage() in the configured language.static java.lang.StringgetLanguage()static java.lang.StringgetMessage(java.lang.String property)Resolve and returns the following message in the language which is currently set as member "language"static voidsetLanguage(java.lang.String language)
-
-
-
Method Detail
-
getMessage
public static java.lang.String getMessage(java.lang.String property)
Resolve and returns the following message in the language which is currently set as member "language"- Parameters:
property- the following message property, which should sort out- Returns:
- the message which is defined in language cache or a fallback message like
"<language LANGUAGE not found>"or"<message property not found in LANGUAGE>"
-
addLanguageFile
public static void addLanguageFile(java.lang.String language, Properties properties)Add a new language properties, which can resolve with getMessage() in the configured language.- Parameters:
language- the language, which should appendproperties- the properties which will add in the language as parameter
-
addLanguageFile
@Deprecated public static void addLanguageFile(java.lang.String language, java.io.File file)Deprecated.Add a new language properties, which can resolve with getMessage() in the configured language.- Parameters:
language- the language, which should appendfile- the properties which will add in the language as parameter
-
addLanguageFile
public static void addLanguageFile(java.lang.String language, java.nio.file.Path file)Add a new language properties, which can resolve with getMessage() in the configured language.- Parameters:
language- the language, which should appendfile- the properties which will add in the language as parameter
-
addLanguageFile
public static void addLanguageFile(java.lang.String language, java.io.InputStream inputStream)Add a new language properties, which can resolve with getMessage() in the configured language.- Parameters:
language- the language, which should appendinputStream- the properties which will add in the language as parameter
-
addLanguageFile
public static void addLanguageFile(java.lang.String language, java.io.Reader reader)Add a new language properties, which can resolve with getMessage() in the configured language.- Parameters:
language- the language, which should appendreader- the properties which will be added in the language as parameter
-
getLanguage
public static java.lang.String getLanguage()
-
setLanguage
public static void setLanguage(java.lang.String language)
-
-