Skip to content

Commit

Permalink
fix: i18n translations using sprintf post processor (#30685)
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rajpal authored Oct 19, 2023
1 parent f7b07a0 commit 704ed0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-onions-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fix i18n translations using sprintf post processor
2 changes: 1 addition & 1 deletion apps/meteor/app/utils/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const i18n = i18next.use(sprintf);

export const addSprinfToI18n = function (t: (typeof i18n)['t']) {
return function (key: string, ...replaces: any): string {
if (replaces[0] === undefined || isObject(replaces[0])) {
if (replaces[0] === undefined || (isObject(replaces[0]) && !Array.isArray(replaces[0]))) {
return t(key, ...replaces);
}

Expand Down

0 comments on commit 704ed0f

Please sign in to comment.