func (code LanguageCode) Validate() (bool, error) {
	for _, possibleCode := range AllLanguageCodes {
		if possibleCode == code {
			return true, nil
		}
	}
	return false, ErrInvalidLanguage
}
Validate a language code
package domain
import (
	"strings"
	"github.com/srvc/fail"
)
type LanguageCode string
const (
	Global     LanguageCode = "GLO"  
	Arabic     LanguageCode = "ara"
	Chinese    LanguageCode = "zho"
	Croatian   LanguageCode = "hrv"
	Czech      LanguageCode = "ces"
	Dutch      LanguageCode = "nld"
	English    LanguageCode = "eng"
	Esperanto  LanguageCode = "epo"
	Finnish    LanguageCode = "fin"
	French     LanguageCode = "fra"
	German     LanguageCode = "deu"
	Greek      LanguageCode = "ell"
	Hebrew     LanguageCode = "heb"
	Hungarian  LanguageCode = "hun"
	Irish      LanguageCode = "gle"
	Italian    LanguageCode = "ita"
	Japanese   LanguageCode = "jpn"
	Korean     LanguageCode = "kor"
	Latin      LanguageCode = "lat"
	Polish     LanguageCode = "pol"
	Portuguese LanguageCode = "por"
	Russian    LanguageCode = "rus"
	Spanish    LanguageCode = "spa"
	Swedish    LanguageCode = "swe"
	Thai       LanguageCode = "tha"
	Turkish    LanguageCode = "tur"
)
type LanguageCodes []LanguageCode
var AllLanguageCodes = LanguageCodes{
	Global,
	Arabic,
	Chinese,
	Croatian,
	Czech,
	Dutch,
	Esperanto,
	English,
	Finnish,
	French,
	German,
	Greek,
	Hebrew,
	Hungarian,
	Irish,
	Italian,
	Japanese,
	Korean,
	Latin,
	Polish,
	Portuguese,
	Russian,
	Spanish,
	Swedish,
	Thai,
	Turkish,
}
func (codes LanguageCodes) ContainsLanguage(target LanguageCode) bool {
	for _, code := range codes {
		if code == target {
			return true
		}
	}
	return false
}
var ErrInvalidLanguage = fail.New("supplied language is not supported")