Skip to content

Commit

Permalink
Shorter notice when train sets are added to a train
Browse files Browse the repository at this point in the history
  • Loading branch information
geertw committed Aug 24, 2022
1 parent 2129cbf commit 764cd10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions models/departure.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ func (departure Departure) GetRemarksTips(language string) (remarks, tips []stri

if len(addedMaterialUnits) > 0 {
if len(addedMaterialUnits) == 1 {
tips = append(tips, fmt.Sprintf(Translate("Trein wordt op dit station verlengd. Treinstel %s wordt op dit station bijgeplaatst", "Coach %s is added to the train at this station", language), strings.Join(addedMaterialUnits, ", ")))
tips = append(tips, fmt.Sprintf(Translate("Treinstel %s wordt op dit station bijgeplaatst", "Coach %s is added to the train at this station", language), strings.Join(addedMaterialUnits, ", ")))
} else {
tips = append(tips, fmt.Sprintf(Translate("Trein wordt op dit station verlengd. Treinstellen %s worden op dit station bijgeplaatst", "Coaches %s are added to the train at this station", language), strings.Join(addedMaterialUnits, ", ")))
tips = append(tips, fmt.Sprintf(Translate("Treinstellen %s worden op dit station bijgeplaatst", "Coaches %s are added to the train at this station", language), strings.Join(addedMaterialUnits, ", ")))
}
}

Expand Down
8 changes: 4 additions & 4 deletions models/departure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ func TestDepartureMaterialTipsAdded(t *testing.T) {

_, tips := departure.GetRemarksTips("nl")

if tips[0] != "Trein wordt op dit station verlengd. Treinstel 1234 wordt op dit station bijgeplaatst" {
t.Errorf("Tips: expected %s, got %s", "Trein wordt op dit station verlengd. Treinstel 1234 wordt op dit station bijgeplaatst", tips[0])
if tips[0] != "Treinstel 1234 wordt op dit station bijgeplaatst" {
t.Errorf("Tips: expected %s, got %s", "Treinstel 1234 wordt op dit station bijgeplaatst", tips[0])
}

departure = Departure{
Expand Down Expand Up @@ -291,8 +291,8 @@ func TestDepartureMaterialTipsAdded(t *testing.T) {

_, tips = departure.GetRemarksTips("nl")

if tips[0] != "Trein wordt op dit station verlengd. Treinstellen 1234, 2345 worden op dit station bijgeplaatst" {
t.Errorf("Tips: expected %s, got %s", "Trein wordt op dit station verlengd. Treinstellen 1234, 2345 worden op dit station bijgeplaatst", tips[0])
if tips[0] != "Treinstellen 1234, 2345 worden op dit station bijgeplaatst" {
t.Errorf("Tips: expected %s, got %s", "Treinstellen 1234, 2345 worden op dit station bijgeplaatst", tips[0])
}
}

Expand Down

0 comments on commit 764cd10

Please sign in to comment.