locale.go 498 B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package mocks
  5. import (
  6. "gopkg.in/macaron.v1"
  7. )
  8. var _ macaron.Locale = (*Locale)(nil)
  9. type Locale struct {
  10. MockLang string
  11. MockTr func(string, ...interface{}) string
  12. }
  13. func (l *Locale) Language() string {
  14. return l.MockLang
  15. }
  16. func (l *Locale) Tr(format string, args ...interface{}) string {
  17. return l.MockTr(format, args...)
  18. }