db

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package db provides a database translation provider. It creates raw message entries in the database and is able to create a i18n.Bundle with all the translated messages. JSON files can be generated for each language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	server.Orm
	ID int

	MessageID   string
	Lang        string
	Description query.NullString `json:"-"`

	Zero  query.NullString `json:"-"`
	One   query.NullString `json:"-"`
	Two   query.NullString `json:"-"`
	Few   query.NullString `json:"-"`
	Many  query.NullString `json:"-"`
	Other query.NullString
}

Message orm.

func I18nMessageToOrmMessage

func I18nMessageToOrmMessage(m i18n.Message) Message

I18nMessageToOrmMessage converts a i18n.Message to an orm message.

func (*Message) DefaultTableName

func (m *Message) DefaultTableName() string

DefaultTableName sets a different table name.

func (*Message) ToI18nMessage

func (m *Message) ToI18nMessage() *i18n.Message

ToI18nMessage converts a orm message to an i18n.Message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL