Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/util/languages/translation_test.go
Atvaark 6e546facc0 Fix i18n file errors
- Fixed an error in the spanish and chinese translation file
- Refactored reading the translation files
  Instead of ignoring errors in the non-default language files
  the error will now be returned and the remaining files will
  not be loaded.
- Added a unit test to check if all translation files are valid
- Added an i18n config to specify the translations dir and the
  default language
2017-05-13 22:52:17 +02:00

19 lignes
343 o
Go

package languages
import (
"path"
"testing"
"github.com/ewhal/nyaa/config"
)
func TestInitI18n(t *testing.T) {
conf := config.DefaultI18nConfig
conf.TranslationsDirectory = path.Join("..", "..", conf.TranslationsDirectory)
err := InitI18n(conf)
if err != nil {
t.Errorf("failed to initialize language translations: %v", err)
}
}