Skip to content

Commit

Permalink
Review Finding 7: HumanDuration: Move keys for translations to prefix…
Browse files Browse the repository at this point in the history
… 'Duration' instead of 'ArenaInfoPanel'
  • Loading branch information
sgcr committed Sep 3, 2024
1 parent 0fa976c commit 36ca4da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/main/java/core/util/HumanDuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ public static HumanDuration fromSeconds(long duration) {
public String toHumanString() {
ArrayList<String> strings = new ArrayList<>();
if (days != 0) {
final var unit = getLanguageString("ArenaInfoPanel.days_abbreviation");
final var unit = getLanguageString("Duration.days_abbreviation");
strings.add(String.format(DURATION_SUB_FORMAT, days, unit));
}
if (hours != 0) {
final var unit = getLanguageString("ArenaInfoPanel.hours_abbreviation");
final var unit = getLanguageString("Duration.hours_abbreviation");
strings.add(String.format(DURATION_SUB_FORMAT, hours, unit));
}
if (minutes != 0) {
final var unit = getLanguageString("ArenaInfoPanel.minutes_abbreviation");
final var unit = getLanguageString("Duration.minutes_abbreviation");
strings.add(String.format(DURATION_SUB_FORMAT, minutes, unit));
}
if (seconds != 0) {
final var unit = getLanguageString("ArenaInfoPanel.seconds_abbreviation");
final var unit = getLanguageString("Duration.seconds_abbreviation");
strings.add(String.format(DURATION_SUB_FORMAT, seconds, unit));
}
return String.join(", ", strings);
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/language/English.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2454,9 +2454,9 @@ ArenaInfoPanel.change_in_percent=Change in %
ArenaInfoPanel.future=Future
ArenaInfoPanel.finished_in_n_days_format=Finished in %s days.
ArenaInfoPanel.built=Build!
ArenaInfoPanel.days_abbreviation=d
ArenaInfoPanel.hours_abbreviation=h
ArenaInfoPanel.minutes_abbreviation=m
ArenaInfoPanel.seconds_abbreviation=s
Duration.days_abbreviation=d
Duration.hours_abbreviation=h
Duration.minutes_abbreviation=m
Duration.seconds_abbreviation=s
ArenaInfoPanel.sum_sign=
ArenaInfoPanel.total_seats_and_sum_sign=Total Seats ∑
8 changes: 4 additions & 4 deletions src/main/resources/language/German.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2276,9 +2276,9 @@ ArenaInfoPanel.change_in_percent=Veränderung in %
ArenaInfoPanel.future=Zukunft
ArenaInfoPanel.finished_in_n_days_format=Fertigstellung in %s Tagen.
ArenaInfoPanel.built=Ausgebaut!
ArenaInfoPanel.days_abbreviation=T
ArenaInfoPanel.hours_abbreviation=S
ArenaInfoPanel.minutes_abbreviation=M
ArenaInfoPanel.seconds_abbreviation=s
Duration.days_abbreviation=T
Duration.hours_abbreviation=S
Duration.minutes_abbreviation=M
Duration.seconds_abbreviation=s
ArenaInfoPanel.sum_sign=
ArenaInfoPanel.total_seats_and_sum_sign=Gesamtgrösse ∑

0 comments on commit 36ca4da

Please sign in to comment.