diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-05-12 15:08:58 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-12 16:37:29 -0400 |
commit | 84d2482ddbff9564c9ad75b2d30af66e3ddfd44d (patch) | |
tree | 8bfa567d2b6381f4a996ada2deff8a16aa85a3ac /Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go | |
parent | d1efb66ad7b017f0fbfe6f0c20843b30f396e504 (diff) | |
download | chat-84d2482ddbff9564c9ad75b2d30af66e3ddfd44d.tar.gz chat-84d2482ddbff9564c9ad75b2d30af66e3ddfd44d.tar.bz2 chat-84d2482ddbff9564c9ad75b2d30af66e3ddfd44d.zip |
Updating go depencancies. Switching to go1.6 vendoring (#2949)
Diffstat (limited to 'Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go b/Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go deleted file mode 100644 index 1010e5947..000000000 --- a/Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go +++ /dev/null @@ -1,57 +0,0 @@ -package translation - -import ( - "github.com/nicksnyder/go-i18n/i18n/language" -) - -type singleTranslation struct { - id string - template *template -} - -func (st *singleTranslation) MarshalInterface() interface{} { - return map[string]interface{}{ - "id": st.id, - "translation": st.template, - } -} - -func (st *singleTranslation) ID() string { - return st.id -} - -func (st *singleTranslation) Template(pc language.Plural) *template { - return st.template -} - -func (st *singleTranslation) UntranslatedCopy() Translation { - return &singleTranslation{st.id, mustNewTemplate("")} -} - -func (st *singleTranslation) Normalize(language *language.Language) Translation { - return st -} - -func (st *singleTranslation) Backfill(src Translation) Translation { - if st.template == nil || st.template.src == "" { - st.template = src.Template(language.Other) - } - return st -} - -func (st *singleTranslation) Merge(t Translation) Translation { - other, ok := t.(*singleTranslation) - if !ok || st.ID() != t.ID() { - return t - } - if other.template != nil && other.template.src != "" { - st.template = other.template - } - return st -} - -func (st *singleTranslation) Incomplete(l *language.Language) bool { - return st.template == nil || st.template.src == "" -} - -var _ = Translation(&singleTranslation{}) |