Skip to content

Commit

Permalink
refactor: get rid of numberOfPluralFormsPerLanguage test-only variable
Browse files Browse the repository at this point in the history
The `numberOfPluralFormsPerLanguage` variable is only used for tests, so it
should be declared in the test file.
  • Loading branch information
jvoisin authored Dec 8, 2024
1 parent a913f3f commit 30c4438
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
20 changes: 20 additions & 0 deletions internal/locale/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ func TestMissingTranslations(t *testing.T) {
}

func TestTranslationFilePluralForms(t *testing.T) {
var numberOfPluralFormsPerLanguage = map[string]int{
"en_US": 2,
"es_ES": 2,
"fr_FR": 2,
"de_DE": 2,
"pl_PL": 3,
"pt_BR": 2,
"zh_CN": 1,
"zh_TW": 1,
"nl_NL": 2,
"ru_RU": 3,
"it_IT": 2,
"ja_JP": 1,
"tr_TR": 2,
"el_EL": 2,
"fi_FI": 2,
"hi_IN": 2,
"uk_UA": 3,
"id_ID": 1,
}
for language := range AvailableLanguages() {
messages, err := loadTranslationFile(language)
if err != nil {
Expand Down
21 changes: 0 additions & 21 deletions internal/locale/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,6 @@

package locale // import "miniflux.app/v2/internal/locale"

var numberOfPluralFormsPerLanguage = map[string]int{
"en_US": 2,
"es_ES": 2,
"fr_FR": 2,
"de_DE": 2,
"pl_PL": 3,
"pt_BR": 2,
"zh_CN": 1,
"zh_TW": 1,
"nl_NL": 2,
"ru_RU": 3,
"it_IT": 2,
"ja_JP": 1,
"tr_TR": 2,
"el_EL": 2,
"fi_FI": 2,
"hi_IN": 2,
"uk_UA": 3,
"id_ID": 1,
}

// AvailableLanguages returns the list of available languages.
func AvailableLanguages() map[string]string {
return map[string]string{
Expand Down

0 comments on commit 30c4438

Please sign in to comment.