Interface LocalizationManager
-
public interface LocalizationManager
LocalizationManager holds and manages text translations (i18n)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCurrentLanguage()
List<Language>
getLanguages()
Integer
getNextId()
void
load(InputStream stream)
void
put(String lang, String id, String value)
void
remove(String id)
void
reset()
void
setLanguage(String lang)
String
translate(Integer id)
Returns a localized textString
translate(Integer id, String defaultText)
Returns a localized textString
translate(String id)
Returns a localized textString
translate(String id, String defaultText)
Returns a localized text
-
-
-
Method Detail
-
reset
@RestrictedMethod void reset()
-
load
@RestrictedMethod void load(InputStream stream)
-
setLanguage
void setLanguage(String lang)
-
getLanguages
@RestrictedMethod List<Language> getLanguages()
-
getCurrentLanguage
String getCurrentLanguage()
-
translate
String translate(Integer id)
Returns a localized text- Parameters:
id
- Default mod ("game-core") text identifier- Returns:
- localized text
-
translate
String translate(String id)
Returns a localized text- Parameters:
id
- Text identifier. For default mod texts it's just the id, else it is also prefixed. Examples: "123", "prefix-123"- Returns:
- localized text
-
translate
String translate(Integer id, String defaultText)
Returns a localized text- Parameters:
id
- Default mod ("game-core") text identifier- Returns:
- localized text or default text if localization id is not mapped
-
translate
String translate(String id, String defaultText)
Returns a localized text- Parameters:
id
- Text identifier. For default mod texts it's just the id, else it is also prefixed. Examples: "123", "prefix-123"- Returns:
- localized text or default text if localization id is not mapped
-
put
@RestrictedMethod void put(String lang, String id, String value)
-
remove
@RestrictedMethod void remove(String id)
-
getNextId
@RestrictedMethod Integer getNextId()
-
-