Skip to content

Commit

Permalink
client: Fix MessageFormat string placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Oct 4, 2022
1 parent d1b04af commit 7a0aff6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/helpers/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export function i18nFormat(translated, params) {
case ',':
if (placeholder) {
if (state == 'index') {
placeholder.index = parseInt(buffer.trim());
const index = buffer.trim();
const intIndex = parseInt(index);
placeholder.index = Number.isNaN(intIndex) ? index : intIndex;
placeholder.value = params[placeholder.index];
buffer = '';
} else if (state == 'type') {
Expand Down

0 comments on commit 7a0aff6

Please sign in to comment.