Skip to content

Commit

Permalink
Merge pull request #570 from nextcloud/feat/more-translation-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv committed Jan 25, 2023
2 parents 9ebcc9b + 84fa496 commit 1252ea5
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 144 deletions.
5 changes: 3 additions & 2 deletions lib/translation.ts
Expand Up @@ -86,11 +86,12 @@ export function translate(
}

const bundle = getAppTranslations(app)
const translation = bundle.translations[text] || text
let translation = bundle.translations[text] || text
translation = Array.isArray(translation) ? translation[0] : translation

if (typeof vars === 'object' || number !== undefined) {
return optSanitize(_build(
typeof translation === 'string' ? translation : translation[0],
translation,
vars,
number
))
Expand Down
142 changes: 0 additions & 142 deletions tests/index.test.js

This file was deleted.

0 comments on commit 1252ea5

Please sign in to comment.