func (l *Locale) AddTranslator(dom string, tr Translator) {
	l.Lock()
	if l.Domains == nil {
		l.Domains = make(map[string]Translator)
	}
	if l.defaultDomain == "" {
		l.defaultDomain = dom
	}
	l.Domains[dom] = tr
	l.Unlock()
}
AddTranslator takes a domain name and a Translator object to make it available in the Locale object.
package gotext
import (
	"bytes"
	"encoding/gob"
	"os"
	"path"
	"sync"
)
type Locale struct {
	path string
	lang string
	Domains map[string]Translator
	defaultDomain string
	sync.RWMutex
}
func NewLocale(p, l string) *Locale {
	return &Locale{
		path:    p,
		lang:    SimplifiedLocale(l),
		Domains: make(map[string]Translator),
	}
}
func (l *Locale) findExt(dom, ext string) string {
	filename := path.Join(l.path, l.lang, "LC_MESSAGES", dom+"."+ext)
	if _, err := os.Stat(filename); err == nil {
		return filename
	}
	if len(l.lang) > 2 {
		filename = path.Join(l.path, l.lang[:2], "LC_MESSAGES", dom+"."+ext)
		if _, err := os.Stat(filename); err == nil {
			return filename
		}
	}
	filename = path.Join(l.path, l.lang, dom+"."+ext)
	if _, err := os.Stat(filename); err == nil {
		return filename
	}
	if len(l.lang) > 2 {
		filename = path.Join(l.path, l.lang[:2], dom+"."+ext)
		if _, err := os.Stat(filename); err == nil {
			return filename
		}
	}
	return ""
}
func (l *Locale) AddDomain(dom string) {
	var poObj Translator
	file := l.findExt(dom, "po")
	if file != "" {
		poObj = NewPo()
		poObj.ParseFile(file)
	} else {
		file = l.findExt(dom, "mo")
		if file != "" {
			poObj = NewMo()
			poObj.ParseFile(file)
		} else {
			return
		}
	}
	l.Lock()
	if l.Domains == nil {
		l.Domains = make(map[string]Translator)
	}
	if l.defaultDomain == "" {
		l.defaultDomain = dom
	}
	l.Domains[dom] = poObj
	l.Unlock()
}