Package cn.nukkit.lang
Class PluginI18n
java.lang.Object
cn.nukkit.lang.PluginI18n
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLang
(LangCode langName, InputStream stream) Add lang.void
Add lang.boolean
获取指定id对应的多语言文本,若不存在则返回nullGets fallback language.getOrOriginal
(LangCode lang, String id) 获取指定id对应的多语言文本,若不存在则返回id本身int
hashCode()
protected String
protected String
parseLanguageText
(LangCode lang, String str) boolean
reloadLang
(LangCode lang, InputStream stream) Reload lang boolean.boolean
reloadLang
(LangCode lang, String path) Reload lang boolean.void
setFallbackLanguage
(LangCode fallback) Sets fallback language.tr
(LangCode lang, TextContainer c) 翻译文本容器翻译一个文本key,key从语言文件中查询翻译一个文本key,key从语言文件中查询,并且按照给定参数填充其中参数翻译一个文本key,key从语言文件中查询,并且按照给定参数填充其中参数
-
Constructor Details
-
PluginI18n
-
-
Method Details
-
tr
翻译一个文本key,key从语言文件中查询Translate a text key, the key is queried from the language file
- Parameters:
lang
- 要翻译的语言key
- the key- Returns:
- the string
-
tr
翻译一个文本key,key从语言文件中查询,并且按照给定参数填充其中参数Translate a text key, the key is queried from the language file and the parameters are filled according to the given parameters
- Parameters:
lang
- 要翻译的语言key
- the keyargs
- the args- Returns:
- the string
-
tr
翻译一个文本key,key从语言文件中查询,并且按照给定参数填充其中参数Translate a text key, the key is queried from the language file and the parameters are filled according to the given parameters
- Parameters:
lang
- 要翻译的语言key
- the keyargs
- the args- Returns:
- the string
-
tr
翻译文本容器Tr string.
- Parameters:
lang
- 要翻译的语言c
- the c- Returns:
- the string
-
get
获取指定id对应的多语言文本,若不存在则返回nullGet the multilingual text corresponding to the specified id, or return null if it does not exist
- Parameters:
id
- the id- Returns:
- the string
-
getOrOriginal
获取指定id对应的多语言文本,若不存在则返回id本身Get the multilingual text corresponding to the specified id, or return the id itself if it does not exist
- Parameters:
id
- the id- Returns:
- the string
-
parseLanguageText
-
addLang
Add lang.- Parameters:
langName
- the lang namepath
- the path
-
addLang
Add lang.- Parameters:
langName
- the lang namestream
- the stream
-
reloadLang
Reload lang boolean.- Parameters:
lang
- the langpath
- the path- Returns:
- the boolean
-
reloadLang
Reload lang boolean.- Parameters:
lang
- the langstream
- the stream- Returns:
- the boolean
-
getFallbackLanguage
Gets fallback language.- Returns:
- the fallback language
-
setFallbackLanguage
Sets fallback language.- Parameters:
fallback
- the fallback
-
equals
-
hashCode
public int hashCode() -
parseArg
-