Skip to content

Commit

Permalink
Fix the support for numeric phrase variants
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Feb 2, 2024
1 parent 0de8476 commit d11cd7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions ts/WoltLabSuite/WebComponent/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ function selectPlural(parameters: PluralParameters): string {
}

// handle numeric attributes
const numericAttribute = Object.keys(parameters).find((key) => {
return key.toString() === parseInt(key).toString() && key.toString() === value.toString();
});

if (numericAttribute) {
return numericAttribute;
if (Object.hasOwn(parameters, value.toString())) {
return parameters[value];
}

let category = pluralRules.select(value);
Expand Down
Loading

0 comments on commit d11cd7d

Please sign in to comment.