Skip to content

Commit

Permalink
Fix next-intl's function name
Browse files Browse the repository at this point in the history
  • Loading branch information
ITJesse authored May 5, 2024
1 parent 66313b9 commit 8caca25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frameworks/next-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class NextIntlFramework extends Framework {
const ranges: ScopeRange[] = []
const text = document.getText()

// Find matches of `useTranslations` and `getTranslator`. Later occurences will
// Find matches of `useTranslations` and `getTranslations`. Later occurences will
// override previous ones (this allows for multiple components with different
// namespaces in the same file).
const regex = /(useTranslations\(\s*|getTranslator\(.*,\s*)(['"`](.*?)['"`])?/g
const regex = /(useTranslations\(\s*|getTranslations\(.*,\s*)(['"`](.*?)['"`])?/g
let prevGlobalScope = false
for (const match of text.matchAll(regex)) {
if (typeof match.index !== 'number')
Expand Down

0 comments on commit 8caca25

Please sign in to comment.