Index
SimpleTranslations.check_valid
SimpleTranslations.get_language
SimpleTranslations.get_language
SimpleTranslations.get_msg
SimpleTranslations.get_msg
SimpleTranslations.get_msg
SimpleTranslations.loadmsgs
SimpleTranslations.loadmsgs
SimpleTranslations.loadmsgs
SimpleTranslations.loadmsgs!
SimpleTranslations.parse_msg
SimpleTranslations.parse_option
SimpleTranslations.set_language!
SimpleTranslations.set_language!
SimpleTranslations.set_language!
SimpleTranslations.get_language
— Methodget_language(conf)
Return the current language of the MessagesTranslator
Arguments
- conf MessagesTranslator
SimpleTranslations.get_language
— Methodget_language()
Return the language of the current global MessagesTranslator
SimpleTranslations.get_msg
— MethodGet the translated message in the global Translater
Arguments
- id: identificator of the message.
SimpleTranslations.get_msg
— Methodget_msg(conf::MessagesTranslator, id::AbstractString)
return the id message translate to current language
SimpleTranslations.loadmsgs!
— Methodloadmsgs!(file; strict_mode=false)
Load the messages in a global variable.
Arguments
file::IO
: file to get the messages.strict_mode::Bool=false
: strict mode (default=false).
@ref loadmsgs
Example
@example loadmsgs!("test/test.ini")
SimpleTranslations.loadmsgs
— Methodloadmsgs(filename; strict_mode=false)
read the file with the message list.
Arguments
filename::AbstractString
: name of the file to get the messages.strict_mode::Bool=false
: strict mode (default=false).
SimpleTranslations.loadmsgs
— Methodloadmsgs(file, strict_mode)
read the file with the message list.
Arguments
file::IO
: file to get the messages.strict_mode::Bool=false
: strict mode (default=false).
SimpleTranslations.set_language!
— Methodset_language!(lang)
Set the language to lang in future messages.
Arguments lang language identification.
Example
set_language!("es")
SimpleTranslations.set_language!
— Methodset_language!(conf::MessagesTranslator, lang::AbstractString)
update the current language
SimpleTranslations.check_valid
— Methodis_valid(translation)
Check if the translation is perfect, for strict mode.
If any error is detected, an exception is throw
SimpleTranslations.parse_msg
— Methodparse_msg
Parse the message separate the key, value by "="
SimpleTranslations.parse_option
— Methodparse_option(line)
Parse the option, separated the values by ","