Documentation ¶
Overview ¶
Package user contains the list of administrative user for the system. All users have accesses, into a profile and even extended access based upon table records. It needs base xmodule.
Index ¶
- Constants
- Variables
- func AddTheme(sitecontext applications.Datasource, theme string, name string, source int, ...) error
- func GetTranslation(sitecontext applications.Datasource, textooriginal string, theme string, ...) (string, bool, time.Time, int)
- func GoogleTranslation(data []string, fromLang language.Tag, toLang language.Tag) ([]translate.Translation, error)
- func SetTranslation(sitecontext applications.Datasource, textotraducido string, theme string, ...) error
- func SetVerified(sitecontext applications.Datasource, theme string, key string, field string, ...) error
- func Setup(ds applications.Datasource, prefix string) ([]string, error)
- func StartContext(ds applications.Datasource, ctx *context.Context) error
- func Synchronize(ds applications.Datasource, prefix string) ([]string, error)
- func Translate(sitecontext applications.Datasource, theme string, key string, ...)
- func TranslateOne(input string) (string, error)
- type TranslationBlock
Constants ¶
const ( SOURCETABLE = 1 SOURCEFILE = 2 )
Variables ¶
var ModuleEntries = assets.ModuleEntries{ TranslateOne: TranslateOne, }
Functions ¶
func AddTheme ¶
func AddTheme(sitecontext applications.Datasource, theme string, name string, source int, link string, fields string) error
func GetTranslation ¶
func GetTranslation(sitecontext applications.Datasource, textooriginal string, theme string, key string, field string, lang language.Tag) (string, bool, time.Time, int)
return: translation, ok (true, false), lastdate, lastverified (0, 1, 2) ok = true: texto correcto, false = no existe el texto last date = fecha en la cual se tradujo ( si no es español y ok = true) lastverified = 0: auto (o español original), 1 = verified, 2 = original modified (not re-translated, pending)
func GoogleTranslation ¶
func GoogleTranslation(data []string, fromLang language.Tag, toLang language.Tag) ([]translate.Translation, error)
Las credenciales de conección de google estan dentro del directorio accesible por GO en el archivo JSON de credenciales service_account
func SetTranslation ¶
func SetTranslation(sitecontext applications.Datasource, textotraducido string, theme string, key string, field string, lang language.Tag, verified int) error
return: error
func SetVerified ¶
func SetVerified(sitecontext applications.Datasource, theme string, key string, field string, lang language.Tag, verified int) error
return: error
func Setup ¶
func Setup(ds applications.Datasource, prefix string) ([]string, error)
InitModule is called during the init phase to link the module with the system adds tables and caches to ctx::database
func StartContext ¶
func StartContext(ds applications.Datasource, ctx *context.Context) error
func Synchronize ¶
func Synchronize(ds applications.Datasource, prefix string) ([]string, error)
func Translate ¶
func Translate(sitecontext applications.Datasource, theme string, key string, maindata xdominion.XRecordDef, fields map[string]interface{}, fromLang language.Tag, toLang language.Tag)
All purpose Translation method for structures Any MAINDATA record MUST have a lastmodif field
func TranslateOne ¶ added in v0.0.16
Types ¶
type TranslationBlock ¶
type TranslationBlock struct {
// contains filtered or unexported fields
}
func NewTranslationBlock ¶
func (*TranslationBlock) Get ¶
func (tb *TranslationBlock) Get(field string) string
func (*TranslationBlock) Set ¶
func (tb *TranslationBlock) Set(field string, value string)
func (*TranslationBlock) Verify ¶
func (tb *TranslationBlock) Verify(sitecontext applications.Datasource)