Make singular/plural distinction
When displaying metadata lists in the detailed modal, e.g. creators
, programming languages
, plural form should only be used if the list contains more than one item.
Some fields already respect this (e.g. creators
, programming languages
) others do not (e.g. requirements
).
Fortunately English and German behave in the same way, so one solution fits one language. It can be addressed by code like this (from src/main/webapp/app/exercise/exercise-details/exercise-details.component.html
)
<ng-container *ngIf="exercise.programmingLanguages">
<tr *ngIf="exercise.programmingLanguages.length > 0">
<td *ngIf="exercise.programmingLanguages.length === 1"
jhiTranslate="exercise.metadata.programmingLanguageSingular"
class="metadata-table-description">
</td>
<td *ngIf="exercise.programmingLanguages.length > 1"
jhiTranslate="exercise.metadata.programmingLanguagesPlural"
class="metadata-table-description">
</td>
<td class="metadata-table-value"
[innerHTML]="arrayToString(exercise.programmingLanguages)">
</td>
</tr>
</ng-container>
and the corresponding string definitions in i18n
.