You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mock.go 538B

123456789101112131415161718192021222324252627
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package translation
  4. import "fmt"
  5. // MockLocale provides a mocked locale without any translations
  6. type MockLocale struct{}
  7. var _ Locale = (*MockLocale)(nil)
  8. func (l MockLocale) Language() string {
  9. return "en"
  10. }
  11. func (l MockLocale) Tr(s string, _ ...any) string {
  12. return s
  13. }
  14. func (l MockLocale) TrN(_cnt any, key1, _keyN string, _args ...any) string {
  15. return key1
  16. }
  17. func (l MockLocale) PrettyNumber(v any) string {
  18. return fmt.Sprint(v)
  19. }